X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fvm%2Fjit%2Fmips%2Fmd.c;h=b28f0bd26653321f34e9048e6752ecbdaf569f5a;hb=d618789d14ccf54bd2f7343f67763983158d1b3b;hp=fedd7447247df8b0ce314a228ec0aea10858bbb7;hpb=3c47913fefefcaf82d6a009eed406a9e2aac81f7;p=cacao.git diff --git a/src/vm/jit/mips/md.c b/src/vm/jit/mips/md.c index fedd74472..b28f0bd26 100644 --- a/src/vm/jit/mips/md.c +++ b/src/vm/jit/mips/md.c @@ -22,7 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - $Id: md.c 7477 2007-03-07 14:05:04Z twisti $ + $Id: md.c 7486 2007-03-08 13:50:07Z twisti $ */ @@ -49,63 +49,6 @@ #endif -/* md_codegen_patch_branch ***************************************************** - - Back-patches a branch instruction. - -*******************************************************************************/ - -void md_codegen_patch_branch(codegendata *cd, s4 branchmpc, s4 targetmpc) -{ - s4 *mcodeptr; - s4 mcode; - s4 disp; /* branch displacement */ - s4 lo; - s4 hi; - - /* calculate the patch position */ - - mcodeptr = (s4 *) (cd->mcodebase + branchmpc); - - /* get the instruction before the exception point */ - - mcode = mcodeptr[-1]; - - /* check for: ori t9,t9,0 */ - - if ((mcode >> 16) == 0x3739) { - /* Calculate the branch displacement. For jumps we need a - displacement relative to PV. */ - - disp = targetmpc; - - lo = (short) disp; - hi = (short) ((disp - lo) >> 16); - - /* patch the two instructions before the mcodeptr */ - - mcodeptr[-2] |= (hi & 0x0000ffff); - mcodeptr[-1] |= (lo & 0x0000ffff); - } - else { - /* Calculate the branch displacement. For branches we need a - displacement relative and shifted to the branch PC. */ - - disp = (targetmpc - branchmpc) >> 2; - - /* On the MIPS we can only branch signed 16-bit instruction words - (signed 18-bit = 32KB = +/- 16KB). Check this! */ - - if ((disp < (s4) 0xffff8000) || (disp > (s4) 0x00007fff)) - vm_abort("jump displacement is out of range: %d > +/-%d", disp, 0x00007fff); - - /* patch the branch instruction before the mcodeptr */ - - mcodeptr[-1] |= (disp & 0x0000ffff); - } -} - - /* md_stacktrace_get_returnaddress ********************************************* Returns the return address of the current stackframe, specified by