- *((ptrint *) (ra + 3)) = (ptrint) c;
-
- /* if we show disassembly, we have to skip the nop's */
-
- if (opt_showdisassemble)
- ra = ra + 5;
-
- /* patch new function address */
-
- *((ptrint *) (ra + 7 + 1)) = (ptrint) BUILTIN_new;
-
- PATCHER_MARK_PATCHED_MONITOREXIT;
-
- return true;
-}
-
-
-/* patcher_builtin_newarray ****************************************************
-
- Machine code:
-
- c7 44 24 08 00 00 00 00 movl $0x00000000,0x8(%esp)
- <patched call position>
- b8 00 00 00 00 mov $0x00000000,%eax
- ff d0 call *%eax
-
-*******************************************************************************/
-
-bool patcher_builtin_newarray(u1 *sp)
-{
- u1 *ra;
- java_objectheader *o;
- u8 mcode;
- constant_classref *cr;
- classinfo *c;
-
- /* get stuff from the stack */
-
- ra = (u1 *) *((ptrint *) (sp + 4 * 4));
- o = (java_objectheader *) *((ptrint *) (sp + 3 * 4));
- mcode = *((u8 *) (sp + 1 * 4));
- cr = (constant_classref *) *((ptrint *) (sp + 0 * 4));
-
- /* calculate and set the new return address */
-
- ra = ra - (8 + 5);
- *((ptrint *) (sp + 4 * 4)) = (ptrint) ra;
-
- PATCHER_MONITORENTER;
-
- /* get the classinfo */
-
- if (!(c = helper_resolve_classinfo(cr))) {
- PATCHER_MONITOREXIT;
-
- return false;
- }
-
- /* patch back original code */
-
- *((u4 *) (ra + 8 + 0)) = (u4) mcode;
- *((u1 *) (ra + 8 + 4)) = (u1) (mcode >> 32);
-
- /* patch the class' vftbl pointer */
-
- *((ptrint *) (ra + 4)) = (ptrint) c->vftbl;
-
- /* if we show disassembly, we have to skip the nop's */
-
- if (opt_showdisassemble)
- ra = ra + 5;
-
- /* patch new function address */
-
- *((ptrint *) (ra + 8 + 1)) = (ptrint) BUILTIN_newarray;
-
- PATCHER_MARK_PATCHED_MONITOREXIT;