This implements exception_check() as introduced by commit 14b43a09c93.

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

diff --git a/arch/x86/unwind_64.S b/arch/x86/unwind_64.S
index b89ba0f..322e0fd 100644
--- a/arch/x86/unwind_64.S
+++ b/arch/x86/unwind_64.S
@@ -1,4 +1,5 @@
 .global unwind
+.global exception_check
 .text
 
 /*
@@ -37,3 +38,28 @@ unwind:
 
        pushq %rax
        ret
+
+/*
+ * exception_check - is a part of valgrind workaround for exception guards.
+ * it checks whether exception has occurred and if it has control
+ * is transfered directly to exception handler (possibly unwind block).
+ */
+exception_check:
+       /* push return address - 1 */
+       push    (%rsp)
+       decq    (%rsp)
+
+       movq    (%rsp), %rdi    # return address - 1
+       call    jit_lookup_cu
+
+       movq    %rax, %rdi      # cu
+       movq    %rbp, %rsi      # stack frame
+       pop     %rdx            # return address - 1
+       call    throw_from_jit_checked
+
+       test    %rax, %rax
+       jz      1f
+       push    %rax
+       ret
+1:
+       ret
-- 
1.6.0.6


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to