changeset 1662:a98ad2958053

Adjust Shark to LLVM 2.6svn rev 79521. * ports/hotspot/src/share/vm/shark/llvmValue.hpp (LLVMValue::jfloat_constant): Push LLVMContexts through the llvm::Type APIs to handle LLVM 2.6svn API change. (LLVMValue::jdouble_constant): Likewise. (LLVMValue::bit_constant): Likewise. * ports/hotspot/src/share/vm/shark/sharkType.cpp (SharkType::initialize): Likewise. * ports/hotspot/src/share/vm/shark/sharkType.hpp (SharkType::intptr_type): Likewise. (SharkType::jboolean_type): Likewise. (SharkType::jbyte_type): Likewise. (SharkType::jchar_type): Likewise. (SharkType::jshort_type): Likewise. (SharkType::jint_type): Likewise. (SharkType::jlong_type): Likewise. (SharkType::jfloat_type): Likewise. (SharkType::jdouble_type): Likewise. * ports/hotspot/src/share/vm/shark/sharkBuilder.cpp (SharkBuilder::make_type): Likewise. (SharkBuilder::CreateBlock): Push LLVMContexts through the BasicBlock::Create APIs to handle LLVM 2.6svn API change. * ports/hotspot/src/share/vm/shark/sharkFunction.hpp (SharkFunction::CreateBlock): Likewise.
author Xerxes R?nby <xerxes@zafena.se>
date Thu, 20 Aug 2009 12:22:56 +0200
parents caf6aebb73ca
children 3bb4b0a830b3
files ChangeLog ports/hotspot/src/share/vm/shark/llvmValue.hpp ports/hotspot/src/share/vm/shark/sharkBuilder.cpp ports/hotspot/src/share/vm/shark/sharkFunction.hpp ports/hotspot/src/share/vm/shark/sharkType.cpp ports/hotspot/src/share/vm/shark/sharkType.hpp
diffstat 6 files changed, 130 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Aug 21 13:36:15 2009 +0200
+++ b/ChangeLog	Thu Aug 20 12:22:56 2009 +0200
@@ -1,3 +1,35 @@
+2009-08-20  Xerxes RĂ„nby  <xerxes@zafena.se>
+
+	Adjust Shark to LLVM 2.6svn rev 79521.
+
+	* ports/hotspot/src/share/vm/shark/llvmValue.hpp
+	(LLVMValue::jfloat_constant): Push LLVMContexts through the
+	llvm::Type APIs to handle LLVM 2.6svn API change.
+	(LLVMValue::jdouble_constant): Likewise.
+	(LLVMValue::bit_constant): Likewise.
+
+	* ports/hotspot/src/share/vm/shark/sharkType.cpp
+	(SharkType::initialize): Likewise.
+
+	* ports/hotspot/src/share/vm/shark/sharkType.hpp
+	(SharkType::intptr_type): Likewise.
+	(SharkType::jboolean_type): Likewise.
+	(SharkType::jbyte_type): Likewise.
+	(SharkType::jchar_type): Likewise.
+	(SharkType::jshort_type): Likewise.
+	(SharkType::jint_type): Likewise.
+	(SharkType::jlong_type): Likewise.
+	(SharkType::jfloat_type): Likewise.
+	(SharkType::jdouble_type): Likewise.
+
+	* ports/hotspot/src/share/vm/shark/sharkBuilder.cpp
+	(SharkBuilder::make_type): Likewise.
+	(SharkBuilder::CreateBlock): Push LLVMContexts through the
+	BasicBlock::Create APIs to handle LLVM 2.6svn API change.
+
+	* ports/hotspot/src/share/vm/shark/sharkFunction.hpp
+	(SharkFunction::CreateBlock): Likewise.
+
 2009-08-20  Gary Benson  <gbenson@redhat.com>
 
 	* ports/hotspot/src/cpu/zero/vm/bc.def: Renamed to...
