* src/vm/exceptions.c (exceptions_handle_exception): Check for special
authortwisti <none@none>
Thu, 30 Mar 2006 09:52:49 +0000 (09:52 +0000)
committertwisti <none@none>
Thu, 30 Mar 2006 09:52:49 +0000 (09:52 +0000)
* start/endpc-NULL case. This makes asmpart stuff much easier, like on
* Darwin or IRIX.

* src/vm/jit/asmpart.h (asm_vm_call_method_exception_handler): Added.

* src/vm/jit/alpha/asmpart.S (asm_vm_call_method_exception_handler): Export it.
(asm_vm_call_method): Don't put label addresses into the
"data-segment", as it's located in the .text area and that may be
read-only.
* src/vm/jit/i386/asmpart.S: Likewise.
* src/vm/jit/mips/asmpart.S: Likewise.
* src/vm/jit/x86_64/asmpart.S: Likewise.

src/vm/exceptions.c
src/vm/jit/alpha/asmpart.S
src/vm/jit/asmpart.h
src/vm/jit/i386/asmpart.S
src/vm/jit/mips/asmpart.S
src/vm/jit/x86_64/asmpart.S

index a813cc6ced14ad5aac1b5e1527376c536c1aed25..642a9c7e8f658b05bf7283cd1da2fbab1c46a5c1 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes: Edwin Steiner
 
-   $Id: exceptions.c 4690 2006-03-27 11:37:46Z twisti $
+   $Id: exceptions.c 4707 2006-03-30 09:52:49Z twisti $
 
 */
 
