* src/vm/builtin.c (builtin_throw_exception): Changed return type and
authortwisti <none@none>
Tue, 11 Apr 2006 10:20:18 +0000 (10:20 +0000)
committertwisti <none@none>
Tue, 11 Apr 2006 10:20:18 +0000 (10:20 +0000)
return NULL. This is less error-prone in asm_vm_call_method.
* src/vm/builtin.h: Likewise.

* src/vm/jit/alpha/asmpart.S (asm_vm_call_method_exception_handler):
Don't set v0 to NULL. This is now done in builtin_throw_exception.
* src/vm/jit/i386/asmpart.S: Likewise.
* src/vm/jit/mips/asmpart.S: Likewise.
* src/vm/jit/powerpc/asmpart.S: Likewise.
* src/vm/jit/x86_64/asmpart.S: Likewise.

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

index 0fd75d68ec9fa48d35dd2a6053a16de570215dec..8f946ed7e695b16ee71db9f6c27a755408783486 100644 (file)
@@ -37,7 +37,7 @@
    calls instead of machine instructions, using the C calling
    convention.
 
-   $Id: builtin.c 4732 2006-04-04 21:31:52Z edwin $
+   $Id: builtin.c 4749 2006-04-11 10:20:18Z twisti $
 
 */
 
@@ -500,11 +500,14 @@ s4 builtin_arrayinstanceof(java_objectheader *o, classinfo *targetclass)
 }
 
 
-/************************** exception functions *******************************
+/* builtin_throw_exception *****************************************************
 
-******************************************************************************/
+   Sets the exceptionptr with the thrown exception and prints some
+   debugging information.  Called from asm_vm_call_method.
+
+*******************************************************************************/
 
-java_objectheader *builtin_throw_exception(java_objectheader *xptr)
+void *builtin_throw_exception(java_objectheader *xptr)
 {
 #if !defined(NDEBUG)
     java_lang_Throwable *t;
@@ -561,9 +564,14 @@ java_objectheader *builtin_throw_exception(java_objectheader *xptr)
        }
 #endif /* !defined(NDEBUG) */
 
+       /* actually set the exception */
+
        *exceptionptr = xptr;
 
-       return xptr;
+       /* Return a NULL pointer.  This is required for vm_call_method to
+          check for an exception.  This is for convenience. */
+
+       return NULL;
 }
 
 
index 32c0bc834d7e68dda0f4c99aa67c10bdbb4ec414..b4f57694c9f07463c991a73856eac5a045bdc0a5 100644 (file)
@@ -29,7 +29,7 @@
    Changes: Edwin Steiner
             Christian Thalinger
 
-   $Id: builtin.h 4357 2006-01-22 23:33:38Z twisti $
+   $Id: builtin.h 4749 2006-04-11 10:20:18Z twisti $
 
 */
 
@@ -133,7 +133,7 @@ s4 builtin_arrayinstanceof(java_objectheader *o, classinfo *targetclass);
 s4 builtin_arraycheckcast(java_objectheader *o, classinfo *targetclass);
 #define BUILTIN_arraycheckcast (functionptr) builtin_arraycheckcast
 
-java_objectheader *builtin_throw_exception(java_objectheader *exception);
+void *builtin_throw_exception(java_objectheader *exception);
 /* NOT AN OP */
 java_objectheader *builtin_trace_exception(java_objectheader *xptr,
                                                                                   methodinfo *m,
index e08037a898f57faacc3c0803bc8a1e7a84363a6b..3bba189a24a2aa414349e28cf224dddd533e6437 100644 (file)
@@ -31,7 +31,7 @@
             Christian Thalinger
                Edwin Steiner
 
-   $Id: asmpart.S 4735 2006-04-05 10:02:14Z twisti $
+   $Id: asmpart.S 4749 2006-04-11 10:20:18Z twisti $
 
 */
 
@@ -203,7 +203,6 @@ asm_vm_call_method_exception_handler:
        ldq     ra,0*8(sp)                /* restore return address               */
        ldq     s6,3*8(sp)
        lda     sp,5*8(sp)                /* free stack space                     */
-       mov     zero,v0                   /* return NULL                          */
        jmp     zero,(ra)
 
        .end    asm_vm_call_method
index 2b7c68b529559648d783d69eda492e2959eeefd0..eb563e5a5211a3c53132b7e809ff9678e87e0b4c 100644 (file)
@@ -31,7 +31,7 @@
    Changes: Joseph Wenninger
             Edwin Steiner
 
-   $Id: asmpart.S 4732 2006-04-04 21:31:52Z edwin $
+   $Id: asmpart.S 4749 2006-04-11 10:20:18Z twisti $
 
 */
 
@@ -225,7 +225,6 @@ asm_vm_call_method_exception_handler:
        push    xptr                        /* pass exception pointer             */
        call    builtin_throw_exception
        add     $4,sp
-       xor     v0,v0                       /* return NULL                        */
        jmp     L_asm_vm_call_method_return
 
 
index 062fd643a9828c1c9fbf4066c31caae3136b3ef7..d92418f99d768c91f67d43e7e3e81bab242c4f15 100644 (file)
@@ -29,7 +29,7 @@
    Changes: Christian Thalinger
             Edwin Steiner
 
-   $Id: asmpart.S 4735 2006-04-05 10:02:14Z twisti $
+   $Id: asmpart.S 4749 2006-04-11 10:20:18Z twisti $
 
 */
 
@@ -244,7 +244,6 @@ asm_vm_call_method_exception_handler:
        aaddu   sp,s7,sp
        move    a0,itmp1                  
        jal     builtin_throw_exception
-       move    v0,zero                   /* clear return value for exception     */
        b       calljava_return2
 
        .end    asm_vm_call_method
index 14bf6e2c2cb3e7a7f945ebf4e4df6a85268a7340..8af4da15066fb657b3925106c3b5dd05763e91e6 100644 (file)
@@ -31,7 +31,7 @@
    Changes: Christian Thalinger
             Edwin Steiner
 
-   $Id: asmpart.S 4735 2006-04-05 10:02:14Z twisti $
+   $Id: asmpart.S 4749 2006-04-11 10:20:18Z twisti $
 
 */
 
@@ -279,7 +279,6 @@ L_asm_vm_call_method_return:
 asm_vm_call_method_exception_handler:
        mr      r3,itmp1
        bl      builtin_throw_exception
-       li      v0,0                      /* return NULL                          */
        b       L_asm_vm_call_method_return
 
 
index 2297e8b5f20e4c8ef98f9b4dad996ec46668ba70..a502aaaa822b1ddb299e0c42ff6be403b90ededa 100644 (file)
@@ -30,7 +30,7 @@
 
    Changes: Edwin Steiner
 
-   $Id: asmpart.S 4735 2006-04-05 10:02:14Z twisti $
+   $Id: asmpart.S 4749 2006-04-11 10:20:18Z twisti $
 
 */
 
@@ -220,7 +220,6 @@ L_asm_vm_call_method_return:
 asm_vm_call_method_exception_handler:
        mov     xptr,a0                     /* pass exception pointer             */
        call    builtin_throw_exception@PLT
-       xor     v0,v0                       /* return NULL                        */
        jmp     L_asm_vm_call_method_return