mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 19:31:58 +00:00
Split the locking out of JIT::runJITOnFunction so that callers
that already hold the lock can call an entry point that doesn't re-acquire the lock. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63965 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e98fc32b0d
commit
21afcda544
@ -475,9 +475,12 @@ GenericValue JIT::runFunction(Function *F,
|
||||
/// GlobalAddress[F] with the address of F's machine code.
|
||||
///
|
||||
void JIT::runJITOnFunction(Function *F) {
|
||||
static bool isAlreadyCodeGenerating = false;
|
||||
|
||||
MutexGuard locked(lock);
|
||||
runJITOnFunctionUnlocked(F, locked);
|
||||
}
|
||||
|
||||
void JIT::runJITOnFunctionUnlocked(Function *F, const MutexGuard &locked) {
|
||||
static bool isAlreadyCodeGenerating = false;
|
||||
assert(!isAlreadyCodeGenerating && "Error: Recursive compilation detected!");
|
||||
|
||||
// JIT the function
|
||||
@ -537,7 +540,7 @@ void *JIT::getPointerToFunction(Function *F) {
|
||||
return Addr;
|
||||
}
|
||||
|
||||
runJITOnFunction(F);
|
||||
runJITOnFunctionUnlocked(F, locked);
|
||||
|
||||
void *Addr = getPointerToGlobalIfAvailable(F);
|
||||
assert(Addr && "Code generation didn't add function to GlobalAddress table!");
|
||||
|
@ -147,8 +147,9 @@ public:
|
||||
|
||||
private:
|
||||
static MachineCodeEmitter *createEmitter(JIT &J, JITMemoryManager *JMM);
|
||||
void runJITOnFunction (Function *F);
|
||||
|
||||
void runJITOnFunction(Function *F);
|
||||
void runJITOnFunctionUnlocked(Function *F, const MutexGuard &locked);
|
||||
|
||||
protected:
|
||||
|
||||
/// getMemoryforGV - Allocate memory for a global variable.
|
||||
|
Loading…
Reference in New Issue
Block a user