* patcher_athrow_areturn: Added.
authortwisti <none@none>
Fri, 21 Oct 2005 13:16:52 +0000 (13:16 +0000)
committertwisti <none@none>
Fri, 21 Oct 2005 13:16:52 +0000 (13:16 +0000)
src/vm/jit/alpha/patcher.c

index 17b1b76638e15462dd476f90a386ba3390dfe36f..523007fdf1d7ab50af38736c7241f8899f7a639a 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes:
 
-   $Id: patcher.c 3464 2005-10-20 10:16:29Z edwin $
+   $Id: patcher.c 3481 2005-10-21 13:16:52Z twisti $
 
 */
 
@@ -969,6 +969,58 @@ bool patcher_clinit(u1 *sp)
 }
 
 
+/* patcher_athrow_areturn ******************************************************
+
+   Machine code:
+
+   <patched call position>
+
+*******************************************************************************/
+
+bool patcher_athrow_areturn(u1 *sp)
+{
+       u1                *ra;
+       java_objectheader *o;
+       u4                 mcode;
+       unresolved_class  *uc;
+       classinfo         *c;
+
+       /* get stuff from the stack */
+
+       ra    = (u1 *)                *((ptrint *) (sp + 5 * 8));
+       o     = (java_objectheader *) *((ptrint *) (sp + 4 * 8));
+       mcode =                       *((u4 *)     (sp + 3 * 8));
+       uc    = (unresolved_class *)  *((ptrint *) (sp + 2 * 8));
+
+       /* calculate and set the new return address */
+
+       ra = ra - 1 * 4;
+       *((ptrint *) (sp + 5 * 8)) = (ptrint) ra;
+
+       PATCHER_MONITORENTER;
+
+       /* resolve the class */
+
+       if (!resolve_class(uc, resolveEager, false, &c)) {
+               PATCHER_MONITOREXIT;
+
+               return false;
+       }
+
+       /* patch back original code */
+
+       *((u4 *) ra) = mcode;
+
+       /* synchronize instruction cache */
+
+       asm_sync_instruction_cache();
+
+       PATCHER_MARK_PATCHED_MONITOREXIT;
+
+       return true;
+}
+
+
 /* patcher_resolve_native ******************************************************
 
    XXX