/// 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
return Addr;
}
- runJITOnFunction(F);
+ runJITOnFunctionUnlocked(F, locked);
void *Addr = getPointerToGlobalIfAvailable(F);
assert(Addr && "Code generation didn't add function to GlobalAddress table!");
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.