- *((s4 *) (ra + 7 + 3)) = (s4) c->index;
-
- *((s4 *) (ra + 7 + 7 + 6 + 3)) =
- (s4) (OFFSET(vftbl_t, interfacetable[0]) -
- c->index * sizeof(methodptr*));
-
- 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)
-{
- u1 *ra;
- u8 mcode;
- constant_classref *cr;
- classinfo *c;
-
- /* get stuff from the stack */
-
- ra = (u1 *) *((ptrint *) (sp + 5 * 8));
- mcode = *((u8 *) (sp + 3 * 8));
- cr = (constant_classref *) *((ptrint *) (sp + 2 * 8));
-
- /* get the fieldinfo */
-
- if (!(c = resolve_classref_eager(cr)))
- return false;
-
- /* patch back original code */
-
- *((u8 *) ra) = mcode;
-
- /* if we show disassembly, we have to skip the nop's */
-
- if (opt_shownops)
- ra = ra + 5;
-
- /* patch super class' vftbl */
-
- *((ptrint *) (ra + 2)) = (ptrint) c->vftbl;
-
- return true;
-}
-
-
-/* patcher_clinit **************************************************************
-
- May be used for GET/PUTSTATIC and in native stub.
-
- Machine code:
-
- <patched call position>
- 4d 8b 15 92 ff ff ff mov -110(%rip),%r10
- 49 89 1a mov %rbx,(%r10)
-
-*******************************************************************************/
-
-bool patcher_clinit(u1 *sp)
-{
- u1 *ra;
- u8 mcode;
- classinfo *c;
-
- /* get stuff from the stack */
-
- ra = (u1 *) *((ptrint *) (sp + 5 * 8));
- mcode = *((u8 *) (sp + 3 * 8));
- c = (classinfo *) *((ptrint *) (sp + 2 * 8));
-
- /* check if the class is initialized */
-
- if (!(c->state & CLASS_INITIALIZED))
- if (!initialize_class(c))
- return false;
-
- /* patch back original code */
-
- *((u8 *) ra) = mcode;
-
- return true;
-}
-
-
-/* patcher_athrow_areturn ******************************************************
-
- Machine code:
-
- <patched call position>
-
-*******************************************************************************/
-
-#ifdef ENABLE_VERIFIER
-bool patcher_athrow_areturn(u1 *sp)
-{
- u1 *ra;
- u8 mcode;
- unresolved_class *uc;
-
- /* get stuff from the stack */
-
- ra = (u1 *) *((ptrint *) (sp + 5 * 8));
- mcode = *((u8 *) (sp + 3 * 8));
- uc = (unresolved_class *) *((ptrint *) (sp + 2 * 8));
-
- /* resolve the class and check subtype constraints */
-
- if (!resolve_class_eager_no_access_check(uc))
- return false;
-
- /* patch back original code */
-
- *((u8 *) ra) = mcode;
-
- return true;
-}
-#endif /* ENABLE_VERIFIER */
-
-
-/* patcher_resolve_native ******************************************************
-
- Machine code:
-
- <patched call position>
- 48 b8 00 00 00 00 00 00 00 00 mov $0x0,%rax
- 48 ff d0 callq *%rax
-
-*******************************************************************************/
-
-bool patcher_resolve_native(u1 *sp)
-{
- u1 *ra;
- u8 mcode;
- methodinfo *m;
- functionptr f;
-
- /* get stuff from the stack */
-
- ra = (u1 *) *((ptrint *) (sp + 5 * 8));
- mcode = *((u8 *) (sp + 3 * 8));
- m = (methodinfo *) *((ptrint *) (sp + 2 * 8));
-
- /* resolve native function */
-
- if (!(f = native_resolve_function(m)))
- return false;
-
- /* patch back original code */
-
- *((u8 *) ra) = mcode;
-
- /* if we show disassembly, we have to skip the nop's */
-
- if (opt_shownops)
- ra = ra + 5;
-
- /* patch native function pointer */