[llvm-commits] [llvm] r48701 - /llvm/trunk/lib/Target/X86/X86JITInfo.cpp
Anton Korobeynikov
asl at math.spbu.ru
Sun Mar 23 05:33:00 PDT 2008
Author: asl
Date: Sun Mar 23 07:32:54 2008
New Revision: 48701
URL: http://llvm.org/viewvc/llvm-project?rev=48701&view=rev
Log:
Remove old-standing obsolete code.
Modified:
llvm/trunk/lib/Target/X86/X86JITInfo.cpp
Modified: llvm/trunk/lib/Target/X86/X86JITInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86JITInfo.cpp?rev=48701&r1=48700&r2=48701&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86JITInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86JITInfo.cpp Sun Mar 23 07:32:54 2008
@@ -260,20 +260,30 @@
CFI(".cfi_endproc\n")
);
#else
- void X86CompilationCallback2(void);
+ void X86CompilationCallback2(intptr_t *StackPtr, intptr_t RetAddr);
_declspec(naked) void X86CompilationCallback(void) {
__asm {
+ push ebp
+ mov ebp, esp
push eax
push edx
push ecx
+ and esp, -16
+ mov eax, dword ptr [ebp+4]
+ mov dword ptr [esp+4], eax
+ mov dword ptr [esp], ebp
call X86CompilationCallback2
+ mov esp, ebp
+ sub esp, 12
pop ecx
pop edx
pop eax
+ pop ebp
ret
}
}
+
#endif // _MSC_VER
#else // Not an i386 host
@@ -288,16 +298,8 @@
/// function stub when we did not know the real target of a call. This function
/// must locate the start of the stub or call site and pass it into the JIT
/// compiler function.
-#ifdef _MSC_VER
-extern "C" void X86CompilationCallback2() {
- assert(sizeof(size_t) == 4); // FIXME: handle Win64
- intptr_t *RetAddrLoc = (intptr_t *)_AddressOfReturnAddress();
- RetAddrLoc += 4; // skip over ret addr, edx, eax, ecx
- intptr_t RetAddr = *RetAddrLoc;
-#else
extern "C" void X86CompilationCallback2(intptr_t *StackPtr, intptr_t RetAddr) {
intptr_t *RetAddrLoc = &StackPtr[1];
-#endif
assert(*RetAddrLoc == RetAddr &&
"Could not find return address on the stack!");
More information about the llvm-commits
mailing list