Improve efficiency of JIT by having it use direct function calls instead of
[oota-llvm.git] / lib / ExecutionEngine / JIT / JITEmitter.cpp
index 1c89bdba26bc781d5fff55fab4bd4eddf0296b06..d6f75c08f7643a7275077dd922e6da7a2129302b 100644 (file)
@@ -131,8 +131,11 @@ void Emitter::emitAddress(void *Addr, bool isPCRelative) {
 
 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);
   }