* patcher_get_putstatic, patcher_get_putfield,
authortwisti <none@none>
Fri, 28 Oct 2005 14:47:11 +0000 (14:47 +0000)
committertwisti <none@none>
Fri, 28 Oct 2005 14:47:11 +0000 (14:47 +0000)
  patcher_builtin_multianewarray, patcher_builtin_arraycheckcast,
  patcher_invokestatic_special, patcher_invokevirtual,
  patcher_invokeinterface, patcher_checkcast_instanceof_flags,
  patcher_checkcast_instanceof_interface,
  patcher_checkcast_instanceof_class, patcher_clinit,
  patcher_athrow_areturn: Don't calculate return address and write it back,
  this is now done implicitly by the patcher stub.
* patcher_builtin_new, patcher_builtin_newarray,
  patcher_builtin_arrayinstanceof: Adjusted return address calculation.

src/vm/jit/mips/patcher.c

index 3eb3d69a6b09cfc1b982245800221ecf641b7db4..6ea73649dc497ac38ebeabf04a6bc8b973d0dee1 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes:
 
-   $Id: patcher.c 3475 2005-10-21 12:03:06Z twisti $
+   $Id: patcher.c 3518 2005-10-28 14:47:11Z twisti $
 
 */
 
@@ -88,11 +88,6 @@ bool patcher_get_putstatic(u1 *sp)
        disp     =                       *((s4 *)     (sp + 1 * 8));
        pv       = (u1 *)                *((ptrint *) (sp + 0 * 8));
 
-       /* calculate and set the new return address */
-
-       ra = ra - 2 * 4;
-       *((ptrint *) (sp + 5 * 8)) = (ptrint) ra;
-
        PATCHER_MONITORENTER;
 
        /* get the fieldinfo */
@@ -172,11 +167,6 @@ bool patcher_get_putfield(u1 *sp)
 #endif
        uf       = (unresolved_field *)  *((ptrint *) (sp + 2 * 8));
 
-       /* calculate and set the new return address */
-
-       ra = ra - 2 * 4;
-       *((ptrint *) (sp + 5 * 8)) = (ptrint) ra;
-
        PATCHER_MONITORENTER;
 
        /* get the fieldinfo */
@@ -265,7 +255,7 @@ bool patcher_builtin_new(u1 *sp)
 
        /* calculate and set the new return address */
 
-       ra = ra - (3 * 4);
+       ra = ra - 1 * 4;
        *((ptrint *) (sp + 5 * 8)) = (ptrint) ra;
 
        PATCHER_MONITORENTER;
@@ -352,7 +342,7 @@ bool patcher_builtin_newarray(u1 *sp)
 
        /* calculate and set the new return address */
 
-       ra = ra - (3 * 4);
+       ra = ra - 1 * 4;
        *((ptrint *) (sp + 5 * 8)) = (ptrint) ra;
 
        PATCHER_MONITORENTER;
@@ -434,11 +424,6 @@ bool patcher_builtin_multianewarray(u1 *sp)
        disp     =                       *((s4 *)     (sp + 1 * 8));
        pv       = (u1 *)                *((ptrint *) (sp + 0 * 8));
 
-       /* calculate and set the new return address */
-
-       ra = ra - 2 * 4;
-       *((ptrint *) (sp + 5 * 8)) = (ptrint) ra;
-
        PATCHER_MONITORENTER;
 
        /* get the classinfo */
@@ -517,11 +502,6 @@ bool patcher_builtin_arraycheckcast(u1 *sp)
        disp     =                       *((s4 *)     (sp + 1 * 8));
        pv       = (u1 *)                *((ptrint *) (sp + 0 * 8));
 
-       /* calculate and set the new return address */
-
-       ra = ra - 2 * 4;
-       *((ptrint *) (sp + 5 * 8)) = (ptrint) ra;
-
        PATCHER_MONITORENTER;
 
        /* get the classinfo */
@@ -607,7 +587,7 @@ bool patcher_builtin_arrayinstanceof(u1 *sp)
 
        /* calculate and set the new return address */
 
