M_ILD32 and M_LLD32 macros.
(patcher): Save REG_ITMP3. Don't allocate a codegendata structure,
just do it as on Alpha.
* src/vm/jit/i386/codegen.h (var_to_reg_lng): Added.
(store_reg_to_var_lng): Likewise.
(M_ILD32, M_LLD, M_LLD32, M_IST32, M_IST32_IMM, M_LST, M_LST32)
(M_LST_IMM, M_LST32_IMM): Likewise.
* src/vm/jit/i386/patcher.c: Changed position of return address due to
saving of REG_ITMP3.
* src/vm/jit/i386/asmpart.S (asm_wrapper_patcher): Changed due to
saving of REG_ITMP3.
Changes: Joseph Wenninger
Edwin Steiner
- $Id: asmpart.S 4606 2006-03-15 04:43:25Z edwin $
+ $Id: asmpart.S 4611 2006-03-15 11:18:30Z twisti $
*/
XXX
Stack layout:
- 20 return address
+ 24 return address
+ 20 REG_ITMP3
16 pointer to virtual java_objectheader
12 last byte of machine code (xmcode)
8 machine code (which is patched back later)
mov itmp1,0*4(sp) /* stackframeinfo pointer */
movl $0,1*4(sp) /* if pv is NULL, use findmethod */
mov sp,itmp2
- add $((6+2+4)*4+sizestackframeinfo),itmp2
+ add $((7+2+4)*4+sizestackframeinfo),itmp2
mov itmp2,2*4(sp) /* pass Java sp */
- mov ((5+2+4)*4+sizestackframeinfo)(sp),itmp3
+ mov ((6+2+4)*4+sizestackframeinfo)(sp),itmp3
mov itmp3,3*4(sp) /* pass ra to java function */
call stacktrace_create_inline_stackframeinfo
mov itmp1,0*4(sp) /* stackframeinfo pointer */
call stacktrace_remove_stackframeinfo
- mov (0+4)*4(sp),itmp1 /* restore itmp1 and itmp2 */
- mov (1+4)*4(sp),itmp2 /* may be used by some instructions */
mov 1*4(sp),itmp3 /* restore return value */
-
- add $((5+2+4)*4+sizestackframeinfo),sp /* remove stack frame, keep ra */
test itmp3,itmp3 /* exception thrown? */
jz L_asm_wrapper_patcher_exception
+
+ mov (0+4)*4(sp),itmp1 /* restore itmp1 and itmp2 */
+ mov (1+4)*4(sp),itmp2 /* may be used by some instructions */
+ mov ((5+2+4)*4+sizestackframeinfo)(sp),itmp3
+ add $((6+2+4)*4+sizestackframeinfo),sp /* remove stack frame, keep ra */
+
ret /* call new patched code */
L_asm_wrapper_patcher_exception:
+ add $((6+2+4)*4+sizestackframeinfo),sp /* remove stack frame, keep ra */
+
#if defined(USE_THREADS) && defined(NATIVE_THREADS)
call builtin_asm_get_exceptionptrptr
mov v0,itmp2
Christian Ullrich
Edwin Steiner
- $Id: codegen.c 4606 2006-03-15 04:43:25Z edwin $
+ $Id: codegen.c 4611 2006-03-15 11:18:30Z twisti $
*/
case TYPE_INT:
case TYPE_ADR:
d = reg_of_var(rd, iptr->dst, REG_ITMP2);
- i386_mov_membase32_reg(cd, s1, disp, d);
+ M_ILD32(d, s1, disp);
store_reg_to_var_int(iptr->dst, d);
break;
case TYPE_LNG:
- d = reg_of_var(rd, iptr->dst, REG_NULL);
- i386_mov_membase32_reg(cd, s1, disp, REG_ITMP2);
- i386_mov_membase32_reg(cd, s1, disp + 4, REG_ITMP3);
- i386_mov_reg_membase(cd, REG_ITMP2, REG_SP, iptr->dst->regoff * 4);
- i386_mov_reg_membase(cd, REG_ITMP3, REG_SP, iptr->dst->regoff * 4 + 4);
+ d = reg_of_var(rd, iptr->dst, PACK_REGS(REG_ITMP2, REG_ITMP3));
+ M_LLD32(d, s1, disp);
+ store_reg_to_var_lng(iptr->dst, d);
break;
case TYPE_FLT:
d = reg_of_var(rd, iptr->dst, REG_FTMP1);
var_to_reg_int(s1, src->prev, REG_ITMP1);
gen_nullptr_check(s1);
- if ((iptr->op1 == TYPE_INT) || IS_ADR_TYPE(iptr->op1)) {
- var_to_reg_int(s2, src, REG_ITMP2);
- } else if (IS_FLT_DBL_TYPE(iptr->op1)) {
+ /* must be done here because of code patching */
+
+ if (!IS_FLT_DBL_TYPE(iptr->op1)) {
+ if (IS_2_WORD_TYPE(iptr->op1))
+ var_to_reg_lng(s2, src, PACK_REGS(REG_ITMP2, REG_ITMP3));
+ else
+ var_to_reg_int(s2, src, REG_ITMP2);
+ } else
var_to_reg_flt(s2, src, REG_FTMP2);
- }
if (iptr->val.a == NULL) {
codegen_addpatchref(cd, cd->mcodeptr,
switch (iptr->op1) {
case TYPE_INT:
case TYPE_ADR:
- i386_mov_reg_membase32(cd, s2, s1, disp);
+ M_IST32(s2, s1, disp);
break;
case TYPE_LNG:
- if (src->flags & INMEMORY) {
- i386_mov_membase32_reg(cd, REG_SP, src->regoff * 4, REG_ITMP2);
- i386_mov_membase32_reg(cd, REG_SP, src->regoff * 4 + 4, REG_ITMP3);
- i386_mov_reg_membase32(cd, REG_ITMP2, s1, disp);
- i386_mov_reg_membase32(cd, REG_ITMP3, s1, disp + 4);
- } else {
- log_text("PUTFIELD: longs have to be in memory");
- assert(0);
- }
+ M_LST32(s2, s1, disp);
break;
case TYPE_FLT:
i386_fstps_membase32(cd, s1, disp);
case TYPE_INT:
case TYPE_FLT:
case TYPE_ADR:
- i386_mov_imm_membase32(cd, iptr->val.i, s1, disp);
+ M_IST32_IMM(iptr->val.i, s1, disp);
break;
case TYPE_LNG:
case TYPE_DBL:
- i386_mov_imm_membase32(cd, iptr->val.l, s1, disp);
- i386_mov_imm_membase32(cd, iptr->val.l >> 32, s1, disp + 4);
+ M_LST32_IMM(iptr->val.l, s1, disp);
break;
}
break;
/* REG_RES Register usage: see icmd_uses_reg_res.inc */
/* EAX: YES ECX: YES EDX: YES OUTPUT: REG_NULL*/
- i386_call_imm(cd, 0);
+ M_CALL_IMM(0);
codegen_addreference(cd, (basicblock *) iptr->target, cd->mcodeptr);
break;
/* generate code patching stub call code */
{
- patchref *pref;
- codegendata *tmpcd;
- u8 mcode;
-
- tmpcd = DNEW(codegendata);
+ patchref *pref;
+ u8 mcode;
+ u1 *tmpmcodeptr;
for (pref = cd->patchrefs; pref != NULL; pref = pref->next) {
/* check code segment size */
MCODECHECK(512);
- /* Get machine code which is patched back in later. A */
- /* `call rel32' is 5 bytes long. */
+ /* Get machine code which is patched back in later. A
+ `call rel32' is 5 bytes long. */
xcodeptr = cd->mcodebase + pref->branchpos;
mcode = *((u8 *) xcodeptr);
- /* patch in `call rel32' to call the following code */
+ /* patch in `call rel32' to call the following code */
+
+ tmpmcodeptr = cd->mcodeptr; /* save current mcodeptr */
+ cd->mcodeptr = xcodeptr; /* set mcodeptr to patch position */
- tmpcd->mcodeptr = xcodeptr; /* set dummy mcode pointer */
- i386_call_imm(tmpcd, cd->mcodeptr - (xcodeptr + 5));
+ M_CALL_IMM(tmpmcodeptr - (xcodeptr + PATCHER_CALL_SIZE));
+
+ cd->mcodeptr = tmpmcodeptr; /* restore the current mcodeptr */
+
+ /* save REG_ITMP3 */
+
+ M_PUSH(REG_ITMP3);
/* move pointer to java_objectheader onto stack */
/* process patcher calls **************************************************/
{
- u1 *xcodeptr;
- patchref *pref;
- codegendata *tmpcd;
- u8 mcode;
-
- tmpcd = DNEW(codegendata);
+ u1 *xcodeptr;
+ patchref *pref;
+ u8 mcode;
+ u1 *tmpmcodeptr;
for (pref = cd->patchrefs; pref != NULL; pref = pref->next) {
- /* Get machine code which is patched back in later. A */
- /* `call rel32' is 5 bytes long. */
+ /* Get machine code which is patched back in later. A
+ `call rel32' is 5 bytes long. */
xcodeptr = cd->mcodebase + pref->branchpos;
mcode = *((u8 *) xcodeptr);
- /* patch in `call rel32' to call the following code */
+ /* patch in `call rel32' to call the following code */
- tmpcd->mcodeptr = xcodeptr; /* set dummy mcode pointer */
- i386_call_imm(tmpcd, cd->mcodeptr - (xcodeptr + 5));
+ tmpmcodeptr = cd->mcodeptr; /* save current mcodeptr */
+ cd->mcodeptr = xcodeptr; /* set mcodeptr to patch position */
+
+ M_CALL_IMM(tmpmcodeptr - (xcodeptr + PATCHER_CALL_SIZE));
+
+ cd->mcodeptr = tmpmcodeptr; /* restore the current mcodeptr */
+
+ /* save REG_ITMP3 */
+
+ M_PUSH(REG_ITMP3);
/* move pointer to java_objectheader onto stack */
Changes:
- $Id: codegen.h 4389 2006-01-30 16:25:20Z twisti $
+ $Id: codegen.h 4611 2006-03-15 11:18:30Z twisti $
*/
*/
#define var_to_reg_int(regnr,v,tempnr) \
- if ((v)->flags & INMEMORY) { \
- COUNT_SPILLS; \
- i386_mov_membase_reg(cd, REG_SP, (v)->regoff * 4, tempnr); \
- regnr = tempnr; \
- } else { \
- regnr = (v)->regoff; \
- }
-
+ do { \
+ if ((v)->flags & INMEMORY) { \
+ COUNT_SPILLS; \
+ M_ILD(tempnr, REG_SP, (v)->regoff * 4); \
+ regnr = tempnr; \
+ } else { \
+ regnr = (v)->regoff; \
+ } \
+ } while (0)
+#define var_to_reg_lng(regnr,v,tempnr) \
+ do { \
+ if ((v)->flags & INMEMORY) { \
+ COUNT_SPILLS; \
+ M_LLD(tempnr, REG_SP, (v)->regoff * 4); \
+ regnr = tempnr; \
+ } else { \
+ regnr = (v)->regoff; \
+ } \
+ } while (0)
#define var_to_reg_flt(regnr,v,tempnr) \
if ((v)->type == TYPE_FLT) { \
#define store_reg_to_var_int(sptr, tempregnum) \
if ((sptr)->flags & INMEMORY) { \
COUNT_SPILLS; \
- i386_mov_reg_membase(cd, tempregnum, REG_SP, (sptr)->regoff * 4); \
+ M_IST(tempregnum, REG_SP, (sptr)->regoff * 4); \
+ }
+
+
+#define store_reg_to_var_lng(sptr, tempregnum) \
+ if ((sptr)->flags & INMEMORY) { \
+ COUNT_SPILLS; \
+ M_LST(tempregnum, REG_SP, (sptr)->regoff * 4); \
}
#define M_ILD(a,b,disp) i386_mov_membase_reg(cd, (b), (disp), (a))
#define M_ALD(a,b,disp) M_ILD(a,b,disp)
+#define M_ILD32(a,b,disp) i386_mov_membase32_reg(cd, (b), (disp), (a))
+
+#define M_LLD(a,b,disp) \
+ do { \
+ M_ILD(GET_LOW_REG(a),b,disp); \
+ M_ILD(GET_HIGH_REG(a),b,disp + 4); \
+ } while (0)
+
+#define M_LLD32(a,b,disp) \
+ do { \
+ M_ILD32(GET_LOW_REG(a),b,disp); \
+ M_ILD32(GET_HIGH_REG(a),b,disp + 4); \
+ } while (0)
+
#define M_IST(a,b,disp) i386_mov_reg_membase(cd, (a), (b), (disp))
#define M_IST_IMM(a,b,disp) i386_mov_imm_membase(cd, (a), (b), (disp))
#define M_AST(a,b,disp) M_IST(a,b,disp)
#define M_AST_IMM(a,b,disp) M_IST_IMM(a,b,disp)
+#define M_IST32(a,b,disp) i386_mov_reg_membase32(cd, (a), (b), (disp))
+#define M_IST32_IMM(a,b,disp) i386_mov_imm_membase32(cd, (a), (b), (disp))
+
+#define M_LST(a,b,disp) \
+ do { \
+ M_IST(GET_LOW_REG(a),b,disp); \
+ M_IST(GET_HIGH_REG(a),b,disp + 4); \
+ } while (0)
+
+#define M_LST32(a,b,disp) \
+ do { \
+ M_IST32(GET_LOW_REG(a),b,disp); \
+ M_IST32(GET_HIGH_REG(a),b,disp + 4); \
+ } while (0)
+
+#define M_LST_IMM(a,b,disp) \
+ do { \
+ M_IST_IMM(a,b,disp); \
+ M_IST_IMM(a >> 32,b,disp + 4); \
+ } while (0)
+
+#define M_LST32_IMM(a,b,disp) \
+ do { \
+ M_IST32_IMM(a,b,disp); \
+ M_IST32_IMM(a >> 32,b,disp + 4); \
+ } while (0)
+
#define M_IADD_IMM(a,b) i386_alu_imm_reg(cd, ALU_ADD, (a), (b))
#define M_IADD_IMM32(a,b) i386_alu_imm32_reg(cd, ALU_ADD, (a), (b))
#define M_ISUB_IMM(a,b) i386_alu_imm_reg(cd, ALU_SUB, (a), (b))
Changes:
- $Id: patcher.c 4530 2006-02-21 09:11:53Z twisti $
+ $Id: patcher.c 4611 2006-03-15 11:18:30Z twisti $
*/
#include "vm/resolve.h"
#include "vm/references.h"
#include "vm/jit/patcher.h"
+#include "vm/jit/i386/codegen.h"
/* patcher_get_putstatic *******************************************************
/* get stuff from the stack */
- ra = (u1 *) *((ptrint *) (sp + 4 * 4));
+ ra = (u1 *) *((ptrint *) (sp + 5 * 4));
o = (java_objectheader *) *((ptrint *) (sp + 3 * 4));
mcode = *((u8 *) (sp + 1 * 4));
uf = (unresolved_field *) *((ptrint *) (sp + 0 * 4));
/* calculate and set the new return address */
- ra = ra - 5;
- *((ptrint *) (sp + 4 * 4)) = (ptrint) ra;
+ ra = ra - PATCHER_CALL_SIZE;
+ *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
PATCHER_MONITORENTER;
/* get stuff from the stack */
- ra = (u1 *) *((ptrint *) (sp + 4 * 4));
+ ra = (u1 *) *((ptrint *) (sp + 5 * 4));
o = (java_objectheader *) *((ptrint *) (sp + 3 * 4));
mcode = *((u8 *) (sp + 1 * 4));
uf = (unresolved_field *) *((ptrint *) (sp + 0 * 4));
/* calculate and set the new return address */
- ra = ra - 5;
- *((ptrint *) (sp + 4 * 4)) = (ptrint) ra;
+ ra = ra - PATCHER_CALL_SIZE;
+ *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
PATCHER_MONITORENTER;
/* get stuff from the stack */
- ra = (u1 *) *((ptrint *) (sp + 4 * 4));
+ ra = (u1 *) *((ptrint *) (sp + 5 * 4));
o = (java_objectheader *) *((ptrint *) (sp + 3 * 4));
mcode = *((u8 *) (sp + 1 * 4));
uf = (unresolved_field *) *((ptrint *) (sp + 0 * 4));
/* calculate and set the new return address */
- ra = ra - 5;
- *((ptrint *) (sp + 4 * 4)) = (ptrint) ra;
+ ra = ra - PATCHER_CALL_SIZE;
+ *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
PATCHER_MONITORENTER;
*((u4 *) (ra + 2)) = (u4) (fi->offset);
} else {
- /* long code is very special:
+ /* The long code is special:
*
- * 8b 8c 24 00 00 00 00 mov 0x00000000(%esp),%ecx
- * 8b 94 24 00 00 00 00 mov 0x00000000(%esp),%edx
* 89 8d 00 00 00 00 mov %ecx,0x00000000(%ebp)
* 89 95 00 00 00 00 mov %edx,0x00000000(%ebp)
*/
- *((u4 *) (ra + 7 + 7 + 2)) = (u4) (fi->offset);
- *((u4 *) (ra + 7 + 7 + 6 + 2)) = (u4) (fi->offset + 4);
+ *((u4 *) (ra + 2)) = (u4) (fi->offset);
+ *((u4 *) (ra + 6 + 2)) = (u4) (fi->offset + 4);
}
PATCHER_MARK_PATCHED_MONITOREXIT;
/* get stuff from the stack */
- ra = (u1 *) *((ptrint *) (sp + 4 * 4));
+ ra = (u1 *) *((ptrint *) (sp + 5 * 4));
o = (java_objectheader *) *((ptrint *) (sp + 3 * 4));
mcode = *((u8 *) (sp + 1 * 4));
uf = (unresolved_field *) *((ptrint *) (sp + 0 * 4));
/* calculate and set the new return address */
- ra = ra - 5;
- *((ptrint *) (sp + 4 * 4)) = (ptrint) ra;
+ ra = ra - PATCHER_CALL_SIZE;
+ *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
PATCHER_MONITORENTER;
/* get stuff from the stack */
- ra = (u1 *) *((ptrint *) (sp + 4 * 4));
+ ra = (u1 *) *((ptrint *) (sp + 5 * 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 - 5;
- *((ptrint *) (sp + 4 * 4)) = (ptrint) ra;
+ ra = ra - PATCHER_CALL_SIZE;
+ *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
PATCHER_MONITORENTER;
/* get stuff from the stack */
- ra = (u1 *) *((ptrint *) (sp + 4 * 4));
+ ra = (u1 *) *((ptrint *) (sp + 5 * 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 - 5;
- *((ptrint *) (sp + 4 * 4)) = (ptrint) ra;
+ ra = ra - PATCHER_CALL_SIZE;
+ *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
PATCHER_MONITORENTER;
/* get stuff from the stack */
- ra = (u1 *) *((ptrint *) (sp + 4 * 4));
+ ra = (u1 *) *((ptrint *) (sp + 5 * 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 - 5;
- *((ptrint *) (sp + 4 * 4)) = (ptrint) ra;
+ ra = ra - PATCHER_CALL_SIZE;
+ *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
PATCHER_MONITORENTER;
/* get stuff from the stack */
- ra = (u1 *) *((ptrint *) (sp + 4 * 4));
+ ra = (u1 *) *((ptrint *) (sp + 5 * 4));
o = (java_objectheader *) *((ptrint *) (sp + 3 * 4));
mcode = *((u8 *) (sp + 1 * 4));
um = (unresolved_method *) *((ptrint *) (sp + 0 * 4));
/* calculate and set the new return address */
- ra = ra - 5;
- *((ptrint *) (sp + 4 * 4)) = (ptrint) ra;
+ ra = ra - PATCHER_CALL_SIZE;
+ *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
PATCHER_MONITORENTER;
/* get stuff from the stack */
- ra = (u1 *) *((ptrint *) (sp + 4 * 4));
+ ra = (u1 *) *((ptrint *) (sp + 5 * 4));
o = (java_objectheader *) *((ptrint *) (sp + 3 * 4));
mcode = *((u8 *) (sp + 1 * 4));
um = (unresolved_method *) *((ptrint *) (sp + 0 * 4));
/* calculate and set the new return address */
- ra = ra - 5;
- *((ptrint *) (sp + 4 * 4)) = (ptrint) ra;
+ ra = ra - PATCHER_CALL_SIZE;
+ *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
PATCHER_MONITORENTER;
/* get stuff from the stack */
- ra = (u1 *) *((ptrint *) (sp + 4 * 4));
+ ra = (u1 *) *((ptrint *) (sp + 5 * 4));
o = (java_objectheader *) *((ptrint *) (sp + 3 * 4));
mcode = *((u8 *) (sp + 1 * 4));
um = (unresolved_method *) *((ptrint *) (sp + 0 * 4));
/* calculate and set the new return address */
- ra = ra - 5;
- *((ptrint *) (sp + 4 * 4)) = (ptrint) ra;
+ ra = ra - PATCHER_CALL_SIZE;
+ *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
PATCHER_MONITORENTER;
/* get stuff from the stack */
- ra = (u1 *) *((ptrint *) (sp + 4 * 4));
+ ra = (u1 *) *((ptrint *) (sp + 5 * 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 - 5;
- *((ptrint *) (sp + 4 * 4)) = (ptrint) ra;
+ ra = ra - PATCHER_CALL_SIZE;
+ *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
PATCHER_MONITORENTER;
/* get stuff from the stack */
- ra = (u1 *) *((ptrint *) (sp + 4 * 4));
+ ra = (u1 *) *((ptrint *) (sp + 5 * 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 - 5;
- *((ptrint *) (sp + 4 * 4)) = (ptrint) ra;
+ ra = ra - PATCHER_CALL_SIZE;
+ *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
PATCHER_MONITORENTER;
/* get stuff from the stack */
- ra = (u1 *) *((ptrint *) (sp + 4 * 4));
+ ra = (u1 *) *((ptrint *) (sp + 5 * 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 - 5;
- *((ptrint *) (sp + 4 * 4)) = (ptrint) ra;
+ ra = ra - PATCHER_CALL_SIZE;
+ *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
PATCHER_MONITORENTER;
/* get stuff from the stack */
- ra = (u1 *) *((ptrint *) (sp + 4 * 4));
+ ra = (u1 *) *((ptrint *) (sp + 5 * 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 - 5;
- *((ptrint *) (sp + 4 * 4)) = (ptrint) ra;
+ ra = ra - PATCHER_CALL_SIZE;
+ *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
PATCHER_MONITORENTER;
/* get stuff from the stack */
- ra = (u1 *) *((ptrint *) (sp + 4 * 4));
+ ra = (u1 *) *((ptrint *) (sp + 5 * 4));
o = (java_objectheader *) *((ptrint *) (sp + 3 * 4));
mcode = *((u8 *) (sp + 1 * 4));
c = (classinfo *) *((ptrint *) (sp + 0 * 4));
/* calculate and set the new return address */
- ra = ra - 5;
- *((ptrint *) (sp + 4 * 4)) = (ptrint) ra;
+ ra = ra - PATCHER_CALL_SIZE;
+ *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
PATCHER_MONITORENTER;
/* get stuff from the stack */
- ra = (u1 *) *((ptrint *) (sp + 4 * 4));
+ ra = (u1 *) *((ptrint *) (sp + 5 * 4));
o = (java_objectheader *) *((ptrint *) (sp + 3 * 4));
mcode = *((u8 *) (sp + 1 * 4));
uc = (unresolved_class *) *((ptrint *) (sp + 0 * 4));
/* calculate and set the new return address */
- ra = ra - 5;
- *((ptrint *) (sp + 4 * 4)) = (ptrint) ra;
+ ra = ra - PATCHER_CALL_SIZE;
+ *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
PATCHER_MONITORENTER;
/* get stuff from the stack */
- ra = (u1 *) *((ptrint *) (sp + 4 * 4));
+ ra = (u1 *) *((ptrint *) (sp + 5 * 4));
o = (java_objectheader *) *((ptrint *) (sp + 3 * 4));
mcode = *((u8 *) (sp + 1 * 4));
m = (methodinfo *) *((ptrint *) (sp + 0 * 4));
/* calculate and set the new return address */
- ra = ra - 5;
- *((ptrint *) (sp + 4 * 4)) = (ptrint) ra;
+ ra = ra - PATCHER_CALL_SIZE;
+ *((ptrint *) (sp + 5 * 4)) = (ptrint) ra;
PATCHER_MONITORENTER;