diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2007-12-10 14:54:42 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2007-12-10 14:54:42 +0000 |
commit | 81e9dc4af7d15e0a109fe00eff2cd82372c61773 (patch) | |
tree | 415ad4df1f4c6399dc6cdffd61a052c62304164e /llvm/lib | |
parent | 81b25817f9dbcc408595aa022833ae624221484d (diff) | |
download | bcm5719-llvm-81e9dc4af7d15e0a109fe00eff2cd82372c61773.tar.gz bcm5719-llvm-81e9dc4af7d15e0a109fe00eff2cd82372c61773.zip |
Annotate JIT callback function with call frame infromation.
This will allow us (theoretically) to unwind through JITer.
The code wasn't verified, so I'm pretty sure offsets are wrong :)
llvm-svn: 44792
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/X86/X86JITInfo.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86JITInfo.cpp b/llvm/lib/Target/X86/X86JITInfo.cpp index b9e5d5ba88e..f750b560706 100644 --- a/llvm/lib/Target/X86/X86JITInfo.cpp +++ b/llvm/lib/Target/X86/X86JITInfo.cpp @@ -116,11 +116,18 @@ extern "C" { ".align 8\n" ".globl " ASMPREFIX "X86CompilationCallback\n" ASMPREFIX "X86CompilationCallback:\n" + ".cfi_startproc\n" "pushl %ebp\n" + ".cfi_def_cfa_offset 8\n" + ".cfi_offset ebp, -8\n" "movl %esp, %ebp\n" // Standard prologue + ".cfi_def_cfa_register ebp\n" "pushl %eax\n" + ".cfi_rel_offset eax, 0\n" "pushl %edx\n" // Save EAX/EDX/ECX + ".cfi_rel_offset edx, 4\n" "pushl %ecx\n" + ".cfi_rel_offset ecx, 8\n" #if defined(__APPLE__) "andl $-16, %esp\n" // Align ESP on 16-byte boundary #endif @@ -130,12 +137,23 @@ extern "C" { "movl %ebp, (%esp)\n" "call " ASMPREFIX "X86CompilationCallback2\n" "movl %ebp, %esp\n" // Restore ESP + ".cfi_def_cfa_register esp\n" "subl $12, %esp\n" + ".cfi_adjust_cfa_offset 12\n" "popl %ecx\n" + ".cfi_adjust_cfa_offset -4\n" + ".cfi_restore ecx\n" "popl %edx\n" + ".cfi_adjust_cfa_offset -4\n" + ".cfi_restore edx\n" "popl %eax\n" + ".cfi_adjust_cfa_offset -4\n" + ".cfi_restore eax\n" "popl %ebp\n" - "ret\n"); + ".cfi_adjust_cfa_offset -4\n" + ".cfi_restore ebp\n" + "ret\n" + ".cfi_endproc\n"); // Same as X86CompilationCallback but also saves XMM argument registers. void X86CompilationCallback_SSE(void); |