Improve efficiency of JIT by having it use direct function calls instead of
signals to regain control from the executing code
llvm-svn: 6051
diff --git a/llvm/lib/ExecutionEngine/JIT/Emitter.cpp b/llvm/lib/ExecutionEngine/JIT/Emitter.cpp
index 1c89bdb..d6f75c0 100644
--- a/llvm/lib/ExecutionEngine/JIT/Emitter.cpp
+++ b/llvm/lib/ExecutionEngine/JIT/Emitter.cpp
@@ -131,8 +131,11 @@
void Emitter::emitGlobalAddress(GlobalValue *V, bool isPCRelative) {
if (isPCRelative) { // must be a call, this is a major hack!
+ // FIXME: Try looking up the function to see if it is already compiled!
TheVM.addFunctionRef(CurByte, cast<Function>(V));
- emitAddress(0, isPCRelative); // Delayed resolution...
+
+ // Delayed resolution...
+ emitAddress((void*)VM::CompilationCallback, isPCRelative);
} else {
emitAddress(TheVM.getPointerToGlobal(V), isPCRelative);
}