* src/vm/jit/arm/emit.c (emit_exception_stubs): Removed.
authortwisti <none@none>
Tue, 3 Apr 2007 14:34:23 +0000 (14:34 +0000)
committertwisti <none@none>
Tue, 3 Apr 2007 14:34:23 +0000 (14:34 +0000)
* src/vm/jit/arm/md.c (md_codegen_patch_branch): Likewise.
(md_stacktrace_get_returnaddress): Removed debug code.

src/vm/jit/arm/emit.c
src/vm/jit/arm/md.c

index 7bcb3e7543d5b3e27a54b24c9d998bf80501a230..3b8c80cd947d6ca7b7cb1d709d29a627eeb7ec5b 100644 (file)
@@ -514,112 +514,6 @@ void emit_exception_check(codegendata *cd, instruction *iptr)
 }
 
 
-/* emit_exception_stubs ********************************************************
-
-   Generates the code for the exception stubs.
-
-*******************************************************************************/
-
-#if 0
-void emit_exception_stubs(jitdata *jd)
-{
-       codegendata  *cd;
-       registerdata *rd;
-       exceptionref *er;
-       s4            branchmpc;
-       s4            targetmpc;
-       s4            targetdisp;
-       s4            disp;
-
-       /* get required compiler data */
-
-       cd = jd->cd;
-       rd = jd->rd;
-
-       /* generate exception stubs */
-
-       targetdisp = 0;
-
-       for (er = cd->exceptionrefs; er != NULL; er = er->next) {
-               /* back-patch the branch to this exception code */
-
-               branchmpc = er->branchmpc;
-               targetmpc = cd->mcodeptr - cd->mcodebase;
-
-               md_codegen_patch_branch(cd, branchmpc, targetmpc);
-
-               MCODECHECK(100);
-
-               /* Check if the exception is an
-                  ArrayIndexOutOfBoundsException.  If so, move index register
-                  into REG_ITMP1. */
-
-               if (er->reg != -1)
-                       M_MOV(REG_ITMP1, er->reg);
-
-               /* calcuate exception address */
-
-               assert((er->branchmpc - 4) % 4 == 0);
-               M_ADD_IMM_EXT_MUL4(REG_ITMP2_XPC, REG_PV, (er->branchmpc - 4) / 4);
-
-               /* move function to call into REG_ITMP3 */
-
-               disp = dseg_add_functionptr(cd, er->function);
-               M_DSEG_LOAD(REG_ITMP3, disp);
-
-               if (targetdisp == 0) {
-                       targetdisp = ((u4 *) cd->mcodeptr) - ((u4 *) cd->mcodebase);
-
-                       M_MOV(rd->argintregs[0], REG_PV);
-                       M_MOV(rd->argintregs[1], REG_SP);
-
-                       if (jd->isleafmethod)
-                               M_MOV(rd->argintregs[2], REG_LR);
-                       else
-                               M_LDR(rd->argintregs[2], REG_SP,
-                                         cd->stackframesize * 4 - SIZEOF_VOID_P);
-
-                       M_MOV(rd->argintregs[3], REG_ITMP2_XPC);
-
-                       /* save registers */
-                       /* TODO: we only need to save LR in leaf methods */
-
-                       M_STMFD(BITMASK_ARGS | 1<<REG_PV | 1<<REG_LR, REG_SP);
-
-                       /* move a3 to stack */
-
-                       M_STR_UPDATE(REG_ITMP1, REG_SP, -4);
-
-                       /* do the exception call */
-
-                       M_MOV(REG_LR, REG_PC);
-                       M_MOV(REG_PC, REG_ITMP3);
-
-                       M_ADD_IMM(REG_SP, REG_SP, 4);
-
-                       /* result of stacktrace is our XPTR */
-
-                       M_MOV(REG_ITMP1_XPTR, REG_RESULT);
-
-                       /* restore registers */
-
-                       M_LDMFD(BITMASK_ARGS | 1<<REG_PV | 1<<REG_LR, REG_SP);
-
-                       disp = dseg_add_functionptr(cd, asm_handle_exception);
-                       M_DSEG_LOAD(REG_ITMP3, disp);
-                       M_MOV(REG_PC, REG_ITMP3);
-               }
-               else {
-                       disp = (((u4 *) cd->mcodebase) + targetdisp) -
-                               (((u4 *) cd->mcodeptr) + 2);
-
-                       M_B(disp);
-               }
-       }
-}
-#endif
-
-
 /* emit_patcher_stubs **********************************************************
 
    Generates the code for the patcher stubs.
index 066ed41138721f77526c79d484eb5ee23f00807a..c8d08cf6edf3877316d66a9fb06378b2b3c18db1 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: md.c 7596 2007-03-28 21:05:53Z twisti $
+   $Id: md.c 7653 2007-04-03 14:34:23Z twisti $
 
 */
 
@@ -56,38 +56,6 @@ void md_init(void)
 }
 
 
-/* md_codegen_patch_branch *****************************************************
-
-   Back-patches a branch instruction.
-
-*******************************************************************************/
-
-void md_codegen_patch_branch(codegendata *cd, s4 branchmpc, s4 targetmpc)
-{
-       s4 *mcodeptr;
-       s4  disp;                           /* branch displacement                */
-
-       /* calculate the patch position */
-
-       mcodeptr = (s4 *) (cd->mcodebase + branchmpc);
-
-       /* Calculate the branch displacement. */
-
-       disp = (targetmpc - branchmpc - 4) >> 2;
-
-       if ((disp < (s4) 0xff000000) || (disp > (s4) 0x00ffffff))
-               vm_abort("md_codegen_patch_branch: branch displacement out of range: %d > +/-%d", disp, 0x00ffffff);
-
-       /* sanity check: are we really patching a branch instruction */
-
-       assert((mcodeptr[-1] & 0x0e000000) == 0x0a000000);
-
-       /* patch the branch instruction before the mcodeptr */
-
-       mcodeptr[-1] |= (disp & 0x00ffffff);
-}
-
-
 /* md_stacktrace_get_returnaddress *********************************************
 
    Returns the return address of the current stackframe, specified by
@@ -99,14 +67,12 @@ u1 *md_stacktrace_get_returnaddress(u1 *sp, u4 framesize)
 {
        u1 *ra;
 
-       /*printf("md_stacktrace_get_returnaddress(): called (sp=%x, framesize=%d)\n", sp, framesize);*/
+       /* On ARM the return address is located on the top of the
+          stackframe. */
+       /* ATTENTION: This is only true for non-leaf methods!!! */
 
-       /* on ARM the return address is located on the top of the stackframe */
-       /* ATTENTION: this is only true for non-leaf methods !!! */
        ra = *((u1 **) (sp + framesize - SIZEOF_VOID_P));
 
-       /*printf("md_stacktrace_get_returnaddress(): result (ra=%x)\n", ra);*/
-
        return ra;
 }