* Removed all Id tags.
[cacao.git] / src / vm / jit / alpha / md.c
index 41c63662af286dc32c159e11ee69cd4534084a0d..c069ebbe32371fd01d2d1a56b21a55f1550c1c61 100644 (file)
@@ -22,8 +22,6 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: md.c 7304 2007-02-09 10:35:26Z twisti $
-
 */
 
 
@@ -89,42 +87,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  mcode;
-       s4  disp;                           /* branch displacement                */
-
-       /* calculate the patch position */
-
-       mcodeptr = (s4 *) (cd->mcodebase + branchmpc);
-
-       /* get the instruction before the exception point */
-
-       mcode = mcodeptr[-1];
-
-       /* Calculate the branch displacement.  For branches we need a
-          displacement relative and shifted to the branch PC. */
-
-       disp = (targetmpc - branchmpc) >> 2;
-
-       /* check branch displacement */
-
-       if ((disp < (s4) 0xffe00000) || (disp > (s4) 0x001fffff))
-               vm_abort("branch displacement is out of range: %d > +/-%d", disp, 0x001fffff);
-
-       /* patch the branch instruction before the mcodeptr */
-
-       mcodeptr[-1] |= (disp & 0x001fffff);
-}
-
-
 /* md_stacktrace_get_returnaddress *********************************************
 
    Returns the return address of the current stackframe, specified by
@@ -324,7 +286,6 @@ void md_icacheflush(u1 *addr, s4 nbytes)
 #if defined(ENABLE_REPLACEMENT)
 void md_patch_replacement_point(codeinfo *code, s4 index, rplpoint *rp, u1 *savedmcode)
 {
-       s4 disp;
        u4 mcode;
 
        if (index < 0) {
@@ -336,12 +297,7 @@ void md_patch_replacement_point(codeinfo *code, s4 index, rplpoint *rp, u1 *save
                *(u4*)(savedmcode) = *(u4*)(rp->pc);
 
                /* build the machine code for the patch */
-               disp = ((u4*)code->replacementstubs - (u4*)rp->pc)
-                          + index * REPLACEMENT_STUB_SIZE
-                          - 1;
-
-               /* BR */
-        mcode = (((s4) (0x30)) << 26) | ((REG_ZERO) << 21) | ((disp) & 0x1fffff);
+               mcode = (0xa41f0000 | (EXCEPTION_HARDWARE_PATCHER));
 
                /* write the new machine code */
                *(u4*)(rp->pc) = mcode;
@@ -360,6 +316,7 @@ void md_patch_replacement_point(codeinfo *code, s4 index, rplpoint *rp, u1 *save
 }
 #endif /* defined(ENABLE_REPLACEMENT) */
 
+
 /*
  * These are local overrides for various environment variables in Emacs.
  * Please do not remove this and leave it at the end of the file, where