mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-30 02:25:19 +00:00
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
This commit is contained in:
@@ -301,7 +301,6 @@ void JIT::runJITOnFunction(Function *F) {
|
|||||||
/// specified function, compiling it if neccesary.
|
/// specified function, compiling it if neccesary.
|
||||||
///
|
///
|
||||||
void *JIT::getPointerToFunction(Function *F) {
|
void *JIT::getPointerToFunction(Function *F) {
|
||||||
MutexGuard locked(lock);
|
|
||||||
|
|
||||||
if (void *Addr = getPointerToGlobalIfAvailable(F))
|
if (void *Addr = getPointerToGlobalIfAvailable(F))
|
||||||
return Addr; // Check if function already code gen'd
|
return Addr; // Check if function already code gen'd
|
||||||
@@ -326,7 +325,13 @@ void *JIT::getPointerToFunction(Function *F) {
|
|||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (void *Addr = getPointerToGlobalIfAvailable(F)) {
|
||||||
|
return Addr;
|
||||||
|
}
|
||||||
|
|
||||||
|
MutexGuard locked(lock);
|
||||||
|
|
||||||
if (F->isDeclaration()) {
|
if (F->isDeclaration()) {
|
||||||
void *Addr = getPointerToNamedFunction(F->getName());
|
void *Addr = getPointerToNamedFunction(F->getName());
|
||||||
addGlobalMapping(F, Addr);
|
addGlobalMapping(F, Addr);
|
||||||
|
Reference in New Issue
Block a user