changeset 1918:1791126ef6df

2009-07-17 Gary Benson <gbenson@redhat.com> * ports/hotspot/src/share/vm/shark/sharkBuilder.hpp (SharkBuilder::pointer_constant): Conditionalize a hack.
author Gary Benson <gbenson@redhat.com>
date Fri, 17 Jul 2009 06:04:59 -0400
parents 10b3039fa024
children 9a952e506f16
files ChangeLog ports/hotspot/src/share/vm/shark/sharkBuilder.hpp
diffstat 2 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Jul 15 12:56:10 2009 +0200
+++ b/ChangeLog	Fri Jul 17 06:04:59 2009 -0400
@@ -1,3 +1,8 @@
+2009-07-17  Gary Benson  <gbenson@redhat.com>
+
+	* ports/hotspot/src/share/vm/shark/sharkBuilder.hpp
+	(SharkBuilder::pointer_constant): Conditionalize a hack.
+
 2009-07-15  Xerxes RĂ„nby  <xerxes@zafena.se>
 
 	* ports/hotspot/src/share/vm/shark/llvmValue.hpp
--- a/ports/hotspot/src/share/vm/shark/sharkBuilder.hpp	Wed Jul 15 12:56:10 2009 +0200
+++ b/ports/hotspot/src/share/vm/shark/sharkBuilder.hpp	Fri Jul 17 06:04:59 2009 -0400
@@ -156,6 +156,9 @@
 
   llvm::Constant* pointer_constant(const void *ptr)
   {
+#if SHARK_LLVM_VERSION >= 25 || !defined(AMD64)
+    return LLVMValue::intptr_constant((intptr_t) ptr);
+#else
     // Create a pointer constant that points at PTR.  We do this by
     // creating a GlobalVariable mapped at PTR.  This is a workaround
     // for http://www.llvm.org/bugs/show_bug.cgi?id=2920
@@ -175,18 +178,13 @@
     snprintf(name, sizeof name - 1, "pointer_constant_%p", ptr);
 
     GlobalVariable *value = new GlobalVariable(
-#if SHARK_LLVM_VERSION >= 26
-      // LLVM 2.6 requires a LLVMContext during GlobalVariable construction.
-      // getGlobalConext() returns one that can be used as long as the shark
-      // compiler are single-threaded.
-      getGlobalContext(),
-#endif
       SharkType::intptr_type(),
       false, GlobalValue::ExternalLinkage,
       NULL, name, module());
     execution_engine()->addGlobalMapping(value, const_cast<void*>(ptr));
 
     return ConstantExpr::getPtrToInt(value, SharkType::intptr_type());
+#endif // SHARK_LLVM_VERSION >= 25 || !AMD64
   }
 
   // Helper for making pointers