codegen_resolve_branchrefs, removed patcher NOP generation, renamed
codegen_addpatchref to codegen_add_patch_ref.
(createnativestub): Likewise.
* src/vm/jit/x86_64/codegen.h (PATCHER_NOPS): Defined.
* src/vm/jit/x86_64/patcher.c (patcher_get_putstatic): Use
opt_shownops instead of opt_showdisassemble.
(patcher_get_putfield): Likewise.
(patcher_putfieldconst): Likewise.
(patcher_aconst): Likewise.
(patcher_builtin_multianewarray): Likewise.
(patcher_builtin_arraycheckcast): Likewise.
(patcher_invokestatic_special): Likewise.
(patcher_invokeinterface): Likewise.
(patcher_checkcast_instanceof_flags): Likewise.
(patcher_checkcast_instanceof_interface): Likewise.
(patcher_checkcast_class): Likewise.
(patcher_instanceof_class): Likewise.
(patcher_resolve_native): Likewise.
Authors: Andreas Krall
Christian Thalinger
Authors: Andreas Krall
Christian Thalinger
-
- Changes: Christian Ullrich
- $Id: codegen.c 5839 2006-10-26 11:57:16Z twisti $
+ $Id: codegen.c 5945 2006-11-10 16:41:12Z twisti $
basicblock *bptr;
instruction *iptr;
exception_entry *ex;
basicblock *bptr;
instruction *iptr;
exception_entry *ex;
+ constant_classref *cr;
+ unresolved_class *uc;
methodinfo *lm; /* local methodinfo for ICMD_INVOKE* */
unresolved_method *um;
builtintable_entry *bte;
methodinfo *lm; /* local methodinfo for ICMD_INVOKE* */
unresolved_method *um;
builtintable_entry *bte;
if (bptr->flags >= BBREACHED) {
if (bptr->flags >= BBREACHED) {
- branchref *bref;
- for (bref = bptr->branchrefs; bref != NULL; bref = bref->next) {
- gen_resolvebranch((u1 *) cd->mcodebase + bref->branchpos,
- bref->branchpos,
- bptr->mpc);
- }
+ codegen_resolve_branchrefs(cd, bptr);
/* handle replacement points */
/* handle replacement points */
MCODECHECK(1024); /* 1KB should be enough */
MCODECHECK(1024); /* 1KB should be enough */
- switch (iptr->opc) {
- case ICMD_INLINE_START: /* internal ICMDs */
- case ICMD_INLINE_END:
- break;
-
- case ICMD_NOP: /* ... ==> ... */
- break;
+ switch (iptr->opc) {
+ case ICMD_NOP: /* ... ==> ... */
+ case ICMD_POP: /* ..., value ==> ... */
+ case ICMD_POP2: /* ..., value, value ==> ... */
+ case ICMD_INLINE_START: /* internal ICMDs */
+ case ICMD_INLINE_END:
+ break;
- case ICMD_CHECKNULL: /* ..., objectref ==> ..., objectref */
+ case ICMD_CHECKNULL: /* ..., objectref ==> ..., objectref */
- s1 = emit_load_s1(jd, iptr, REG_ITMP1);
- M_TEST(s1);
- M_BEQ(0);
- codegen_add_nullpointerexception_ref(cd);
- break;
+ s1 = emit_load_s1(jd, iptr, REG_ITMP1);
+ M_TEST(s1);
+ M_BEQ(0);
+ codegen_add_nullpointerexception_ref(cd);
+ break;
/* constant operations ************************************************/
/* constant operations ************************************************/
d = codegen_reg_of_dst(jd, iptr, REG_ITMP1);
if (INSTRUCTION_IS_UNRESOLVED(iptr)) {
d = codegen_reg_of_dst(jd, iptr, REG_ITMP1);
if (INSTRUCTION_IS_UNRESOLVED(iptr)) {
-/* PROFILE_CYCLE_STOP; */
+ cr = iptr->sx.val.c.ref;
- codegen_addpatchref(cd, PATCHER_aconst,
- iptr->sx.val.c.ref, 0);
+/* PROFILE_CYCLE_STOP; */
- if (opt_showdisassemble) {
- M_NOP; M_NOP; M_NOP; M_NOP; M_NOP;
- }
+ codegen_add_patch_ref(cd, PATCHER_aconst, cr, 0);
/* PROFILE_CYCLE_START; */
/* PROFILE_CYCLE_START; */
- /* pop operations *****************************************************/
-
- /* attention: double and longs are only one entry in CACAO ICMDs */
-
- case ICMD_POP: /* ..., value ==> ... */
- case ICMD_POP2: /* ..., value, value ==> ... */
-
- break;
-
-
/* integer operations *************************************************/
case ICMD_INEG: /* ..., value ==> ..., - value */
/* integer operations *************************************************/
case ICMD_INEG: /* ..., value ==> ..., - value */
disp = dseg_addaddress(cd, NULL);
disp = -((cd->mcodeptr + 7) - cd->mcodebase) + disp;
disp = dseg_addaddress(cd, NULL);
disp = -((cd->mcodeptr + 7) - cd->mcodebase) + disp;
- /* must be calculated before codegen_addpatchref */
+ /* must be calculated before codegen_add_patch_ref */
- if (opt_showdisassemble)
disp -= PATCHER_CALL_SIZE;
/* PROFILE_CYCLE_STOP; */
disp -= PATCHER_CALL_SIZE;
/* PROFILE_CYCLE_STOP; */
- codegen_addpatchref(cd, PATCHER_get_putstatic, uf, disp);
-
- if (opt_showdisassemble) {
- M_NOP; M_NOP; M_NOP; M_NOP; M_NOP;
- }
+ codegen_add_patch_ref(cd, PATCHER_get_putstatic, uf, disp);
/* PROFILE_CYCLE_START; */
}
/* PROFILE_CYCLE_START; */
}
if (!CLASS_IS_OR_ALMOST_INITIALIZED(fi->class)) {
PROFILE_CYCLE_STOP;
if (!CLASS_IS_OR_ALMOST_INITIALIZED(fi->class)) {
PROFILE_CYCLE_STOP;
- codegen_addpatchref(cd, PATCHER_clinit, fi->class, 0);
+ codegen_add_patch_ref(cd, PATCHER_clinit, fi->class, 0);
- if (opt_showdisassemble) {
- M_NOP; M_NOP; M_NOP; M_NOP; M_NOP;
- }
+ if (opt_shownops)
+ disp -= PATCHER_CALL_SIZE;
disp = dseg_addaddress(cd, NULL);
disp = -((cd->mcodeptr + 7) - cd->mcodebase) + disp;
disp = dseg_addaddress(cd, NULL);
disp = -((cd->mcodeptr + 7) - cd->mcodebase) + disp;
- /* must be calculated before codegen_addpatchref */
+ /* must be calculated before codegen_add_patch_ref */
- if (opt_showdisassemble)
disp -= PATCHER_CALL_SIZE;
/* PROFILE_CYCLE_STOP; */
disp -= PATCHER_CALL_SIZE;
/* PROFILE_CYCLE_STOP; */
- codegen_addpatchref(cd, PATCHER_get_putstatic, uf, disp);
-
- if (opt_showdisassemble) {
- M_NOP; M_NOP; M_NOP; M_NOP; M_NOP;
- }
+ codegen_add_patch_ref(cd, PATCHER_get_putstatic, uf, disp);
/* PROFILE_CYCLE_START; */
}
/* PROFILE_CYCLE_START; */
}
if (!CLASS_IS_OR_ALMOST_INITIALIZED(fi->class)) {
PROFILE_CYCLE_STOP;
if (!CLASS_IS_OR_ALMOST_INITIALIZED(fi->class)) {
PROFILE_CYCLE_STOP;
- codegen_addpatchref(cd, PATCHER_clinit, fi->class, 0);
+ codegen_add_patch_ref(cd, PATCHER_clinit, fi->class, 0);
- if (opt_showdisassemble) {
- M_NOP; M_NOP; M_NOP; M_NOP; M_NOP;
disp -= PATCHER_CALL_SIZE;
disp -= PATCHER_CALL_SIZE;
disp = dseg_addaddress(cd, NULL);
disp = -((cd->mcodeptr + 7) - cd->mcodebase) + disp;
disp = dseg_addaddress(cd, NULL);
disp = -((cd->mcodeptr + 7) - cd->mcodebase) + disp;
- /* must be calculated before codegen_addpatchref */
+ /* must be calculated before codegen_add_patch_ref */
- if (opt_showdisassemble)
disp -= PATCHER_CALL_SIZE;
/* PROFILE_CYCLE_STOP; */
disp -= PATCHER_CALL_SIZE;
/* PROFILE_CYCLE_STOP; */
- codegen_addpatchref(cd, PATCHER_get_putstatic, uf, disp);
-
- if (opt_showdisassemble) {
- M_NOP; M_NOP; M_NOP; M_NOP; M_NOP;
- }
+ codegen_add_patch_ref(cd, PATCHER_get_putstatic, uf, disp);
/* PROFILE_CYCLE_START; */
}
/* PROFILE_CYCLE_START; */
}
if (!CLASS_IS_OR_ALMOST_INITIALIZED(fi->class)) {
PROFILE_CYCLE_STOP;
if (!CLASS_IS_OR_ALMOST_INITIALIZED(fi->class)) {
PROFILE_CYCLE_STOP;
- codegen_addpatchref(cd, PATCHER_clinit, fi->class, 0);
+ codegen_add_patch_ref(cd, PATCHER_clinit, fi->class, 0);
- if (opt_showdisassemble) {
- M_NOP; M_NOP; M_NOP; M_NOP; M_NOP;
- }
+ if (opt_shownops)
+ disp -= PATCHER_CALL_SIZE;
/* PROFILE_CYCLE_STOP; */
/* PROFILE_CYCLE_STOP; */
- codegen_addpatchref(cd, PATCHER_get_putfield, uf, 0);
-
- if (opt_showdisassemble) {
- M_NOP; M_NOP; M_NOP; M_NOP; M_NOP;
- }
+ codegen_add_patch_ref(cd, PATCHER_get_putfield, uf, 0);
/* PROFILE_CYCLE_START; */
}
/* PROFILE_CYCLE_START; */
}
/* PROFILE_CYCLE_STOP; */
/* PROFILE_CYCLE_STOP; */
- codegen_addpatchref(cd, PATCHER_get_putfield, uf, 0);
-
- if (opt_showdisassemble) {
- M_NOP; M_NOP; M_NOP; M_NOP; M_NOP;
- }
+ codegen_add_patch_ref(cd, PATCHER_get_putfield, uf, 0);
/* PROFILE_CYCLE_START; */
}
/* PROFILE_CYCLE_START; */
}
/* PROFILE_CYCLE_STOP; */
/* PROFILE_CYCLE_STOP; */
- codegen_addpatchref(cd, PATCHER_putfieldconst, uf, 0);
-
- if (opt_showdisassemble) {
- M_NOP; M_NOP; M_NOP; M_NOP; M_NOP;
- }
+ codegen_add_patch_ref(cd, PATCHER_putfieldconst, uf, 0);
/* PROFILE_CYCLE_START; */
}
/* PROFILE_CYCLE_START; */
}
#ifdef ENABLE_VERIFIER
if (INSTRUCTION_IS_UNRESOLVED(iptr)) {
#ifdef ENABLE_VERIFIER
if (INSTRUCTION_IS_UNRESOLVED(iptr)) {
- codegen_addpatchref(cd, PATCHER_athrow_areturn,
- iptr->sx.s23.s2.uc, 0);
+ uc = iptr->sx.s23.s2.uc;
- if (opt_showdisassemble) {
- M_NOP; M_NOP; M_NOP; M_NOP; M_NOP;
- }
+ codegen_add_patch_ref(cd, PATCHER_athrow_areturn, uc, 0);
}
#endif /* ENABLE_VERIFIER */
}
#endif /* ENABLE_VERIFIER */
#ifdef ENABLE_VERIFIER
if (INSTRUCTION_IS_UNRESOLVED(iptr)) {
#ifdef ENABLE_VERIFIER
if (INSTRUCTION_IS_UNRESOLVED(iptr)) {
+ uc = iptr->sx.s23.s2.uc;
- codegen_addpatchref(cd, PATCHER_athrow_areturn,
- iptr->sx.s23.s2.uc, 0);
- if (opt_showdisassemble) {
- M_NOP; M_NOP; M_NOP; M_NOP; M_NOP;
- }
+ codegen_add_patch_ref(cd, PATCHER_athrow_areturn, uc, 0);
disp = dseg_addaddress(cd, NULL);
disp = -((cd->mcodeptr + 7) - cd->mcodebase) + disp;
disp = dseg_addaddress(cd, NULL);
disp = -((cd->mcodeptr + 7) - cd->mcodebase) + disp;
- /* must be calculated before codegen_addpatchref */
+ /* must be calculated before codegen_add_patch_ref */
- if (opt_showdisassemble)
disp -= PATCHER_CALL_SIZE;
disp -= PATCHER_CALL_SIZE;
- codegen_addpatchref(cd, PATCHER_invokestatic_special,
- um, disp);
-
- if (opt_showdisassemble) {
- M_NOP; M_NOP; M_NOP; M_NOP; M_NOP;
- }
+ codegen_add_patch_ref(cd, PATCHER_invokestatic_special,
+ um, disp);
gen_nullptr_check(REG_A0);
if (lm == NULL) {
gen_nullptr_check(REG_A0);
if (lm == NULL) {
- codegen_addpatchref(cd, PATCHER_invokevirtual, um, 0);
-
- if (opt_showdisassemble) {
- M_NOP; M_NOP; M_NOP; M_NOP; M_NOP;
- }
+ codegen_add_patch_ref(cd, PATCHER_invokevirtual, um, 0);
gen_nullptr_check(REG_A0);
if (lm == NULL) {
gen_nullptr_check(REG_A0);
if (lm == NULL) {
- codegen_addpatchref(cd, PATCHER_invokeinterface, um, 0);
-
- if (opt_showdisassemble) {
- M_NOP; M_NOP; M_NOP; M_NOP; M_NOP;
- }
+ codegen_add_patch_ref(cd, PATCHER_invokeinterface, um, 0);
3 /* test */ + 6 /* jcc */;
if (super == NULL)
3 /* test */ + 6 /* jcc */;
if (super == NULL)
- s2 += (opt_showdisassemble ? 5 : 0);
+ s2 += (opt_shownops ? 5 : 0);
/* calculate class checkcast code size */
/* calculate class checkcast code size */
s3 += 3 /* cmp */ + 6 /* jcc */;
if (super == NULL)
s3 += 3 /* cmp */ + 6 /* jcc */;
if (super == NULL)
- s3 += (opt_showdisassemble ? 5 : 0);
+ s3 += (opt_shownops ? 5 : 0);
/* if class is not resolved, check which code to call */
if (super == NULL) {
M_TEST(s1);
/* if class is not resolved, check which code to call */
if (super == NULL) {
M_TEST(s1);
- M_BEQ(6 + (opt_showdisassemble ? 5 : 0) + 7 + 6 + s2 + 5 + s3);
-
- codegen_addpatchref(cd, PATCHER_checkcast_instanceof_flags,
- iptr->sx.s23.s3.c.ref, 0);
+ M_BEQ(6 + (opt_shownops ? 5 : 0) + 7 + 6 + s2 + 5 + s3);
- if (opt_showdisassemble) {
- M_NOP; M_NOP; M_NOP; M_NOP; M_NOP;
- }
+ codegen_add_patch_ref(cd, PATCHER_checkcast_instanceof_flags,
+ iptr->sx.s23.s3.c.ref, 0);
M_IMOV_IMM(0, REG_ITMP2); /* super->flags */
M_IAND_IMM(ACC_INTERFACE, REG_ITMP2);
M_IMOV_IMM(0, REG_ITMP2); /* super->flags */
M_IAND_IMM(ACC_INTERFACE, REG_ITMP2);
M_ALD(REG_ITMP2, s1, OFFSET(java_objectheader, vftbl));
if (super == NULL) {
M_ALD(REG_ITMP2, s1, OFFSET(java_objectheader, vftbl));
if (super == NULL) {
- codegen_addpatchref(cd,
- PATCHER_checkcast_instanceof_interface,
- iptr->sx.s23.s3.c.ref,
- 0);
-
- if (opt_showdisassemble) {
- M_NOP; M_NOP; M_NOP; M_NOP; M_NOP;
- }
+ codegen_add_patch_ref(cd,
+ PATCHER_checkcast_instanceof_interface,
+ iptr->sx.s23.s3.c.ref,
+ 0);
}
emit_movl_membase32_reg(cd, REG_ITMP2,
}
emit_movl_membase32_reg(cd, REG_ITMP2,
M_ALD(REG_ITMP2, s1, OFFSET(java_objectheader, vftbl));
if (super == NULL) {
M_ALD(REG_ITMP2, s1, OFFSET(java_objectheader, vftbl));
if (super == NULL) {
- codegen_addpatchref(cd, PATCHER_checkcast_class,
- iptr->sx.s23.s3.c.ref,
- 0);
-
- if (opt_showdisassemble) {
- M_NOP; M_NOP; M_NOP; M_NOP; M_NOP;
- }
+ codegen_add_patch_ref(cd, PATCHER_checkcast_class,
+ iptr->sx.s23.s3.c.ref,
+ 0);
}
M_MOV_IMM(supervftbl, REG_ITMP3);
}
M_MOV_IMM(supervftbl, REG_ITMP3);
M_INTMOVE(s1, REG_A0);
if (INSTRUCTION_IS_UNRESOLVED(iptr)) {
M_INTMOVE(s1, REG_A0);
if (INSTRUCTION_IS_UNRESOLVED(iptr)) {
- codegen_addpatchref(cd, PATCHER_builtin_arraycheckcast,
- iptr->sx.s23.s3.c.ref, 0);
-
- if (opt_showdisassemble) {
- M_NOP; M_NOP; M_NOP; M_NOP; M_NOP;
- }
+ codegen_add_patch_ref(cd, PATCHER_builtin_arraycheckcast,
+ iptr->sx.s23.s3.c.ref, 0);
}
M_MOV_IMM(iptr->sx.s23.s3.c.cls, REG_A1);
}
M_MOV_IMM(iptr->sx.s23.s3.c.cls, REG_A1);
3 /* test */ + 4 /* setcc */;
if (!super)
3 /* test */ + 4 /* setcc */;
if (!super)
- s2 += (opt_showdisassemble ? 5 : 0);
+ s2 += (opt_shownops ? 5 : 0);
/* calculate class instanceof code size */
/* calculate class instanceof code size */
CALCOFFSETBYTES(s3, REG_ITMP2, OFFSET(vftbl_t, diffval));
s3 += 3 /* sub */ + 3 /* xor */ + 3 /* cmp */ + 4 /* setcc */;
CALCOFFSETBYTES(s3, REG_ITMP2, OFFSET(vftbl_t, diffval));
s3 += 3 /* sub */ + 3 /* xor */ + 3 /* cmp */ + 4 /* setcc */;
- if (!super)
- s3 += (opt_showdisassemble ? 5 : 0);
+ if (super == NULL)
+ s3 += (opt_shownops ? 5 : 0);
emit_alu_reg_reg(cd, ALU_XOR, d, d);
/* if class is not resolved, check which code to call */
emit_alu_reg_reg(cd, ALU_XOR, d, d);
/* if class is not resolved, check which code to call */
emit_test_reg_reg(cd, s1, s1);
emit_test_reg_reg(cd, s1, s1);
- emit_jcc(cd, CC_Z, (6 + (opt_showdisassemble ? 5 : 0) +
+ emit_jcc(cd, CC_Z, (6 + (opt_shownops ? 5 : 0) +
- codegen_addpatchref(cd, PATCHER_checkcast_instanceof_flags,
- iptr->sx.s23.s3.c.ref, 0);
-
- if (opt_showdisassemble) {
- M_NOP; M_NOP; M_NOP; M_NOP; M_NOP;
- }
+ codegen_add_patch_ref(cd, PATCHER_checkcast_instanceof_flags,
+ iptr->sx.s23.s3.c.ref, 0);
emit_movl_imm_reg(cd, 0, REG_ITMP3); /* super->flags */
emit_alul_imm_reg(cd, ALU_AND, ACC_INTERFACE, REG_ITMP3);
emit_movl_imm_reg(cd, 0, REG_ITMP3); /* super->flags */
emit_alul_imm_reg(cd, ALU_AND, ACC_INTERFACE, REG_ITMP3);
/* interface instanceof code */
/* interface instanceof code */
- if (!super || (super->flags & ACC_INTERFACE)) {
- if (super) {
+ if ((super == NULL) || (super->flags & ACC_INTERFACE)) {
+ if (super != NULL) {
emit_test_reg_reg(cd, s1, s1);
emit_jcc(cd, CC_Z, s2);
}
emit_mov_membase_reg(cd, s1,
emit_test_reg_reg(cd, s1, s1);
emit_jcc(cd, CC_Z, s2);
}
emit_mov_membase_reg(cd, s1,
- OFFSET(java_objectheader, vftbl),
- REG_ITMP1);
- if (!super) {
- codegen_addpatchref(cd,
- PATCHER_checkcast_instanceof_interface,
- iptr->sx.s23.s3.c.ref, 0);
+ OFFSET(java_objectheader, vftbl),
+ REG_ITMP1);
- if (opt_showdisassemble) {
- M_NOP; M_NOP; M_NOP; M_NOP; M_NOP;
- }
+ if (super == NULL) {
+ codegen_add_patch_ref(cd,
+ PATCHER_checkcast_instanceof_interface,
+ iptr->sx.s23.s3.c.ref, 0);
}
emit_movl_membase32_reg(cd, REG_ITMP1,
}
emit_movl_membase32_reg(cd, REG_ITMP1,
/* class instanceof code */
/* class instanceof code */
- if (!super || !(super->flags & ACC_INTERFACE)) {
- if (super) {
+ if ((super == NULL) || !(super->flags & ACC_INTERFACE)) {
+ if (super != NULL) {
emit_test_reg_reg(cd, s1, s1);
emit_jcc(cd, CC_E, s3);
}
emit_test_reg_reg(cd, s1, s1);
emit_jcc(cd, CC_E, s3);
}
OFFSET(java_objectheader, vftbl),
REG_ITMP1);
OFFSET(java_objectheader, vftbl),
REG_ITMP1);
- if (!super) {
- codegen_addpatchref(cd, PATCHER_instanceof_class,
- iptr->sx.s23.s3.c.ref, 0);
-
- if (opt_showdisassemble) {
- M_NOP; M_NOP; M_NOP; M_NOP; M_NOP;
- }
+ if (super == NULL) {
+ codegen_add_patch_ref(cd, PATCHER_instanceof_class,
+ iptr->sx.s23.s3.c.ref, 0);
}
emit_mov_imm_reg(cd, (ptrint) supervftbl, REG_ITMP2);
}
emit_mov_imm_reg(cd, (ptrint) supervftbl, REG_ITMP2);
/* is a patcher function set? */
if (INSTRUCTION_IS_UNRESOLVED(iptr)) {
/* is a patcher function set? */
if (INSTRUCTION_IS_UNRESOLVED(iptr)) {
- codegen_addpatchref(cd, PATCHER_builtin_multianewarray,
- iptr->sx.s23.s3.c.ref, 0);
-
- if (opt_showdisassemble) {
- M_NOP; M_NOP; M_NOP; M_NOP; M_NOP;
- }
+ codegen_add_patch_ref(cd, PATCHER_builtin_multianewarray,
+ iptr->sx.s23.s3.c.ref, 0);
}
/* a0 = dimension count */
}
/* a0 = dimension count */
/* get function address (this must happen before the stackframeinfo) */
#if !defined(WITH_STATIC_CLASSPATH)
/* get function address (this must happen before the stackframeinfo) */
#if !defined(WITH_STATIC_CLASSPATH)
- if (f == NULL) {
- codegen_addpatchref(cd, PATCHER_resolve_native, m, 0);
-
- if (opt_showdisassemble) {
- M_NOP; M_NOP; M_NOP; M_NOP; M_NOP;
- }
- }
+ if (f == NULL)
+ codegen_add_patch_ref(cd, PATCHER_resolve_native, m, 0);
#endif
M_MOV_IMM(f, REG_ITMP3);
#endif
M_MOV_IMM(f, REG_ITMP3);
Authors: Andreas Krall
Christian Thalinger
Authors: Andreas Krall
Christian Thalinger
- Changes:
-
- $Id: codegen.h 5632 2006-10-02 13:43:15Z edwin $
+ $Id: codegen.h 5945 2006-11-10 16:41:12Z twisti $
-/* some defines ***************************************************************/
-
-#define PATCHER_CALL_SIZE 5 /* size in bytes of a patcher call */
-
-
/* additional functions and macros to generate code ***************************/
#define CALCOFFSETBYTES(var, reg, val) \
/* additional functions and macros to generate code ***************************/
#define CALCOFFSETBYTES(var, reg, val) \
+/* some patcher defines *******************************************************/
+
+#define PATCHER_CALL_SIZE 5 /* size in bytes of a patcher call */
+
+#define PATCHER_NOPS \
+ do { \
+ M_NOP; \
+ M_NOP; \
+ M_NOP; \
+ M_NOP; \
+ M_NOP; \
+ } while (0)
+
+
/* macros to create code ******************************************************/
#define M_MOV(a,b) emit_mov_reg_reg(cd, (a), (b))
/* macros to create code ******************************************************/
#define M_MOV(a,b) emit_mov_reg_reg(cd, (a), (b))
- $Id: patcher.c 5233 2006-08-14 10:59:39Z twisti $
+ $Id: patcher.c 5945 2006-11-10 16:41:12Z twisti $
/* if we show disassembly, we have to skip the nop's */
/* if we show disassembly, we have to skip the nop's */
- if (opt_showdisassemble)
ra = ra + 5;
/* patch the field value's address */
ra = ra + 5;
/* patch the field value's address */
/* if we show disassembly, we have to skip the nop's */
/* if we show disassembly, we have to skip the nop's */
- if (opt_showdisassemble)
ra = ra + 5;
/* patch the field's offset: we check for the field type, because the */
ra = ra + 5;
/* patch the field's offset: we check for the field type, because the */
/* if we show disassembly, we have to skip the nop's */
/* if we show disassembly, we have to skip the nop's */
- if (opt_showdisassemble)
ra = ra + 5;
/* patch the field's offset */
ra = ra + 5;
/* patch the field's offset */
/* if we show disassembly, we have to skip the nop's */
/* if we show disassembly, we have to skip the nop's */
- if (opt_showdisassemble)
ra = ra + 5;
/* patch the classinfo pointer */
ra = ra + 5;
/* patch the classinfo pointer */
/* if we show disassembly, we have to skip the nop's */
/* if we show disassembly, we have to skip the nop's */
- if (opt_showdisassemble)
ra = ra + 5;
/* patch the classinfo pointer */
ra = ra + 5;
/* patch the classinfo pointer */
/* if we show disassembly, we have to skip the nop's */
/* if we show disassembly, we have to skip the nop's */
- if (opt_showdisassemble)
ra = ra + 5;
/* patch the classinfo pointer */
ra = ra + 5;
/* patch the classinfo pointer */
/* if we show disassembly, we have to skip the nop's */
/* if we show disassembly, we have to skip the nop's */
- if (opt_showdisassemble)
ra = ra + 5;
/* patch stubroutine */
ra = ra + 5;
/* patch stubroutine */
/* if we show disassembly, we have to skip the nop's */
/* if we show disassembly, we have to skip the nop's */
- if (opt_showdisassemble)
ra = ra + 5;
/* patch vftbl index */
ra = ra + 5;
/* patch vftbl index */
/* if we show disassembly, we have to skip the nop's */
/* if we show disassembly, we have to skip the nop's */
- if (opt_showdisassemble)
ra = ra + 5;
/* patch interfacetable index */
ra = ra + 5;
/* patch interfacetable index */
/* if we show disassembly, we have to skip the nop's */
/* if we show disassembly, we have to skip the nop's */
- if (opt_showdisassemble)
ra = ra + 5;
/* patch class flags */
ra = ra + 5;
/* patch class flags */
/* if we show disassembly, we have to skip the nop's */
/* if we show disassembly, we have to skip the nop's */
- if (opt_showdisassemble)
ra = ra + 5;
/* patch super class index */
ra = ra + 5;
/* patch super class index */
/* if we show disassembly, we have to skip the nop's */
/* if we show disassembly, we have to skip the nop's */
- if (opt_showdisassemble)
ra = ra + 5;
/* patch super class' vftbl */
ra = ra + 5;
/* patch super class' vftbl */
/* if we show disassembly, we have to skip the nop's */
/* if we show disassembly, we have to skip the nop's */
- if (opt_showdisassemble)
ra = ra + 5;
/* patch super class' vftbl */
ra = ra + 5;
/* patch super class' vftbl */
/* if we show disassembly, we have to skip the nop's */
/* if we show disassembly, we have to skip the nop's */
- if (opt_showdisassemble)
ra = ra + 5;
/* patch native function pointer */
ra = ra + 5;
/* patch native function pointer */