diff options
author | Nicolas Geoffray <nicolas.geoffray@lip6.fr> | 2008-04-20 08:33:02 +0000 |
---|---|---|
committer | Nicolas Geoffray <nicolas.geoffray@lip6.fr> | 2008-04-20 08:33:02 +0000 |
commit | 8ae32357b32fef5c1484fb85473bc3ad809f0b2e (patch) | |
tree | 89922206fa64730d82a23d21000ab29430a8d9d9 | |
parent | 70cd9a1dfa2ef39f84fadc075d73cbd255f01cb1 (diff) | |
download | external_llvm-8ae32357b32fef5c1484fb85473bc3ad809f0b2e.zip external_llvm-8ae32357b32fef5c1484fb85473bc3ad809f0b2e.tar.gz external_llvm-8ae32357b32fef5c1484fb85473bc3ad809f0b2e.tar.bz2 |
Do not hold the JIT lock when materializing a function and verify if the
function has already been codegen'd. This is required by the Java class loading
mechanism which executes Java code when materializing a function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49988 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/ExecutionEngine/JIT/JIT.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp index 281869a..9e89e3c 100644 --- a/lib/ExecutionEngine/JIT/JIT.cpp +++ b/lib/ExecutionEngine/JIT/JIT.cpp @@ -301,7 +301,6 @@ void JIT::runJITOnFunction(Function *F) { /// specified function, compiling it if neccesary. /// void *JIT::getPointerToFunction(Function *F) { - MutexGuard locked(lock); if (void *Addr = getPointerToGlobalIfAvailable(F)) return Addr; // Check if function already code gen'd @@ -326,7 +325,13 @@ void *JIT::getPointerToFunction(Function *F) { abort(); } } + + if (void *Addr = getPointerToGlobalIfAvailable(F)) { + return Addr; + } + MutexGuard locked(lock); + if (F->isDeclaration()) { void *Addr = getPointerToNamedFunction(F->getName()); addGlobalMapping(F, Addr); |