[llvm-commits] [llvm] r156933 - in /llvm/trunk: lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h tools/lli/lli.cpp tools/llvm-rtdyld/llvm-rtdyld.cpp

Jim Grosbach grosbach at apple.com
Wed May 16 12:59:23 PDT 2012


Eventually it'll almost certainly get pulled into the DefaultMemoryManager when the old JIT goes away. Right now there's some artificial separation due to the co-existence of the MCJIT and the old JIT.

-Jim

On May 16, 2012, at 12:26 PM, Eli Friedman <eli.friedman at gmail.com> wrote:

> On Wed, May 16, 2012 at 11:50 AM, Danil Malyshev
> <dmalyshev at accesssoftek.com> wrote:
>> Author: danil
>> Date: Wed May 16 13:50:11 2012
>> New Revision: 156933
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=156933&view=rev
>> Log:
>> Added LLIMCJITMemoryManager to the lli. This manager will be used for MCJIT instead of DefaultJIMMemoryManager.
>> It's more flexible for MCJIT tasks, in addition it's provides a invalidation instruction cache for code sections which will be used before JIT code will be executed.
>> 
>> Modified:
>>    llvm/trunk/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
>>    llvm/trunk/tools/lli/lli.cpp
>>    llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp
>> 
>> Modified: llvm/trunk/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h?rev=156933&r1=156932&r2=156933&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h (original)
>> +++ llvm/trunk/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h Wed May 16 13:50:11 2012
>> @@ -34,12 +34,12 @@
>> 
>>   uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,
>>                                unsigned SectionID) {
>> -    return JMM->allocateSpace(Size, Alignment);
>> +    return JMM->allocateDataSection(Size, Alignment, SectionID);
>>   }
>> 
>>   uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
>>                                unsigned SectionID) {
>> -    return JMM->allocateSpace(Size, Alignment);
>> +    return JMM->allocateCodeSection(Size, Alignment, SectionID);
>>   }
>> 
>>   virtual void *getPointerToNamedFunction(const std::string &Name,
>> 
>> Modified: llvm/trunk/tools/lli/lli.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lli/lli.cpp?rev=156933&r1=156932&r2=156933&view=diff
>> ==============================================================================
>> --- llvm/trunk/tools/lli/lli.cpp (original)
>> +++ llvm/trunk/tools/lli/lli.cpp Wed May 16 13:50:11 2012
>> @@ -35,8 +35,20 @@
>>  #include "llvm/Support/Process.h"
>>  #include "llvm/Support/Signals.h"
>>  #include "llvm/Support/TargetSelect.h"
>> +#include "llvm/Support/DynamicLibrary.h"
>> +#include "llvm/Support/Memory.h"
>>  #include <cerrno>
>> 
>> +#ifdef __linux__
>> +// These includes used by LLIMCJITMemoryManager::getPointerToNamedFunction()
>> +// for Glibc trickery. Look comments in this function for more information.
>> +#ifdef HAVE_SYS_STAT_H
>> +#include <sys/stat.h>
>> +#endif
>> +#include <fcntl.h>
>> +#include <unistd.h>
>> +#endif
>> +
>>  #ifdef __CYGWIN__
>>  #include <cygwin/version.h>
>>  #if defined(CYGWIN_VERSION_DLL_MAJOR) && CYGWIN_VERSION_DLL_MAJOR<1007
>> @@ -175,6 +187,191 @@
>>  #endif
>>  }
>> 
>> +// Memory manager for MCJIT
>> +class LLIMCJITMemoryManager : public JITMemoryManager {
> 
> Is there some reason this can't be included in some library?  Granted,
> it isn't always what the user would want, but it seems useful enough
> if you don't need more complex memory management.
> 
> -Eli
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list