@@ -1231,6 +1231,11 @@ u1 *exceptions_handle_exception(java_objectheader *xptr, u1 *xpc, u1 *pv, u1 *sp
 
                ex--;
 
+               /* If the start and end PC is NULL, this means we have the special case of asm_vm_call_method.  So, just return the proper exception handler. */
+
+               if ((ex->startpc == NULL) && (ex->endpc == NULL))
+                       return (u1 *) &asm_vm_call_method_exception_handler;
+
                /* is the xpc is the current catch range */
 
                if ((ex->startpc <= xpc) && (xpc < ex->endpc)) {
index f6f6ebfb49cce951a3546acb7de7e48114d0abca..737361e5e21e30fa0b1e8535c56f698b2d828a90 100644 (file)
@@ -31,7 +31,7 @@
             Christian Thalinger
                Edwin Steiner
 
-   $Id: asmpart.S 4666 2006-03-21 07:57:11Z edwin $
+   $Id: asmpart.S 4707 2006-03-30 09:52:49Z twisti $
 
 */
 
@@ -58,6 +58,7 @@
        .globl asm_vm_call_method_long
        .globl asm_vm_call_method_float
        .globl asm_vm_call_method_double
+       .globl asm_vm_call_method_exception_handler
 
        .globl asm_call_jit_compiler
        .globl asm_handle_exception
@@ -97,9 +98,9 @@
        .align  3
 
        .quad   0                           /* catch type all                     */
-       .quad   calljava_xhandler2          /* handler pc                         */
-       .quad   calljava_xhandler2          /* end pc                             */
-       .quad   asm_vm_call_method          /* start pc                           */
+       .quad   0                           /* handler pc                         */
+       .quad   0                           /* end pc                             */
+       .quad   0                           /* start pc                           */
        .long   1                           /* extable size                       */
        .long   0                           /* ALIGNMENT PADDING                  */
        .quad   0                           /* line number table start            */
@@ -194,11 +195,13 @@ calljava_return2:
 calljava_ret2:
        jmp     zero,(ra)
 
-calljava_xhandler2:
+asm_vm_call_method_exception_handler:
        s8addq  s6,sp,sp
        ldq     gp,1*8(sp)                /* restore global pointer               */
+#if !defined(NDEBUG)
        mov     itmp1,a0
        jsr     ra,builtin_throw_exception
+#endif
        ldq     ra,0*8(sp)                /* restore return address               */
        ldq     s6,3*8(sp)
        lda     sp,5*8(sp)                /* free stack space                     */
index a60198b6a7d19891e8687e9b329df181905df718..5788cda17297efe355e5c98b8abcb2bce1bda85f 100644 (file)
@@ -30,7 +30,7 @@
    Changes: Christian Thalinger
             Edwin Steiner
 
-   $Id: asmpart.h 4631 2006-03-16 14:19:52Z twisti $
+   $Id: asmpart.h 4707 2006-03-30 09:52:49Z twisti $
 
 */
 
@@ -54,8 +54,8 @@
 #include "vm/linker.h"
 #include "vm/resolve.h"
 #include "vm/vm.h"
-#include "vm/jit/stacktrace.h"
 #include "vm/jit/replace.h"
+#include "vm/jit/stacktrace.h"
 
 
 /* some macros ****************************************************************/
@@ -116,6 +116,8 @@ s4     asm_vm_call_method_int(methodinfo *m, s4 vmargscount, vm_arg *vmargs);
 s8     asm_vm_call_method_long(methodinfo *m, s4 vmargscount, vm_arg *vmargs);
 float  asm_vm_call_method_float(methodinfo *m, s4 vmargscount, vm_arg *vmargs);
 double asm_vm_call_method_double(methodinfo *m, s4 vmargscount, vm_arg *vmargs);
+
+void   asm_vm_call_method_exception_handler(void);
 #endif
 
 #if defined(ENABLE_INTRP)
index ae1f15cc47829e57dadd38d207ba5c79c52dbdad..1a9435c7b14414362d4ad6aa77a6006d75a3f3af 100644 (file)
@@ -31,7 +31,7 @@
    Changes: Joseph Wenninger
             Edwin Steiner
 
-   $Id: asmpart.S 4677 2006-03-22 20:59:49Z edwin $
+   $Id: asmpart.S 4707 2006-03-30 09:52:49Z twisti $
 
 */
 
@@ -50,7 +50,7 @@
        .text
 
 
-/* exported functions and variables *******************************************/
+/* export functions ***********************************************************/
 
        .globl asm_md_init
 
@@ -59,6 +59,7 @@
        .globl asm_vm_call_method_long
        .globl asm_vm_call_method_float
        .globl asm_vm_call_method_double
+       .globl asm_vm_call_method_exception_handler
 
        .globl asm_call_jit_compiler
        .globl asm_handle_nat_exception
@@ -125,9 +126,9 @@ asm_md_init:
        .align  8
 
        .long   0                           /* catch type all                     */
-       .long   calljava_xhandler2          /* handler pc                         */
-       .long   calljava_xhandler2          /* end pc                             */
-       .long   L_asm_vm_call_method        /* start pc                           */
+       .long   0                           /* handler pc                         */
+       .long   0                           /* end pc                             */
+       .long   0                           /* start pc                           */
        .long   1                           /* extable size                       */
        .long   0                           /* line number table start            */
        .long   0                           /* line number table size             */
@@ -143,7 +144,6 @@ asm_vm_call_method_int:
 asm_vm_call_method_long:
 asm_vm_call_method_float:
 asm_vm_call_method_double:
-L_asm_vm_call_method:                   /* required for PIC code              */
        push    bp
        mov     sp,bp                       /* save stackptr                      */
        sub     $(4*4),sp                   /* create stackframe                  */
@@ -221,10 +221,12 @@ L_asm_vm_call_method_return:
        leave
        ret
 
-calljava_xhandler2:
+asm_vm_call_method_exception_handler:
+#if !defined(NDEBUG)
        push    xptr                        /* pass exception pointer             */
        call    builtin_throw_exception
        add     $4,sp
+#endif
        xor     v0,v0                       /* return NULL                        */
        jmp     L_asm_vm_call_method_return
 
index 5f2cbc5371577a7a7dc991756a7aaf32e9af1c8f..b651154223b5d04504a878abe71c5ed3aabe69a1 100644 (file)
@@ -27,9 +27,9 @@
    Authors: Andreas Krall
 
    Changes: Christian Thalinger
-                       Edwin Steiner
+            Edwin Steiner
 
-   $Id: asmpart.S 4706 2006-03-30 09:20:42Z twisti $
+   $Id: asmpart.S 4707 2006-03-30 09:52:49Z twisti $
 
 */
 
@@ -55,6 +55,7 @@
        .globl asm_vm_call_method_long
        .globl asm_vm_call_method_float
        .globl asm_vm_call_method_double
+       .globl asm_vm_call_method_exception_handler
 
        .globl asm_call_jit_compiler
        .globl asm_handle_exception
@@ -98,9 +99,9 @@
        .align  3
 
        .dword  0                           /* catch type all                     */
-       .dword  calljava_xhandler2          /* handler pc                         */
-       .dword  calljava_xhandler2          /* end pc                             */
-       .dword  asm_vm_call_method          /* start pc                           */
+       .dword  0                           /* handler pc                         */
+       .dword  0                           /* end pc                             */
+       .dword  0                           /* start pc                           */
        .word   1                           /* extable size                       */
        .word   0                           /* 4-byte ALIGNMENT PADDING           */
        .dword  0                           /* line number table start            */
@@ -238,11 +239,13 @@ calljava_return2:
        aaddiu  sp,sp,12*8                /* free stack space                     */
        j       ra                        /* return                               */
 
-calljava_xhandler2:
+asm_vm_call_method_exception_handler:
        asll    s7,s7,3
        aaddu   sp,s7,sp
+#if !defined(NDEBUG)
        move    a0,itmp1                  
        jal     builtin_throw_exception
+#endif
        move    v0,zero                   /* clear return value for exception     */
        b       calljava_return2
 
index 3dae627c9fb2b501f01a932d307209b3194821e4..cab716c0cee9d53980bceac8f0847ecd03629d56 100644 (file)
@@ -30,7 +30,7 @@
 
    Changes: Edwin Steiner
 
-   $Id: asmpart.S 4690 2006-03-27 11:37:46Z twisti $
+   $Id: asmpart.S 4707 2006-03-30 09:52:49Z twisti $
 
 */
 
        .text
 
 
-/* exported functions and variables *******************************************/
+/* export functions ***********************************************************/
 
        .globl asm_vm_call_method
        .globl asm_vm_call_method_int
        .globl asm_vm_call_method_long
        .globl asm_vm_call_method_float
        .globl asm_vm_call_method_double
+       .globl asm_vm_call_method_exception_handler
 
        .globl asm_call_jit_compiler
        .globl asm_handle_exception
@@ -96,9 +97,9 @@
        .align  8
 
        .quad   0                           /* catch type all                     */
-       .quad   calljava_xhandler2          /* handler pc                         */
-       .quad   calljava_xhandler2          /* end pc                             */
-       .quad   L_asm_vm_call_method        /* start pc                           */
+       .quad   0                           /* handler pc                         */
+       .quad   0                           /* end pc                             */
+       .quad   0                           /* start pc                           */
        .long   1                           /* extable size                       */
        .long   0                                                                                                                        
        .quad   0                           /* line number table  start           */
        .long   0                           /* intsave                            */
        .long   0                           /* isleaf                             */
        .long   0                           /* IsSync                             */
-       .long   24                          /* frame size                         */
+       .long                             /* frame size                         */
        .quad   0                           /* method pointer (pointer to name)   */
 
 asm_vm_call_method:
@@ -116,7 +117,6 @@ asm_vm_call_method_int:
 asm_vm_call_method_long:
 asm_vm_call_method_float:
 asm_vm_call_method_double:
-L_asm_vm_call_method:                   /* required for PIC code              */
        sub     $(7*8),sp                   /* keep stack 16-byte aligned         */
        mov     %rbx,0*8(sp)                /* %rbx is not a callee saved in cacao*/
        mov     s0,1*8(sp)
@@ -218,7 +218,7 @@ L_asm_vm_call_method_return:
        add     $(7*8),sp                   /* free stack space                   */
        ret
                
-calljava_xhandler2:
+asm_vm_call_method_exception_handler:
 #if !defined(NDEBUG)
        mov     xptr,a0                     /* pass exception pointer             */
        call    builtin_throw_exception@PLT