diff options
| author | Jeffrey Yasskin <jyasskin@google.com> | 2009-11-23 22:49:00 +0000 |
|---|---|---|
| committer | Jeffrey Yasskin <jyasskin@google.com> | 2009-11-23 22:49:00 +0000 |
| commit | 89acd2fc3e3c28cedeb8f5b5d5d378425b6d2f49 (patch) | |
| tree | 04b08bde023562acfc4bf23d227fbfa6fe2e2b5e /lib/Target/PowerPC/PPCJITInfo.cpp | |
| parent | 09c61b35e2c8a6cf9bcdf42f8d07a8ac26238eac (diff) | |
| download | external_llvm-89acd2fc3e3c28cedeb8f5b5d5d378425b6d2f49.zip external_llvm-89acd2fc3e3c28cedeb8f5b5d5d378425b6d2f49.tar.gz external_llvm-89acd2fc3e3c28cedeb8f5b5d5d378425b6d2f49.tar.bz2 | |
Allow more than one stub to be being generated at the same time.
It's probably better in the long run to replace the
indirect-GlobalVariable system. That'll be done after a subsequent
patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89708 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCJITInfo.cpp')
| -rw-r--r-- | lib/Target/PowerPC/PPCJITInfo.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Target/PowerPC/PPCJITInfo.cpp b/lib/Target/PowerPC/PPCJITInfo.cpp index ef25d92..ddbb326 100644 --- a/lib/Target/PowerPC/PPCJITInfo.cpp +++ b/lib/Target/PowerPC/PPCJITInfo.cpp @@ -330,11 +330,12 @@ extern "C" void sys_icache_invalidate(const void *Addr, size_t len); void *PPCJITInfo::emitFunctionStub(const Function* F, void *Fn, JITCodeEmitter &JCE) { + MachineCodeEmitter::BufferState BS; // If this is just a call to an external function, emit a branch instead of a // call. The code is the same except for one bit of the last instruction. if (Fn != (void*)(intptr_t)PPC32CompilationCallback && Fn != (void*)(intptr_t)PPC64CompilationCallback) { - JCE.startGVStub(F, 7*4); + JCE.startGVStub(BS, F, 7*4); intptr_t Addr = (intptr_t)JCE.getCurrentPCValue(); JCE.emitWordBE(0); JCE.emitWordBE(0); @@ -345,10 +346,10 @@ void *PPCJITInfo::emitFunctionStub(const Function* F, void *Fn, JCE.emitWordBE(0); EmitBranchToAt(Addr, (intptr_t)Fn, false, is64Bit); sys::Memory::InvalidateInstructionCache((void*)Addr, 7*4); - return JCE.finishGVStub(F); + return JCE.finishGVStub(BS); } - JCE.startGVStub(F, 10*4); + JCE.startGVStub(BS, F, 10*4); intptr_t Addr = (intptr_t)JCE.getCurrentPCValue(); if (is64Bit) { JCE.emitWordBE(0xf821ffb1); // stdu r1,-80(r1) @@ -373,7 +374,7 @@ void *PPCJITInfo::emitFunctionStub(const Function* F, void *Fn, JCE.emitWordBE(0); EmitBranchToAt(BranchAddr, (intptr_t)Fn, true, is64Bit); sys::Memory::InvalidateInstructionCache((void*)Addr, 10*4); - return JCE.finishGVStub(F); + return JCE.finishGVStub(BS); } |
