mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 17:32:19 +00:00
Minor speedup by avoiding callbacks to functions already generated
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6052 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c309a7627c
commit
eb5a93b86b
@ -46,7 +46,6 @@ void VM::CompilationCallback() {
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void VM::registerCallback() {
|
||||
TheVM = this;
|
||||
}
|
||||
|
@ -131,11 +131,15 @@ 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));
|
||||
// Try looking up the function to see if it is already compiled!
|
||||
if (void *Addr = TheVM.getPointerToGlobalIfAvailable(V)) {
|
||||
emitAddress(Addr, isPCRelative);
|
||||
} else { // Function has not yet been code generated!
|
||||
TheVM.addFunctionRef(CurByte, cast<Function>(V));
|
||||
|
||||
// Delayed resolution...
|
||||
emitAddress((void*)VM::CompilationCallback, isPCRelative);
|
||||
// Delayed resolution...
|
||||
emitAddress((void*)VM::CompilationCallback, isPCRelative);
|
||||
}
|
||||
} else {
|
||||
emitAddress(TheVM.getPointerToGlobal(V), isPCRelative);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user