summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/MCJIT
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2011-04-06 01:11:05 +0000
committerJim Grosbach <grosbach@apple.com>2011-04-06 01:11:05 +0000
commitc41ab789a052d7a8a4eacecfa1edd4af0d933990 (patch)
tree86b3c9b4438faa431f612324ecbfa189da4d612f /lib/ExecutionEngine/MCJIT
parent2009c49a0b3fdd70e1c40e0297a4f9140759e318 (diff)
downloadllvm-c41ab789a052d7a8a4eacecfa1edd4af0d933990.tar.gz
llvm-c41ab789a052d7a8a4eacecfa1edd4af0d933990.tar.bz2
llvm-c41ab789a052d7a8a4eacecfa1edd4af0d933990.tar.xz
RuntimeDyld should use the memory manager API.
Start teaching the runtime Dyld interface to use the memory manager API for allocating space. Rather than mapping directly into the MachO object, we extract the payload for each object and copy it into a dedicated buffer allocated via the memory manager. For now, just do Segment64, so this works on x86_64, but not yet on ARM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128973 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/MCJIT')
-rw-r--r--lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h b/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
index b525165016..0108ecca84 100644
--- a/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
+++ b/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
@@ -31,23 +31,19 @@ public:
// Allocate ActualSize bytes, or more, for the named function. Return
// a pointer to the allocated memory and update Size to reflect how much
// memory was acutally allocated.
- uint64_t startFunctionBody(const char *Name, uintptr_t &Size) {
+ uint8_t *startFunctionBody(const char *Name, uintptr_t &Size) {
Function *F = M->getFunction(Name);
assert(F && "No matching function in JIT IR Module!");
- return (uint64_t)JMM->startFunctionBody(F, Size);
+ return JMM->startFunctionBody(F, Size);
}
// Mark the end of the function, including how much of the allocated
// memory was actually used.
- void endFunctionBody(const char *Name, uint64_t FunctionStart,
- uint64_t FunctionEnd) {
+ void endFunctionBody(const char *Name, uint8_t *FunctionStart,
+ uint8_t *FunctionEnd) {
Function *F = M->getFunction(Name);
assert(F && "No matching function in JIT IR Module!");
- // The JITMemoryManager interface makes the unfortunate assumption that
- // the address space/sizes we're compiling on are the same as what we're
- // compiling for, so it uses pointer types for its addresses. Explicit
- // casts between them to deal with that.
- JMM->endFunctionBody(F, (uint8_t*)FunctionStart, (uint8_t*)FunctionEnd);
+ JMM->endFunctionBody(F, FunctionStart, FunctionEnd);
}
};