This implements unwind() properly on x86-64.

Signed-off-by: Eduard - Gabriel Munteanu <eduard.munte...@linux360.ro>
---
 arch/x86/unwind_64.S |   24 +++++++++++-------------
 1 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/arch/x86/unwind_64.S b/arch/x86/unwind_64.S
index 0f120c6..b89ba0f 100644
--- a/arch/x86/unwind_64.S
+++ b/arch/x86/unwind_64.S
@@ -8,34 +8,32 @@
  *          2) Rethrows the exception in caller's context
  */
 unwind:
-       popq    %rdx    # return address of the method
-       decq    %rdx
-
        /*
         * Lookup pointer to compilation unit.
         */
-       push    %rdx
+       movq    (%rsp), %rdi    # return address of the method
+       decq    %rdi
        call    jit_lookup_cu
-       movq    %rax, %rcx
-       pop     %rdx
 
        /*
         * Restore stack pointer. We need to restore space for locals too.
         */
-       push    %rdx
-       push    %rcx
+       push    %rax            # save cu
+
+       movq    %rax, %rdi
+       movq    0x08(%rsp), %rsi
        call    cu_frame_locals_offset
-       pop     %rcx
+
+       pop     %rdi
        pop     %rdx
 
        movq    %rbp, %rsp
        subq    %rax, %rsp
 
-       pushq   %rdx    # native ptr
-       pushq   %rbp    # frame
-       pushq   %rcx    # cu
+       /* cu is already in %rdi */
+       movq    %rbp, %rsi
+       /* native ptr is already in %rdx */
        call    throw_from_jit
-       addq    $24, %rsp
 
        pushq %rax
        ret
-- 
1.6.0.6


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to