-       ra = ra - 3 * 4;
+       ra = ra - 1 * 4;
        *((ptrint *) (sp + 5 * 8)) = (ptrint) ra;
 
        PATCHER_MONITORENTER;
@@ -687,11 +667,6 @@ bool patcher_invokestatic_special(u1 *sp)
        disp     =                       *((s4 *)     (sp + 1 * 8));
        pv       = (u1 *)                *((ptrint *) (sp + 0 * 8));
 
-       /* calculate and set the new return address */
-
-       ra = ra - 2 * 4;
-       *((ptrint *) (sp + 5 * 8)) = (ptrint) ra;
-
        PATCHER_MONITORENTER;
 
        /* get the fieldinfo */
@@ -762,11 +737,6 @@ bool patcher_invokevirtual(u1 *sp)
 #endif
        um       = (unresolved_method *) *((ptrint *) (sp + 2 * 8));
 
-       /* calculate and set the new return address */
-
-       ra = ra - 2 * 4;
-       *((ptrint *) (sp + 5 * 8)) = (ptrint) ra;
-
        PATCHER_MONITORENTER;
 
        /* get the fieldinfo */
@@ -847,11 +817,6 @@ bool patcher_invokeinterface(u1 *sp)
 #endif
        um       = (unresolved_method *) *((ptrint *) (sp + 2 * 8));
 
-       /* calculate and set the new return address */
-
-       ra = ra - 2 * 4;
-       *((ptrint *) (sp + 5 * 8)) = (ptrint) ra;
-
        PATCHER_MONITORENTER;
 
        /* get the fieldinfo */
@@ -940,11 +905,6 @@ bool patcher_checkcast_instanceof_flags(u1 *sp)
        disp     =                       *((s4 *)     (sp + 1 * 8));
        pv       = (u1 *)                *((ptrint *) (sp + 0 * 8));
 
-       /* calculate and set the new return address */
-
-       ra = ra - 2 * 4;
-       *((ptrint *) (sp + 5 * 8)) = (ptrint) ra;
-
        PATCHER_MONITORENTER;
 
        /* get the fieldinfo */
@@ -1017,11 +977,6 @@ bool patcher_checkcast_instanceof_interface(u1 *sp)
 #endif
        cr       = (constant_classref *) *((ptrint *) (sp + 2 * 8));
 
-       /* calculate and set the new return address */
-
-       ra = ra - 2 * 4;
-       *((ptrint *) (sp + 5 * 8)) = (ptrint) ra;
-
        PATCHER_MONITORENTER;
 
        /* get the fieldinfo */
@@ -1105,11 +1060,6 @@ bool patcher_checkcast_instanceof_class(u1 *sp)
        disp     =                       *((s4 *)     (sp + 1 * 8));
        pv       = (u1 *)                *((ptrint *) (sp + 0 * 8));
 
-       /* calculate and set the new return address */
-
-       ra = ra - 2 * 4;
-       *((ptrint *) (sp + 5 * 8)) = (ptrint) ra;
-
        PATCHER_MONITORENTER;
 
        /* get the fieldinfo */
@@ -1173,11 +1123,6 @@ bool patcher_clinit(u1 *sp)
 #endif
        c        = (classinfo *)         *((ptrint *) (sp + 2 * 8));
 
-       /* calculate and set the new return address */
-
-       ra = ra - 2 * 4;
-       *((ptrint *) (sp + 5 * 8)) = (ptrint) ra;
-
        PATCHER_MONITORENTER;
 
        /* check if the class is initialized */
@@ -1242,11 +1187,6 @@ bool patcher_athrow_areturn(u1 *sp)
 #endif
        uc       = (unresolved_class *)  *((ptrint *) (sp + 2 * 8));
 
-       /* calculate and set the new return address */
-
-       ra = ra - 2 * 4;
-       *((ptrint *) (sp + 5 * 8)) = (ptrint) ra;
-
        PATCHER_MONITORENTER;
 
        /* resolve the class */