summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit23de2437bd2d7cb6cc60bf6b6e94c807bba634d2 (patch)
treeba886c89676d26fe0bdceab10c9a5e76a90a0b71 /llvm/lib/ExecutionEngine/MCJIT
parent14a3333cb356d0afc69c352c22ff4d8ee1096de3 (diff)
downloadbcm5719-llvm-23de2437bd2d7cb6cc60bf6b6e94c807bba634d2.tar.gz
bcm5719-llvm-23de2437bd2d7cb6cc60bf6b6e94c807bba634d2.zip
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. llvm-svn: 128973
Diffstat (limited to 'llvm/lib/ExecutionEngine/MCJIT')
-rw-r--r--llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h b/llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
index b5251650169..0108ecca84f 100644
--- a/llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
+++ b/llvm/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);
}
};
OpenPOWER on IntegriCloud