51 #include "vm/jit/patcher.hpp"
75 #if SIZEOF_VOID_P == 8
86 bool (*patcher_function)(
u1 *);
92 xpc = (
u1 *) *((
ptrint *) (sp + 5 * 8));
102 patcher_function = (bool (*)(
u1 *)) (
ptrint) f;
106 PATCHER_MONITORENTER;
115 printf(
"patcher opening sfi for xpc=%p\n", xpc);
121 result = (patcher_function)(sp);
126 printf(
"patcher closing sfi for xpc=%p\n", xpc);
130 if (result ==
false) {
140 #if SIZEOF_VOID_P == 8
141 mcode = *((
u8 *) (sp + 3 * 8));
143 *((
u4 *) (xpc + 0 * 4)) = mcode >> 32;
144 *((
u4 *) (xpc + 1 * 4)) = mcode;
146 mcode[0] = *((
u4 *) (sp + 3 * 8));
147 mcode[1] = *((
u4 *) (sp + 3 * 8 + 4));
149 *((
u4 *) (xpc + 0 * 4)) = mcode[0];
150 *((
u4 *) (xpc + 1 * 4)) = mcode[1];
158 PATCHER_MARK_PATCHED_MONITOREXIT;
184 disp = *((
s4 *) (sp + 1 * 8));
185 pv = (
u1 *) *((
ptrint *) (sp + 0 * 8));
200 *((intptr_t *) (pv + disp)) = (intptr_t) fi->
value;
226 ra = (
u1 *) *((
ptrint *) (sp + 5 * 8));
236 *((
u4 *) (sp + 3 * 8)) |= (
s2) (fi->
offset & 0x00001fff);
261 disp = *((
s4 *) (sp + 1 * 8));
262 pv = (
u1 *) *((
ptrint *) (sp + 0 * 8));
304 disp = *((
s4 *) (sp + 1 * 8));
305 pv = (
u1 *) *((
ptrint *) (sp + 0 * 8));
346 disp = *((
s4 *) (sp + 1 * 8));
347 pv = (
u1 *) *((
ptrint *) (sp + 0 * 8));
387 disp = *((
s4 *) (sp + 1 * 8));
388 pv = (
u1 *) *((
ptrint *) (sp + 0 * 8));
427 ra = (
u1 *) *((
ptrint *) (sp + 5 * 8));
437 *((
s4 *) (sp + 3 * 8 + 4)) |=
466 ra = (
u1 *) *((
ptrint *) (sp + 5 * 8));
476 *((
s4 *) (sp + 3 * 8 + 4)) |=
482 *((
s4 *) (ra + 2 * 4)) |=
515 disp = *((
s4 *) (sp + 1 * 8));
516 pv = (
u1 *) *((
ptrint *) (sp + 0 * 8));
557 ra = (
u1 *) *((
ptrint *) (sp + 5 * 8));
567 *((
s4 *) (ra + 2 * 4)) |= (
s4) (-(c->
index) & 0x00001fff);
602 ra = (
u1 *) *((
ptrint *) (sp + 5 * 8));
612 *((
s4 *) (ra + 2 * 4)) |= (
s4) ((c->
index) & 0x00001fff);
613 *((
s4 *) (ra + 5 * 4)) |=
645 disp = *((
s4 *) (sp + 1 * 8));
646 pv = (
u1 *) *((
ptrint *) (sp + 0 * 8));
697 #ifdef ENABLE_VERIFIER
732 disp = *((
s4 *) (sp + 1 * 8));
733 pv = (
u1 *) *((
ptrint *) (sp + 0 * 8));
739 if (!(f = native_resolve_function(m)))
bool patcher_invokestatic_special(patchref_t *pr)
bool patcher_get_putstatic(patchref_t *pr)
bool patcher_invokeinterface(patchref_t *pr)
#define PATCHER_CALL_SIZE
java_object_t * patcher_wrapper(u1 *sp, u1 *pv, u1 *ra)
classinfo * resolve_class_eager_no_access_check(unresolved_class *ref)
static void md_dcacheflush(void *addr, int nbytes)
bool patcher_clinit(u1 *sp)
#define EXCEPTION_CHECK_INSTRUCTIONS
bool patcher_resolve_native(u1 *sp)
void(* functionptr)(void)
bool patcher_athrow_areturn(u1 *sp)
bool patcher_invokevirtual(patchref_t *pr)
bool patcher_aconst(patchref_t *pr)
bool patcher_checkcast_interface(patchref_t *pr)
#define exceptions_get_and_clear_exception
void stacktrace_stackframeinfo_add(stackframeinfo_t *sfi, void *pv, void *sp, void *ra, void *xpc)
bool initialize_class(classinfo *c)
bool patcher_get_putfield(patchref_t *pr)
fieldinfo * resolve_field_eager(unresolved_field *ref)
bool patcher_checkcast_instanceof_class(u1 *sp)
bool patcher_checkcast_instanceof_flags(patchref_t *pr)
void stacktrace_stackframeinfo_remove(stackframeinfo_t *sfi)
methodinfo * resolve_method_eager(unresolved_method *ref)
bool patcher_builtin_arraycheckcast(patchref_t *pr)
classinfo * resolve_classref_eager(constant_classref *ref)
bool patcher_builtin_multianewarray(patchref_t *pr)
static void md_icacheflush(void *addr, int nbytes)
bool patcher_instanceof_interface(patchref_t *pr)