--- a/ports/hotspot/src/share/vm/shark/llvmValue.hpp	Fri Aug 21 13:36:15 2009 +0200
+++ b/ports/hotspot/src/share/vm/shark/llvmValue.hpp	Thu Aug 20 12:22:56 2009 +0200
@@ -61,7 +61,11 @@
  public:
   static llvm::ConstantInt* bit_constant(int value)
   {
+#if SHARK_LLVM_VERSION >= 26
+    return llvm::ConstantInt::get(llvm::Type::getInt1Ty(llvm::getGlobalContext()), value, false);
+#else
     return llvm::ConstantInt::get(llvm::Type::Int1Ty, value, false);
+#endif
   }
   static llvm::ConstantInt* intptr_constant(intptr_t value)
   {
--- a/ports/hotspot/src/share/vm/shark/sharkBuilder.cpp	Fri Aug 21 13:36:15 2009 +0200
+++ b/ports/hotspot/src/share/vm/shark/sharkBuilder.cpp	Thu Aug 20 12:22:56 2009 +0200
@@ -155,9 +155,17 @@
     // Miscellaneous
   case 'v':
     assert(void_ok, "should be");
+#if SHARK_LLVM_VERSION >= 26
+    return Type::getVoidTy(getGlobalContext());
+#else
     return Type::VoidTy;
+#endif
   case '1':
+#if SHARK_LLVM_VERSION >= 26
+    return Type::getInt1Ty(getGlobalContext());
+#else
     return Type::Int1Ty;
+#endif
 
   default:
     ShouldNotReachHere();
@@ -590,5 +598,9 @@
 
 BasicBlock* SharkBuilder::CreateBlock(BasicBlock* ip, const char* name) const
 {
+#if SHARK_LLVM_VERSION >= 26
+  return BasicBlock::Create(getGlobalContext(), name, GetInsertBlock()->getParent(), ip);
+#else
   return BasicBlock::Create(name, GetInsertBlock()->getParent(), ip);
+#endif
 }  
--- a/ports/hotspot/src/share/vm/shark/sharkFunction.hpp	Fri Aug 21 13:36:15 2009 +0200
+++ b/ports/hotspot/src/share/vm/shark/sharkFunction.hpp	Thu Aug 20 12:22:56 2009 +0200
@@ -89,7 +89,11 @@
  public:
   llvm::BasicBlock* CreateBlock(const char* name = "") const
   {
+#if SHARK_LLVM_VERSION >= 26
+    return llvm::BasicBlock::Create(llvm::getGlobalContext(), name, function(), block_insertion_point());
+#else
     return llvm::BasicBlock::Create(name, function(), block_insertion_point());
+#endif
   }
 
   // Stack management
--- a/ports/hotspot/src/share/vm/shark/sharkType.cpp	Fri Aug 21 13:36:15 2009 +0200
+++ b/ports/hotspot/src/share/vm/shark/sharkType.cpp	Thu Aug 20 12:22:56 2009 +0200
@@ -45,35 +45,71 @@
 {
   // VM types
   _cpCacheEntry_type = PointerType::getUnqual(
+#if SHARK_LLVM_VERSION >= 26
+    ArrayType::get(Type::getInt8Ty(getGlobalContext()), sizeof(ConstantPoolCacheEntry)));
+#else
     ArrayType::get(Type::Int8Ty, sizeof(ConstantPoolCacheEntry)));
-  
+#endif
+
   _itableOffsetEntry_type = PointerType::getUnqual(
+#if SHARK_LLVM_VERSION >= 26
+    ArrayType::get(Type::getInt8Ty(getGlobalContext()), itableOffsetEntry::size() * wordSize));
+#else
     ArrayType::get(Type::Int8Ty, itableOffsetEntry::size() * wordSize));
-  
+#endif
+
   _klass_type = PointerType::getUnqual(
+#if SHARK_LLVM_VERSION >= 26
+    ArrayType::get(Type::getInt8Ty(getGlobalContext()), sizeof(Klass)));
+#else
     ArrayType::get(Type::Int8Ty, sizeof(Klass)));
-  
+#endif
+
   _methodOop_type = PointerType::getUnqual(
+#if SHARK_LLVM_VERSION >= 26
+    ArrayType::get(Type::getInt8Ty(getGlobalContext()), sizeof(methodOopDesc)));
+#else
     ArrayType::get(Type::Int8Ty, sizeof(methodOopDesc)));
-  
+#endif
+
   _monitor_type = ArrayType::get(
+#if SHARK_LLVM_VERSION >= 26
+      Type::getInt8Ty(getGlobalContext()),
+#else
       Type::Int8Ty,
+#endif
       frame::interpreter_frame_monitor_size() * wordSize);
-  
+
   _oop_type = PointerType::getUnqual(
+#if SHARK_LLVM_VERSION >= 26
+    ArrayType::get(Type::getInt8Ty(getGlobalContext()), sizeof(oopDesc)));
+#else
     ArrayType::get(Type::Int8Ty, sizeof(oopDesc)));
