changeset 1915:2a3a4c5b35e0

2009-07-09 Xerxes R?nby <xerxes@zafena.se> * ports/hotspot/src/share/vm/shark/sharkBuilder.cpp (SharkBuilder::SharkBuilder): Pass the LLVMContext returned from getGlobalContext() to the new IRBuilder constructor when llvm version are 2.6 or later to handle LLVM API change. * ports/hotspot/src/share/vm/shark/sharkMemoryManager.cpp: New methods allocateGlobal, setPoisonMemory, dependent on the llvm version. * ports/hotspot/src/share/vm/shark/sharkMemoryManager.hpp: Likewise.
author Xerxes R?nby <xerxes@zafena.se>
date Thu, 09 Jul 2009 12:49:11 +0200
parents d29fab296cd2
children 022c97ae92d2
files ChangeLog ports/hotspot/src/share/vm/shark/sharkBuilder.cpp ports/hotspot/src/share/vm/shark/sharkMemoryManager.cpp ports/hotspot/src/share/vm/shark/sharkMemoryManager.hpp
diffstat 4 files changed, 31 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Jul 08 11:28:08 2009 +0200
+++ b/ChangeLog	Thu Jul 09 12:49:11 2009 +0200
@@ -1,3 +1,15 @@
+2009-07-09  Xerxes Rånby  <xerxes@zafena.se>
+
+	* ports/hotspot/src/share/vm/shark/sharkBuilder.cpp
+	(SharkBuilder::SharkBuilder):  Pass the LLVMContext returned
+	from getGlobalContext() to the new IRBuilder constructor
+	when llvm version are 2.6 or later to handle LLVM API change.
+	* ports/hotspot/src/share/vm/shark/sharkMemoryManager.cpp:
+	New methods allocateGlobal, setPoisonMemory, dependent on the
+	llvm version.
+	* ports/hotspot/src/share/vm/shark/sharkMemoryManager.hpp:
+	Likewise.
+ 
 2009-07-08  Xerxes Rånby  <xerxes@zafena.se>
 
 	* ports/hotspot/src/share/vm/shark/sharkBuilder.hpp
--- a/ports/hotspot/src/share/vm/shark/sharkBuilder.cpp	Wed Jul 08 11:28:08 2009 +0200
+++ b/ports/hotspot/src/share/vm/shark/sharkBuilder.cpp	Thu Jul 09 12:49:11 2009 +0200
@@ -61,7 +61,14 @@
 #endif
 
 SharkBuilder::SharkBuilder(SharkCompiler* compiler)
+#if SHARK_LLVM_VERSION >= 26
+  // LLVM 2.6 requires a LLVMContext during IRBuilder construction.
+  // getGlobalConext() returns one that can be used as long as the shark
+  // compiler are single-threaded.
+  : IRBuilder<>(getGlobalContext()),
+#else
   : IRBuilder<>(),
+#endif
     _compiler(compiler)
 {
   init_external_functions();
--- a/ports/hotspot/src/share/vm/shark/sharkMemoryManager.cpp	Wed Jul 08 11:28:08 2009 +0200
+++ b/ports/hotspot/src/share/vm/shark/sharkMemoryManager.cpp	Thu Jul 09 12:49:11 2009 +0200
@@ -92,6 +92,11 @@
 }
 
 #if SHARK_LLVM_VERSION >= 26
+uint8_t* SharkMemoryManager::allocateGlobal(uintptr_t Size, unsigned int Alignment)
+{
+  return mm()->allocateGlobal(Size, Alignment);
+}
+
 void* SharkMemoryManager::getDlsymTable() const
 {
   return mm()->getDlsymTable();
@@ -102,6 +107,11 @@
   mm()->SetDlsymTable(ptr);
 }
 
+void SharkMemoryManager::setPoisonMemory(bool poison)
+{
+  mm()->setPoisonMemory(poison);
+}
+
 #endif
 
 #if SHARK_LLVM_VERSION >= 25
--- a/ports/hotspot/src/share/vm/shark/sharkMemoryManager.hpp	Wed Jul 08 11:28:08 2009 +0200
+++ b/ports/hotspot/src/share/vm/shark/sharkMemoryManager.hpp	Thu Jul 09 12:49:11 2009 +0200
@@ -74,6 +74,8 @@
 #if SHARK_LLVM_VERSION >= 26
   void* getDlsymTable() const;
   void SetDlsymTable(void *ptr);
+  void setPoisonMemory(bool);
+  uint8_t* allocateGlobal(uintptr_t, unsigned int);
 #endif
   void setMemoryWritable();
   void setMemoryExecutable();