[patch] rfc: shark llvm2.7 r84651 SharkMemoryManager fix.

View: New views
2 Messages — Rating Filter:   Alert me  

[patch] rfc: shark llvm2.7 r84651 SharkMemoryManager fix.

by Xerxes Rånby :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The LLVM JITMemoryManager changed a little in r84651 and by using the
attached patch re-enables Shark to be build-able using the latest LLVM
svn trunk.
http://llvm.org/viewvc/llvm-project?view=rev&revision=84651

Clear to push?

Cheers and have a great day!
Xerxes


Index: icedtea6/ports/hotspot/src/share/vm/shark/sharkMemoryManager.cpp
===================================================================
--- icedtea6.orig/ports/hotspot/src/share/vm/shark/sharkMemoryManager.cpp
+++ icedtea6/ports/hotspot/src/share/vm/shark/sharkMemoryManager.cpp
@@ -86,10 +86,24 @@ void SharkMemoryManager::setMemoryExecut
   mm()->setMemoryExecutable();
 }
 
+#if SHARK_LLVM_VERSION >= 27
+void SharkMemoryManager::deallocateExceptionTable(void *ptr)
+{
+  mm()->deallocateExceptionTable(ptr);
+}
+
+void SharkMemoryManager::deallocateFunctionBody(void *ptr)
+{
+  mm()->deallocateFunctionBody(ptr);
+}
+#endif
+
+#if SHARK_LLVM_VERSION < 27
 void SharkMemoryManager::deallocateMemForFunction(const Function* F)
 {
   return mm()->deallocateMemForFunction(F);
 }
+#endif
 
 #if SHARK_LLVM_VERSION >= 26
 uint8_t* SharkMemoryManager::allocateGlobal(uintptr_t Size, unsigned int Alignment)
Index: icedtea6/ports/hotspot/src/share/vm/shark/sharkMemoryManager.hpp
===================================================================
--- icedtea6.orig/ports/hotspot/src/share/vm/shark/sharkMemoryManager.hpp
+++ icedtea6/ports/hotspot/src/share/vm/shark/sharkMemoryManager.hpp
@@ -79,7 +79,13 @@ class SharkMemoryManager : public llvm::
 #endif
   void setMemoryWritable();
   void setMemoryExecutable();
+#if SHARK_LLVM_VERSION >= 27
+  void deallocateExceptionTable(void *ptr);
+  void deallocateFunctionBody(void *ptr);
+#endif
+#if SHARK_LLVM_VERSION < 27
   void deallocateMemForFunction(const llvm::Function* F);
+#endif
 
 #if SHARK_LLVM_VERSION >= 25
   unsigned char *allocateSpace(intptr_t Size,

Re: [patch] rfc: shark llvm2.7 r84651 SharkMemoryManager fix.

by Gary Benson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Xerxes Rånby wrote:
> The LLVM JITMemoryManager changed a little in r84651 and by using
> the attached patch re-enables Shark to be build-able using the
> latest LLVM svn trunk.
> http://llvm.org/viewvc/llvm-project?view=rev&revision=84651
>
> Clear to push?

Rather than having two #ifs, how about having a #else?
Otherwise, please push :)

Cheers,
Gary

--
http://gbenson.net/