* src/vm/exceptions.c (exceptions_asm_new_abstractmethoderror): New
authortwisti <none@none>
Wed, 28 Jun 2006 19:43:42 +0000 (19:43 +0000)
committertwisti <none@none>
Wed, 28 Jun 2006 19:43:42 +0000 (19:43 +0000)
function.
* src/vm/exceptions.h (exceptions_asm_new_abstractmethoderror): Added.

* src/vm/jit/x86_64/asmpart.S (asm_abstractmethoderror): Use
exceptions_asm_new_abstractmethoderror.
* src/vm/jit/i386/asmpart.S (asm_abstractmethoderror): Likewise.

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

index ef026cc7f5b60b3bbc02c29302772bcff5f318ee..a5afcd6b503ea3d9722c1a78cb57290e217a1094 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes: Edwin Steiner
 
-   $Id: exceptions.c 5053 2006-06-28 19:11:20Z twisti $
+   $Id: exceptions.c 5054 2006-06-28 19:43:42Z twisti $
 
 */
 
@@ -519,6 +519,34 @@ java_objectheader *exceptions_new_abstractmethoderror(void)
 }
 
 
+/* exceptions_asm_new_abstractmethoderror **************************************
+
+   Generates a java.lang.AbstractMethodError for
+   asm_abstractmethoderror.
+
+*******************************************************************************/
+
+java_objectheader *exceptions_asm_new_abstractmethoderror(u1 *sp, u1 *ra)
+{
+       stackframeinfo     sfi;
+       java_objectheader *e;
+
+       /* create the stackframeinfo (XPC is equal to RA) */
+
+       stacktrace_create_extern_stackframeinfo(&sfi, NULL, sp, ra, ra);
+
+       /* create the exception */
+
+       e = exceptions_new_abstractmethoderror();
+
+       /* remove the stackframeinfo */
+
+       stacktrace_remove_stackframeinfo(&sfi);
+
+       return e;
+}
+
+
 /* exceptions_throw_abstractmethoderror ****************************************
 
    Generates a java.lang.AbstractMethodError for the VM and throws it.
index dc585cd5bcbe56e5a000bb8b8f307efb6e900a47..58bb14c1179c437252cea424b85d8fa5dc6bf687 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes: Edwin Steiner
 
-   $Id: exceptions.h 5053 2006-06-28 19:11:20Z twisti $
+   $Id: exceptions.h 5054 2006-06-28 19:43:42Z twisti $
 
 */
 
@@ -119,6 +119,7 @@ java_objectheader *new_exception_int(const char *classname, s4 i);
 /* functions to generate compiler exceptions */
 
 java_objectheader *exceptions_new_abstractmethoderror(void);
+java_objectheader *exceptions_asm_new_abstractmethoderror(u1 *sp, u1 *ra);
 void exceptions_throw_abstractmethoderror(void);
 
 java_objectheader *new_classformaterror(classinfo *c, const char *message, ...);
index 1e580e97b0beec169bf7450d8707d95425e9ae70..d6df17791b888287ff1f45ebf1e1aa9588864e6c 100644 (file)
@@ -31,7 +31,7 @@
    Changes: Joseph Wenninger
             Edwin Steiner
 
-   $Id: asmpart.S 5053 2006-06-28 19:11:20Z twisti $
+   $Id: asmpart.S 5054 2006-06-28 19:43:42Z twisti $
 
 */
 
@@ -482,8 +482,17 @@ noflt:
 *******************************************************************************/
 
 asm_abstractmethoderror:
-       call    exceptions_new_abstractmethoderror
+       sub     $(2*4),sp                   /* create stack frame                 */
+       mov     sp,itmp1                    /* pass java sp                       */
+       add     $((1+2)*4),itmp1
+       mov     itmp1,0*4(sp)
+       mov     2*4(sp),itmp2               /* pass exception address             */
+       sub     $2,itmp2
+       mov     itmp2,1*4(sp)
+       call    exceptions_asm_new_abstractmethoderror
                                            /* exception pointer is return value  */
+       add     $(2*4),sp                   /* remove stack frame                 */
+
        pop     xpc                         /* get exception address              */
        sub     $2,xpc                      /* exception address is ra - 2        */
        jmp     L_asm_handle_exception
index d3ad6a18a56dd0839cbf02a0cdb2e351fe412edd..34a3f25caa6ac0101241302e6edb7fe3f2e01042 100644 (file)
@@ -30,7 +30,7 @@
 
    Changes: Edwin Steiner
 
-   $Id: asmpart.S 5053 2006-06-28 19:11:20Z twisti $
+   $Id: asmpart.S 5054 2006-06-28 19:43:42Z twisti $
 
 */
 
@@ -59,6 +59,7 @@
        .globl asm_vm_call_method_exception_handler
 
        .globl asm_call_jit_compiler
+
        .globl asm_handle_exception
        .globl asm_handle_nat_exception
 
@@ -507,10 +508,14 @@ noflt:
 *******************************************************************************/
 
 asm_abstractmethoderror:
-       call    exceptions_new_abstractmethoderror@PLT
+       mov     sp,a0                       /* pass java sp                       */
+       add     $1*8,a0
+       mov     0*8(sp),a1                  /* pass exception address             */
+       sub     $3,a1
+       call    exceptions_asm_new_abstractmethoderror@PLT
                                            /* exception pointer is return value  */
        pop     xpc                         /* get exception address              */
-       sub     $5,xpc                      /* exception address is ra - 5        */
+       sub     $3,xpc                      /* exception address is ra - 3        */
        jmp     L_asm_handle_exception