-bool patcher_checkcast_instanceof_interface(u1 *sp)
-{
- u1 *ra;
- java_objectheader *o;
- u8 mcode;
- constant_classref *cr;
- classinfo *c;
-
- /* get stuff from the stack */
-
- ra = (u1 *) *((ptrint *) (sp + 4 * 8));
- o = (java_objectheader *) *((ptrint *) (sp + 3 * 8));
- mcode = *((u8 *) (sp + 2 * 8));
- cr = (constant_classref *) *((ptrint *) (sp + 1 * 8));
-
- /* calculate and set the new return address */
-
- ra = ra - 5;
- *((ptrint *) (sp + 4 * 8)) = (ptrint) ra;
-
- PATCHER_MONITORENTER;
-
- /* get the fieldinfo */
-
- if (!(c = resolve_classref_eager(cr))) {
- PATCHER_MONITOREXIT;
-
- return false;
- }
-
- /* patch back original code */
-
- *((u8 *) ra) = mcode;
-
- /* if we show disassembly, we have to skip the nop's */
-
- if (opt_showdisassemble)
- ra = ra + 5;
-
- /* patch super class index */
-
- *((s4 *) (ra + 7 + 3)) = (s4) c->index;
-
- *((s4 *) (ra + 7 + 7 + 3 + 6 + 3)) =
- (s4) (OFFSET(vftbl_t, interfacetable[0]) -
- c->index * sizeof(methodptr*));
-
- PATCHER_MARK_PATCHED_MONITOREXIT;
-
- return true;
-}
-
-
-/* patcher_checkcast_class *****************************************************
-
- Machine code:
-
- <patched call position>
- 49 bb 00 00 00 00 00 00 00 00 mov $0x0,%r11
- 45 8b 92 20 00 00 00 mov 0x20(%r10),%r10d
- 45 8b 9b 20 00 00 00 mov 0x20(%r11),%r11d
- 4d 29 da sub %r11,%r10
- 49 bb 00 00 00 00 00 00 00 00 mov $0x0,%r11
-
-*******************************************************************************/
-
-bool patcher_checkcast_class(u1 *sp)
-{
- u1 *ra;
- java_objectheader *o;
- u8 mcode;
- constant_classref *cr;
- classinfo *c;
-
- /* get stuff from the stack */
-
- ra = (u1 *) *((ptrint *) (sp + 4 * 8));
- o = (java_objectheader *) *((ptrint *) (sp + 3 * 8));
- mcode = *((u8 *) (sp + 2 * 8));
- cr = (constant_classref *) *((ptrint *) (sp + 1 * 8));
-
- /* calculate and set the new return address */
-
- ra = ra - 5;
- *((ptrint *) (sp + 4 * 8)) = (ptrint) ra;
-
- PATCHER_MONITORENTER;
-
- /* get the fieldinfo */
-
- if (!(c = resolve_classref_eager(cr))) {
- PATCHER_MONITOREXIT;
-
- return false;
- }
-
- /* patch back original code */
-
- *((u8 *) ra) = mcode;
-
- /* if we show disassembly, we have to skip the nop's */
-
- if (opt_showdisassemble)
- ra = ra + 5;
-
- /* patch super class' vftbl */
-
- *((ptrint *) (ra + 2)) = (ptrint) c->vftbl;
- *((ptrint *) (ra + 10 + 7 + 7 + 3 + 2)) = (ptrint) c->vftbl;
-
- PATCHER_MARK_PATCHED_MONITOREXIT;
-
- return true;
-}
-
-
-/* patcher_instanceof_class ****************************************************
-
- Machine code:
-
- <patched call position>
- 49 ba 00 00 00 00 00 00 00 00 mov $0x0,%r10
-
-*******************************************************************************/
-
-bool patcher_instanceof_class(u1 *sp)