+#endif
 
   _thread_type = PointerType::getUnqual(
+#if SHARK_LLVM_VERSION >= 26
+    ArrayType::get(Type::getInt8Ty(getGlobalContext()), sizeof(JavaThread)));
+#else
     ArrayType::get(Type::Int8Ty, sizeof(JavaThread)));
+#endif
 
   _zeroStack_type = PointerType::getUnqual(
+#if SHARK_LLVM_VERSION >= 26
+    ArrayType::get(Type::getInt8Ty(getGlobalContext()), sizeof(ZeroStack)));
+#else
     ArrayType::get(Type::Int8Ty, sizeof(ZeroStack)));
+#endif
 
   std::vector<const Type*> params;
   params.push_back(methodOop_type());
   params.push_back(intptr_type());
   params.push_back(thread_type());
+#if SHARK_LLVM_VERSION >= 26
+  _entry_point_type = FunctionType::get(Type::getVoidTy(getGlobalContext()), params, false);
+#else
   _entry_point_type = FunctionType::get(Type::VoidTy, params, false);
+#endif
 
   // Java types a) on the stack and in fields, and b) in arrays
   for (int i = 0; i < T_CONFLICT + 1; i++) {
--- a/ports/hotspot/src/share/vm/shark/sharkType.hpp	Fri Aug 21 13:36:15 2009 +0200
+++ b/ports/hotspot/src/share/vm/shark/sharkType.hpp	Thu Aug 20 12:22:56 2009 +0200
@@ -31,8 +31,13 @@
  public:
   static const llvm::IntegerType* intptr_type()
   {
+#if SHARK_LLVM_VERSION >= 26
+    return LP64_ONLY(llvm::Type::getInt64Ty(llvm::getGlobalContext()))
+           NOT_LP64 (llvm::Type::getInt32Ty(llvm::getGlobalContext()));
+#else
     return LP64_ONLY(llvm::Type::Int64Ty)
            NOT_LP64 (llvm::Type::Int32Ty);
+#endif
   }
 
   // VM types
@@ -89,35 +94,67 @@
  public:
   static const llvm::IntegerType* jboolean_type()
   {
+#if SHARK_LLVM_VERSION >= 26
+    return llvm::Type::getInt8Ty(llvm::getGlobalContext());
+#else
     return llvm::Type::Int8Ty;
+#endif
   }
   static const llvm::IntegerType* jbyte_type()
   {
+#if SHARK_LLVM_VERSION >= 26
+    return llvm::Type::getInt8Ty(llvm::getGlobalContext());
+#else
     return llvm::Type::Int8Ty;
+#endif
   }
   static const llvm::IntegerType* jchar_type()
   {
+#if SHARK_LLVM_VERSION >= 26
+    return llvm::Type::getInt16Ty(llvm::getGlobalContext());
+#else
     return llvm::Type::Int16Ty;
+#endif
   }
   static const llvm::IntegerType* jshort_type()
   {
+#if SHARK_LLVM_VERSION >= 26
+    return llvm::Type::getInt16Ty(llvm::getGlobalContext());
+#else
     return llvm::Type::Int16Ty;
+#endif
   }
   static const llvm::IntegerType* jint_type()
   {
+#if SHARK_LLVM_VERSION >= 26
+    return llvm::Type::getInt32Ty(llvm::getGlobalContext());
+#else
     return llvm::Type::Int32Ty;
+#endif
   }
   static const llvm::IntegerType* jlong_type()
   {
+#if SHARK_LLVM_VERSION >= 26
+    return llvm::Type::getInt64Ty(llvm::getGlobalContext());
+#else
     return llvm::Type::Int64Ty;
+#endif
   }
   static const llvm::Type* jfloat_type()
   {
+#if SHARK_LLVM_VERSION >= 26
+    return llvm::Type::getFloatTy(llvm::getGlobalContext());
+#else
     return llvm::Type::FloatTy;
+#endif
   }
   static const llvm::Type* jdouble_type()
   {
+#if SHARK_LLVM_VERSION >= 26
+    return llvm::Type::getDoubleTy(llvm::getGlobalContext());
+#else
     return llvm::Type::DoubleTy;
+#endif
   }
   static const llvm::PointerType* jobject_type()
   {