(codegen_emit_stub_native): Ported to new interface.
Ported to new interface, removed warnings.
(md_signal_handler_sigill): Likewise.
(offset.h): Removed.
(PATCH_BACK_ORIGINAL_MCODE): Added.
(patcher_patch_back): Removed.
(patcher_patch_code): Added.
(patcher_*): Use patchref_t instead of void *sp everywhere.
codegendata *cd;
registerdata *rd;
s4 len, s1, s2, s3, d, disp;
- ptrint a;
varinfo *var;
basicblock *bptr;
instruction *iptr;
M_AMOV_IMM(asm_call_jit_compiler, REG_ATMP3);
M_JMP(REG_ATMP3);
}
-
-/* codegen_emit_stub_builtin ***************************************************
-
- Creates a stub routine which calls a builtin function.
-
-*******************************************************************************/
-
-void codegen_emit_stub_builtin(jitdata *jd, builtintable_entry *bte)
-{
- codeinfo *code;
- codegendata *cd;
- methoddesc *md;
- s4 i;
- s4 disp;
- s4 s1, s2;
-
- /* get required compiler data */
- code = jd->code;
- cd = jd->cd;
-
- /* set some variables */
- md = bte->md;
-
- /* calculate stack frame size */
- cd->stackframesize =
- sizeof(stackframeinfo) / SIZEOF_VOID_P +
- 4; /* 4 arguments or return value */
-
- /* create method header */
- (void) dseg_add_unique_address(cd, code); /* CodeinfoPointer */
- (void) dseg_add_unique_s4(cd, cd->stackframesize * 4); /* FrameSize */
- (void) dseg_add_unique_s4(cd, 0); /* IsSync */
- (void) dseg_add_unique_s4(cd, 0); /* IsLeaf */
- (void) dseg_add_unique_s4(cd, 0); /* IntSave */
- (void) dseg_add_unique_s4(cd, 0); /* FltSave */
- (void) dseg_addlinenumbertablesize(cd);
- (void) dseg_add_unique_s4(cd, 0); /* ExTableSize */
-
- /* generate stub code */
- M_AADD_IMM(-(cd->stackframesize*4), REG_SP);
-
-#if defined(ENABLE_GC_CACAO)
- /* Save callee saved integer registers in stackframeinfo (GC may
- need to recover them during a collection). */
-
- disp = cd->stackframesize * 4 - sizeof(stackframeinfo) +
- OFFSET(stackframeinfo, adrregs);
-
- for (i = 0; i < ADR_SAV_CNT; i++)
- M_AST(abi_registers_address_saved[i], REG_SP, disp + i * 4);
-#endif
-
- /* create dynamic stack info */
-
- M_AMOV(REG_SP, REG_ATMP1);
- M_AADD_IMM(cd->stackframesize * 4, REG_ATMP1);
- M_AST(REG_ATMP1, REG_SP, 0 * 4); /* datasp */
-
- M_AMOV_IMM(0, REG_ATMP1); /* we need pv patched in */
- dseg_adddata(cd); /* this does the trick */
- M_AST(REG_ATMP1, REG_SP, 1 * 4); /* pv */
-
- M_AMOV(REG_SP, REG_ATMP1);
- M_AADD_IMM(cd->stackframesize * 4 + SIZEOF_VOID_P, REG_ATMP1);
- M_AST(REG_ATMP1, REG_SP, 2 * 4); /* sp */
-
- M_ALD(REG_ATMP3, REG_SP, cd->stackframesize * 4);
- M_AST(REG_ATMP3, REG_SP, 3 * 4); /* ra */
-
- M_JSR_IMM(codegen_stub_builtin_enter);
-
- /* copy arguments into new stackframe */
-
- for (i = 0; i < md->paramcount; i++) {
- if (!md->params[i].inmemory) {
- log_text("No integer argument registers available!");
- assert(0);
-
- } else { /* float/double in memory can be copied like int/longs */
- s1 = md->params[i].regoff + cd->stackframesize * 4 + 4;
- s2 = md->params[i].regoff;
-
- M_ILD(REG_ITMP1, REG_SP, s1);
- M_IST(REG_ITMP1, REG_SP, s2);
- if (IS_2_WORD_TYPE(md->paramtypes[i].type)) {
- M_ILD(REG_ITMP1, REG_SP, s1 + 4);
- M_IST(REG_ITMP1, REG_SP, s2 + 4);
- }
-
- }
- }
-
- /* call the builtin function */
-
- M_AMOV_IMM(bte->fp, REG_ATMP3);
- M_JSR(REG_ATMP3);
-
- /* save return value */
- switch (md->returntype.type) {
- case TYPE_VOID: break;
-
- /* natives return float arguments in %d0, %d1, cacao expects them in %fp0 */
- case TYPE_DBL:
- case TYPE_LNG:
- M_IST(REG_D1, REG_SP, 2 * 4);
- /* fall through */
-
- case TYPE_FLT:
- case TYPE_INT:
- case TYPE_ADR:
- M_IST(REG_D0, REG_SP, 1 * 4);
- break;
-
- default: assert(0);
- }
-
- /* remove native stackframe info */
-
- M_AMOV(REG_SP, REG_ATMP1);
- M_AADD_IMM(cd->stackframesize * 4, REG_ATMP1);
- M_AST(REG_ATMP1, REG_SP, 0 * 4);
-
- M_JSR_IMM(codegen_stub_builtin_exit);
-
- /* restore return value */
- switch (md->returntype.type) {
- case TYPE_VOID: break;
-
- case TYPE_DBL:
- case TYPE_LNG:
- M_ILD(REG_D1, REG_SP, 2 * 4);
- /* fall through */
-
- case TYPE_FLT:
- case TYPE_INT:
- case TYPE_ADR:
- M_ILD(REG_D0, REG_SP, 1 * 4);
- break;
-
- default: assert(0);
- }
-
-#if defined(ENABLE_GC_CACAO)
- /* Restore callee saved integer registers from stackframeinfo (GC
- might have modified them during a collection). */
-
- disp = cd->stackframesize * 4 - sizeof(stackframeinfo) +
- OFFSET(stackframeinfo, adrregs);
-
- for (i = 0; i < ADR_SAV_CNT; i++)
- M_ALD(abi_registers_address_saved[i], REG_SP, disp + i * 4);
-#endif
-
- /* remove stackframe */
- M_AADD_IMM(cd->stackframesize * 4, REG_SP);
- M_RET;
-}
-
-
-
-
/* codegen_emit_stub_native ****************************************************
Emits a stub routine which calls a native method.
*******************************************************************************/
-void codegen_emit_stub_native(jitdata *jd, methoddesc *nmd, functionptr f)
+void codegen_emit_stub_native(jitdata *jd, methoddesc *nmd, functionptr f, int skipparams)
{
methodinfo *m;
codeinfo *code;
codegendata *cd;
registerdata *rd;
methoddesc *md;
- s4 nativeparams, i, j, t, s1, s2;
+ s4 i, j, t, s1, s2;
/* get required compiler data */
rd = jd->rd;
md = m->parseddesc;
- nativeparams = (m->flags & ACC_STATIC) ? 2 : 1;
/* calc stackframe size */
cd->stackframesize = sizeof(stackframeinfo) / SIZEOF_VOID_P +
M_ALD(REG_ATMP2, REG_SP, 4 * 4);
/* copy arguments into stackframe */
- for (i = md->paramcount -1, j = i + nativeparams; i >= 0; --i, --j) {
+ for (i = md->paramcount -1, j = i + skipparams; i >= 0; --i, --j) {
t = md->paramtypes[i].type;
/* all arguments via stack */
assert(md->params[i].inmemory);
#include "vm/vm.h"
#include "vm/exceptions.h"
#include "vm/jit/asmpart.h"
+#include "vm/signallocal.h"
#include <assert.h>
#include <stdlib.h>
-#include <signal.h>
+/*#include <signal.h>*/
#include <stdint.h>
#include <sys/ucontext.h> /* has br0ken ucontext_t*/
/* md_signal_handler_sigsegv ******************************************
*
- * Invoked when a Nullpointerexception occured, or when the cm
+ * Invoked when a Nullpointerexception occured, or when the vm
* crashes, hard to tell the difference.
**********************************************************************/
-void md_signal_handler_sigsegv(int sig, siginfo_t *siginfo, actual_ucontext_t *_uc)
+void md_signal_handler_sigsegv(int sig, siginfo_t *siginfo, void *_p)
{
uint32_t xpc, sp;
uint16_t opc;
uint32_t val, regval, off;
bool adrreg;
void *p;
- mcontext_t *_mc;
+ actual_mcontext_t *_mc;
+ actual_ucontext_t *_uc;
+
+ _uc = (actual_ucontext_t*)_p;
_mc = &_uc->uc_mcontext;
sp = _mc->gregs[R_SP];
xpc = _mc->gregs[R_PC];
/* Handle the type. */
- p = signal_handle(EXCEPTION_HARDWARE_NULLPOINTER, regval, NULL, sp, xpc, xpc, _p);
+ p = signal_handle(EXCEPTION_HARDWARE_NULLPOINTER, regval, NULL, (void*)sp, (void*)xpc, (void*)xpc, _p);
_mc->gregs[GREGS_ADRREG_OFF + REG_ATMP1] = (intptr_t) p;
_mc->gregs[GREGS_ADRREG_OFF + REG_ATMP2_XPC] = (intptr_t) xpc;
* been created directly before the trap instruction (2 bytes long).
* the last 3 bit of this tst instruction contain the register number.
**********************************************************************/
-void md_signal_handler_sigill(int sig, siginfo_t *siginfo, actual_ucontext_t *_uc)
+void md_signal_handler_sigill(int sig, siginfo_t *siginfo, void *_p)
{
uint32_t xpc, sp;
uint16_t opc;
uint32_t type;
uint32_t val, regval;
void *p;
- mcontext_t *_mc;
+ actual_mcontext_t *_mc;
+ actual_ucontext_t *_uc;
- xpc = siginfo->si_addr;
+ _uc = (actual_ucontext_t*)_p;
+ xpc = (uint32_t)siginfo->si_addr;
if (siginfo->si_code == ILL_ILLOPC) {
vm_abort("md_signal_handler_sigill: the illegal instruction @ 0x%x, aborting", xpc);
/* Handle the type. */
- p = signal_handle(type, val, NULL, sp, xpc, xpc, _p);
+ p = signal_handle(type, val, NULL, (void*)sp, (void*)xpc, (void*)xpc, _p);
_mc->gregs[GREGS_ADRREG_OFF + REG_ATMP1] = (intptr_t) p;
_mc->gregs[GREGS_ADRREG_OFF + REG_ATMP2_XPC] = (intptr_t) xpc;
#include "vm/jit/codegen-common.h"
#include "vm/jit/md.h"
-#include "offsets.h"
#include "vm/vm.h"
#include "vmcore/class.h"
#include "vmcore/linker.h"
*/
void md_init(void)
{
- assert(OFFSET(vftbl_t, baseval) == offbaseval);
- assert(OFFSET(vftbl_t, diffval) == offdiffval);
- assert(OFFSET(castinfo, super_baseval) == offcast_super_baseval);
- assert(OFFSET(castinfo, super_diffval) == offcast_super_diffval);
- assert(OFFSET(castinfo, sub_baseval) == offcast_sub_baseval);
-
-#if 0
-#if defined(ENABLE_REPLACEMENT)
- assert(sizeof(executionstate_t) = sizeexecutionstate);
- assert(OFFSET(executionstate_t, pc) == offes_pc);
- assert(OFFSET(executionstate_t, sp) == offes_sp);
- assert(OFFSET(executionstate_t, pv) == offes_pv);
- assert(OFFSET(executionstate_t, intregs) == offes_intregs);
- assert(OFFSET(executionstate_t, fltregs) == offes_fltregs);
-#endif
-#endif
-
#ifdef __LINUX__
md_init_linux();
#endif
/* we had a moveal XXX, %a3 which is a 3 word opcode */
/* 2679 0000 0000 */
assert(*(u2*)(pc - 8) == 0x2879); /* moveal */
- pa = *((u4*)(pc - 6)); /* another indirection ! */
+ pa = (void*)*((u4*)(pc - 6)); /* another indirection ! */
}
} else if (*((u2*)(pc - 2)) == 0x4e92) { /* jsr %a2@ */
if (*(u2*)(pc - 8) == 0x247c) {
#include "asm/cachectl.h" /* found more traces of the cacheflush function */
#include "errno.h"
-void md_cacheflush(u1 *addr, s4 nbytes) { cacheflush(addr, FLUSH_SCOPE_PAGE, FLUSH_CACHE_BOTH, nbytes); }
-void md_dcacheflush(u1 *addr, s4 nbytes) { cacheflush(addr, FLUSH_SCOPE_PAGE, FLUSH_CACHE_DATA, nbytes); }
-void md_icacheflush(u1* addr, s4 nbytes) { cacheflush(addr, FLUSH_SCOPE_LINE, FLUSH_CACHE_INSN, nbytes); }
+void md_cacheflush(u1 *addr, s4 nbytes) { cacheflush((unsigned long)addr, FLUSH_SCOPE_PAGE, FLUSH_CACHE_BOTH, nbytes); }
+void md_dcacheflush(u1 *addr, s4 nbytes) { cacheflush((unsigned long)addr, FLUSH_SCOPE_PAGE, FLUSH_CACHE_DATA, nbytes); }
+void md_icacheflush(u1* addr, s4 nbytes) { cacheflush((unsigned long)addr, FLUSH_SCOPE_LINE, FLUSH_CACHE_INSN, nbytes); }
/* md_stacktrace_get_returnaddress *********************************************
#include "vm/resolve.h"
#include "vm/jit/asmpart.h"
-#include "vm/jit/patcher.h"
+#include "vm/jit/patcher-common.h"
#include "vm/jit/md.h"
-#include "vm/jit/methodheader.h"
#include "vm/jit/stacktrace.h"
#include "vmcore/class.h"
*******************************************************************************/
+#if 0
java_objectheader *patcher_wrapper(u1 *sp, u1 *pv, u1 *ra)
{
stackframeinfo sfi;
return NULL;
}
+#endif
-/* Helper
- */
-static void patcher_patch_back(u1 *sp)
+
+#define PATCH_BACK_ORIGINAL_MCODE *((u8*)(pr->mpc)) = pr->mcode
+
+/* patcher_initialize_class ****************************************************
+
+ just patch back original code
+
+*******************************************************************************/
+
+
+void patcher_patch_code(patchref_t *pr)
{
+#if 0
u1* xpc = (u1 *) *((ptrint *) (sp + 6 * 4));
u4 mcode = *((u4*) (sp + 3 * 4));
u4 xmcode = *((u4*) (sp + 2 * 4));
*((u4*)(xpc)) = mcode;
*((u4*)(xpc+4)) = xmcode;
- md_icacheflush(xpc, 8);
+#endif
+
+ PATCH_BACK_ORIGINAL_MCODE;
+ md_icacheflush((void*)pr->mpc, 8);
+
}
+
+#if 0
/* patcher_initialize_class ****************************************************
Initalizes a given classinfo pointer. This function does not patch
*******************************************************************************/
-bool patcher_initialize_class(u1 *sp)
+bool patcher_initialize_class(patchref_t *pr)
{
classinfo *c;
u4 xpc, mcode, xmcode;
return true;
}
+#endif
/* patcher_invokevirtual *******************************************************
*******************************************************************************/
-bool patcher_invokevirtual(u1 *sp)
+bool patcher_invokevirtual(patchref_t *pr)
{
u1 *ra;
unresolved_method *um;
s2 disp;
/* get stuff from the stack */
- ra = (u1 *) *((ptrint *) (sp + 6 * 4));
- um = (unresolved_method *) *((ptrint *) (sp + 1 * 4));
+ ra = (u1 *) pr->mpc;
+ um = (unresolved_method *) pr->ref;
/* get the fieldinfo */
if (!(m = resolve_method_eager(um)))
return false;
/* patch back original code */
- patcher_patch_back(sp);
+ PATCH_BACK_ORIGINAL_MCODE;
/* if we show NOPs, we have to skip them */
if (opt_shownops) ra += PATCHER_CALL_SIZE;
******************************************************************************/
-bool patcher_invokestatic_special(u1 *sp)
+bool patcher_invokestatic_special(patchref_t *pr)
{
unresolved_method *um;
s4 disp;
methodinfo *m;
/* get stuff from the stack */
- disp = *((s4 *) (sp + 6 * 4));
- um = (unresolved_method *) *((ptrint *) (sp + 1 * 4));
+ disp = pr->mpc;
+ um = (unresolved_method *) pr->ref;
/* get the fieldinfo */
if (!(m = resolve_method_eager(um)))
return false;
/* patch back original code */
- patcher_patch_back(sp);
+ PATCH_BACK_ORIGINAL_MCODE;
/* patch stubroutine */
if (opt_shownops) disp += PATCHER_CALL_SIZE;
/* synchronize inst cache */
- md_icacheflush(disp+2, SIZEOF_VOID_P);
+ md_icacheflush((void*)(disp+2), SIZEOF_VOID_P);
return true;
}
+#if 0
/* patcher_resolve_class *******************************************************
Resolves a given unresolved_class pointer. This function does not
*******************************************************************************/
#ifdef ENABLE_VERIFIER
-bool patcher_resolve_class(u1 *sp)
+bool patcher_resolve_class(patchref_t *pr)
{
unresolved_class *uc;
classinfo *c;
return false;
/* patch back original code */
- patcher_patch_back(sp);
+ PATCH_BACK_ORIGINAL_MCODE;
return true;
}
#endif /* ENABLE_VERIFIER */
+#endif
+#if 0
/* patcher_resolve_classref_to_classinfo ***************************************
ACONST:
0x4028f2ca: 2479 0000 0000 moveal 0x00000000,%a2
*******************************************************************************/
-bool patcher_resolve_classref_to_classinfo(u1 *sp)
+bool patcher_resolve_classref_to_classinfo(patchref_t *pr)
{
constant_classref *cr;
s4 disp;
return false;
/* patch back original code */
- patcher_patch_back(sp);
+ PATCH_BACK_ORIGINAL_MCODE;
/* patch the classinfo pointer */
if (opt_shownops) disp += PATCHER_CALL_SIZE;
return true;
}
+#endif
/* patcher_get_putstatic *******************************************************
*******************************************************************************/
-bool patcher_get_putstatic(u1 *sp)
+bool patcher_get_putstatic(patchref_t *pr)
{
- u1 *ra;
unresolved_field *uf;
s4 disp;
- u1 *pv;
fieldinfo *fi;
/* get stuff from the stack */
- uf = (unresolved_field *) *((ptrint *) (sp + 1 * 4));
- disp = *((s4 *) (sp + 6 * 4));
+ uf = (unresolved_field *) pr->ref;
+ disp = pr->mpc;
/* get the fieldinfo */
if (!(fi = resolve_field_eager(uf)))
return false;
/* patch back original code */
- patcher_patch_back(sp);
+ PATCH_BACK_ORIGINAL_MCODE;
/* patch the field value's address */
if (opt_shownops) disp += PATCHER_CALL_SIZE;
*((intptr_t *) (disp+2)) = (intptr_t) fi->value;
/* synchronize inst cache */
- md_icacheflush(disp+2, SIZEOF_VOID_P);
+ md_icacheflush((void*)(disp+2), SIZEOF_VOID_P);
return true;
}
*******************************************************************************/
-bool patcher_get_putfield(u1 *sp)
+bool patcher_get_putfield(patchref_t *pr)
{
u1 *ra;
unresolved_field *uf;
fieldinfo *fi;
- s2 disp;
- ra = (u1 *) *((ptrint *) (sp + 6 * 4));
- uf = (unresolved_field *) *((ptrint *) (sp + 1 * 4));
+ ra = (u1 *) pr->mpc;
+ uf = (unresolved_field *) pr->ref;
/* get the fieldinfo */
if (!(fi = resolve_field_eager(uf)))
return false;
/* patch back original code */
- patcher_patch_back(sp);
+ PATCH_BACK_ORIGINAL_MCODE;
/* if we show NOPs, we have to skip them */
if (opt_shownops) ra += PATCHER_CALL_SIZE;
*******************************************************************************/
-bool patcher_resolve_classref_to_flags(u1 *sp)
+bool patcher_resolve_classref_to_flags(patchref_t *pr)
{
constant_classref *cr;
s4 disp;
classinfo *c;
/* get stuff from the stack */
- cr = (constant_classref *) *((ptrint *) (sp + 1 * 4));
- disp = *((s4 *) (sp + 6 * 4));
+ cr = (constant_classref *) pr->ref;
+ disp = pr->mpc;
/* get the fieldinfo */
if (!(c = resolve_classref_eager(cr)))
return false;
/* patch back original code */
- patcher_patch_back(sp);
+ PATCH_BACK_ORIGINAL_MCODE;
/* patch class flags */
if (opt_shownops) disp += PATCHER_CALL_SIZE;
*((s4 *) (disp + 2)) = (s4) c->flags;
/* synchronize insn cache */
- md_icacheflush(disp + 2, SIZEOF_VOID_P);
+ md_icacheflush((void*)(disp + 2), SIZEOF_VOID_P);
return true;
}
*******************************************************************************/
-bool patcher_resolve_classref_to_vftbl(u1 *sp)
+bool patcher_resolve_classref_to_vftbl(patchref_t *pr)
{
constant_classref *cr;
s4 disp;
classinfo *c;
/* get stuff from the stack */
- cr = (constant_classref *) *((ptrint *) (sp + 1 * 4));
- disp = *((s4 *) (sp + 6 * 4));
+ cr = (constant_classref *) pr->ref;
+ disp = pr->mpc;
/* get the fieldinfo */
if (!(c = resolve_classref_eager(cr)))
return false;
/* patch back original code */
- patcher_patch_back(sp);
+ PATCH_BACK_ORIGINAL_MCODE;
/* patch super class' vftbl */
if (opt_shownops) disp += PATCHER_CALL_SIZE;
*((s4 *) (disp+2)) = (s4) c->vftbl;
/* synchronize insin cache */
- md_icacheflush(disp+2, SIZEOF_VOID_P);
+ md_icacheflush((void*)(disp+2), SIZEOF_VOID_P);
return true;
}
*******************************************************************************/
-bool patcher_instanceof_interface(u1 *sp)
+bool patcher_instanceof_interface(patchref_t *pr)
{
u1 *ra;
constant_classref *cr;
/* get stuff from the stack */
- ra = (u1 *) *((ptrint *) (sp + 6 * 4));
- cr = (constant_classref *) *((ptrint *) (sp + 1 * 4));
+ ra = (u1 *) pr->mpc;
+ cr = (constant_classref *) pr->ref;
/* get the fieldinfo */
if (!(c = resolve_classref_eager(cr)))
return false;
/* patch back original code */
- patcher_patch_back(sp);
+ PATCH_BACK_ORIGINAL_MCODE;
/* if we show NOPs, we have to skip them */
if (opt_shownops) ra += PATCHER_CALL_SIZE;
*((s2 *) (ra + 20)) = disp;
/* synchronize instruction cache */
- md_icacheflush(ra + 10, 12);
+ md_icacheflush((void*)(ra + 10), 12);
return true;
}
*******************************************************************************/
-bool patcher_checkcast_interface(u1 *sp)
+bool patcher_checkcast_interface(patchref_t *pr)
{
u1 *ra;
constant_classref *cr;
s4 disp;
/* get stuff from the stack */
- ra = (u1 *) *((ptrint *) (sp + 6 * 4));
- cr = (constant_classref *) *((ptrint *) (sp + 1 * 4));
+ ra = (u1 *) pr->mpc;
+ cr = (constant_classref *) pr->ref;
/* get the fieldinfo */
if (!(c = resolve_classref_eager(cr)))
return false;
/* patch back original code */
- patcher_patch_back(sp);
+ PATCH_BACK_ORIGINAL_MCODE;
/* if we show NOPs, we have to skip them */
if (opt_shownops) ra += PATCHER_CALL_SIZE;
*((s2 *) (ra + 24)) = disp;
/* synchronize instruction cache */
- md_icacheflush(ra + 10, 16);
+ md_icacheflush((void*)(ra + 10), 16);
return true;
}
+#if 0
/* patcher_resolve_native_function *********************************************
XXX
*******************************************************************************/
-bool patcher_resolve_native_function(u1 *sp)
+bool patcher_resolve_native_function(patchref_t *pr)
{
methodinfo *m;
s4 disp;
functionptr f;
/* get stuff from the stack */
- m = (methodinfo *) *((ptrint *) (sp + 1 * 4));
- disp = *((s4 *) (sp + 6 * 4));
+ m = (methodinfo *) pr->ref;
+ disp = pr->mpc;
/* resolve native function */
if (!(f = native_resolve_function(m)))
return false;
/* patch back original code */
- patcher_patch_back(sp);
+ PATCH_BACK_ORIGINAL_MCODE;
/* patch native function pointer */
if (opt_shownops) disp += PATCHER_CALL_SIZE;
*((ptrint *) (disp + 2)) = (ptrint) f;
/* synchronize data cache */
- md_icacheflush(disp + 2, SIZEOF_VOID_P);
+ md_icacheflush((void*)(disp + 2), SIZEOF_VOID_P);
return true;
}
-
+#endif
/* patcher_invokeinterface *****************************************************
*******************************************************************************/
-bool patcher_invokeinterface(u1 *sp)
+bool patcher_invokeinterface(patchref_t *pr)
{
u1 *ra;
unresolved_method *um;
s4 disp;
/* get stuff from the stack */
- ra = (u1 *) *((ptrint *) (sp + 6 * 4));
- um = (unresolved_method *) *((ptrint *) (sp + 1 * 4));
+ ra = (u1 *) pr->mpc;
+ um = (unresolved_method *) pr->ref;
/* get the fieldinfo */
return false;
/* patch back original code */
- patcher_patch_back(sp);
+ PATCH_BACK_ORIGINAL_MCODE;
/* if we show NOPs, we have to skip them */
if (opt_shownops) ra += PATCHER_CALL_SIZE;
*((uint16_t *) (ra + 7 * 2)) = disp;
/* synchronize instruction cache */
- md_icacheflush(ra + 5 * 2, 2 * 2);
+ md_icacheflush((void*)(ra + 5 * 2), 2 * 2);
return true;
}
/* patcher prototypes and macros **********************************************/
-#if defined(__ALPHA__) || defined(__ARM__) || defined(__I386__) || defined(__MIPS__) || defined(__POWERPC__) || defined(__POWERPC64__) || defined (__S390__) || defined(__X86_64__)
+#if defined(__ALPHA__) || defined(__ARM__) || defined(__I386__) || defined(__MIPS__) || defined(__POWERPC__) || defined(__POWERPC64__) || defined (__S390__) || defined(__X86_64__) || defined(__M68K__)
/* new patcher functions */