* src/vm/options.c (opt_shownops): Removed. This should be replaced
authorChristian Thalinger <twisti@complang.tuwien.ac.at>
Wed, 13 Aug 2008 15:27:28 +0000 (17:27 +0200)
committerChristian Thalinger <twisti@complang.tuwien.ac.at>
Wed, 13 Aug 2008 15:27:28 +0000 (17:27 +0200)
with some patcher dump function.
* src/vm/options.h: Likewise.
* src/vm/jit/alpha/patcher.c,
src/vm/jit/arm/patcher.c,
src/vm/jit/i386/patcher.c,
src/vm/jit/m68k/codegen.h,
src/vm/jit/m68k/patcher.c,
src/vm/jit/mips/patcher.c,
src/vm/jit/patcher-common.c,
src/vm/jit/powerpc/patcher.c,
src/vm/jit/powerpc64/patcher.c,
src/vm/jit/s390/codegen.h,
src/vm/jit/s390/patcher.c,
src/vm/jit/sparc64/patcher.c,
src/vm/jit/x86_64/patcher.c,
src/vm/vm.cpp: Likewise.

16 files changed:
src/vm/jit/alpha/patcher.c
src/vm/jit/arm/patcher.c
src/vm/jit/i386/patcher.c
src/vm/jit/m68k/codegen.h
src/vm/jit/m68k/patcher.c
src/vm/jit/mips/patcher.c
src/vm/jit/patcher-common.c
src/vm/jit/powerpc/patcher.c
src/vm/jit/powerpc64/patcher.c
src/vm/jit/s390/codegen.h
src/vm/jit/s390/patcher.c
src/vm/jit/sparc64/patcher.c
src/vm/jit/x86_64/patcher.c
src/vm/options.c
src/vm/options.h
src/vm/vm.cpp

index 0e981a090e92ecbe28245a668f74441cac933023..41006bdaf5f84154563e5c240e7082feb0789ccf 100644 (file)
@@ -253,11 +253,6 @@ bool patcher_get_putfield(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop */
-
-       if (opt_shownops)
-               ra = ra + 4;
-
        /* patch the field's offset into the instruction */
 
        *((u4 *) ra) |= (s2) (fi->offset & 0x0000ffff);
@@ -333,11 +328,6 @@ bool patcher_invokevirtual(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop */
-
-       if (opt_shownops)
-               ra = ra + 4;
-
        /* patch vftbl index */
 
        *((s4 *) (ra + 4)) |= (s4) ((OFFSET(vftbl_t, table[0]) +
@@ -379,11 +369,6 @@ bool patcher_invokeinterface(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop */
-
-       if (opt_shownops)
-               ra = ra + 4;
-
        /* patch interfacetable index */
 
        *((s4 *) (ra + 4)) |= (s4) ((OFFSET(vftbl_t, interfacetable[0]) -
@@ -431,11 +416,6 @@ bool patcher_checkcast_interface(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop */
-
-       if (opt_shownops)
-               ra = ra + 4;
-
        /* patch super class index */
 
        *((s4 *) (ra + 2 * 4)) |= (s4) (-(c->index) & 0x0000ffff);
@@ -480,11 +460,6 @@ bool patcher_instanceof_interface(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop */
-
-       if (opt_shownops)
-               ra = ra + 4;
-
        /* patch super class index */
 
        *((s4 *) (ra + 2 * 4)) |= (s4) (-(c->index) & 0x0000ffff);
index e7df6ca4ae6aef3ce94477aa96bffe3878aaef87..28f359db1daf4fa19b6b14e2c9a6529ae0bf0fdd 100644 (file)
@@ -145,11 +145,6 @@ bool patcher_get_putfield(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop */
-
-       if (opt_shownops)
-               ra = ra + 1 * 4;
-
        /* patch the field's offset into the instruction */
 
        switch(fi->type) {
@@ -307,11 +302,6 @@ bool patcher_invokevirtual(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop */
-
-       if (opt_shownops)
-               ra = ra + 1 * 4;
-
        /* patch vftbl index */
 
        gen_resolveload(*((s4 *) (ra + 1 * 4)), (s4) (OFFSET(vftbl_t, table[0]) + sizeof(methodptr) * m->vftblindex));
@@ -356,11 +346,6 @@ bool patcher_invokeinterface(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop */
-
-       if (opt_shownops)
-               ra = ra + 1 * 4;
-
        /* patch interfacetable index */
 
        gen_resolveload(*((s4 *) (ra + 1 * 4)), (s4) (OFFSET(vftbl_t, interfacetable[0]) - sizeof(methodptr*) * m->clazz->index));
index 80feee6a0c577109199244d7ba7ef4927f030635..438ce1bf4aa1301a6b88f575e4e6c9de21f49e55 100644 (file)
@@ -94,11 +94,6 @@ bool patcher_get_putstatic(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
        /* patch the field value's address */
 
        *((intptr_t *) (ra + 1)) = (intptr_t) fi->value;
@@ -134,11 +129,6 @@ bool patcher_getfield(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
        /* patch the field's offset */
 
        *((u4 *) (ra + 2)) = (u4) (fi->offset);
@@ -179,11 +169,6 @@ bool patcher_putfield(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
        /* patch the field's offset */
 
        if (fi->type != TYPE_LNG) {
@@ -231,11 +216,6 @@ bool patcher_putfieldconst(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
        /* patch the field's offset */
 
        if (!IS_2_WORD_TYPE(fi->type)) {
@@ -284,11 +264,6 @@ bool patcher_aconst(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
        /* patch the classinfo pointer */
 
        *((ptrint *) (ra + 1)) = (ptrint) c;
@@ -330,11 +305,6 @@ bool patcher_builtin_multianewarray(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
        /* patch the classinfo pointer */
 
        *((ptrint *) (ra + 7 + 4)) = (ptrint) c;
@@ -372,11 +342,6 @@ bool patcher_builtin_arraycheckcast(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
        /* patch the classinfo pointer */
 
        *((ptrint *) (ra + 4)) = (ptrint) c;
@@ -417,11 +382,6 @@ bool patcher_invokestatic_special(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
        /* patch stubroutine */
 
        *((ptrint *) (ra + 1)) = (ptrint) m->stubroutine;
@@ -459,11 +419,6 @@ bool patcher_invokevirtual(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
        /* patch vftbl index */
 
        *((s4 *) (ra + 2 + 2)) = (s4) (OFFSET(vftbl_t, table[0]) +
@@ -503,11 +458,6 @@ bool patcher_invokeinterface(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
        /* patch interfacetable index */
 
        *((s4 *) (ra + 2 + 2)) = (s4) (OFFSET(vftbl_t, interfacetable[0]) -
@@ -549,11 +499,6 @@ bool patcher_checkcast_instanceof_flags(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
        /* patch class flags */
 
        *((s4 *) (ra + 1)) = (s4) c->flags;
@@ -594,11 +539,6 @@ bool patcher_checkcast_interface(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
        /* patch super class index */
 
        *((s4 *) (ra + 6 + 2)) = (s4) c->index;
@@ -642,11 +582,6 @@ bool patcher_instanceof_interface(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
        /* patch super class index */
 
        *((s4 *) (ra + 6 + 2)) = (s4) c->index;
@@ -690,11 +625,6 @@ bool patcher_checkcast_class(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
        /* patch super class' vftbl */
 
        *((ptrint *) (ra + 1)) = (ptrint) c->vftbl;
@@ -734,11 +664,6 @@ bool patcher_instanceof_class(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
        /* patch super class' vftbl */
 
        *((ptrint *) (ra + 1)) = (ptrint) c->vftbl;
index 689dd9b6a64b9ed3873809bcae88796ed0a54ab8..b0add07bad577492e5beaca5875ae65c8d949245 100644 (file)
@@ -63,7 +63,7 @@
 #define PATCHER_NOPS \
        do { M_TPFL; M_TPF; M_TPF } while (0);
 
-#define PATCHER_CALL_SIZE      (3*2)
+#define PATCHER_CALL_SIZE      2
 
 /* stub defines ***************************************************************/
 
index a5e03b50357b9bf29f53481b2ff0641085e39c8b..36344a73ce3e7611f940dce86e927437d2665f7f 100644 (file)
@@ -130,9 +130,6 @@ bool patcher_invokevirtual(patchref_t *pr)
        /* patch back original code */
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show NOPs, we have to skip them */
-       if (opt_shownops) ra += PATCHER_CALL_SIZE;
-
        assert( *((u2*)(ra+8)) == 0x286b);
 
        /* patch vftbl index */
@@ -173,9 +170,6 @@ bool patcher_invokestatic_special(patchref_t *pr)
        /* patch back original code */
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* patch stubroutine */
-       if (opt_shownops) disp += PATCHER_CALL_SIZE;
-
        *((ptrint *) (disp+2)) = (ptrint) m->stubroutine;
 
        /* synchronize inst cache */
@@ -209,7 +203,6 @@ bool patcher_resolve_classref_to_classinfo(patchref_t *pr)
        PATCH_BACK_ORIGINAL_MCODE;
 
        /* patch the classinfo pointer */
-       if (opt_shownops) disp += PATCHER_CALL_SIZE;
        *((ptrint *) (disp+2)) = (ptrint) c;
 
        /* synchronize inst cache */
@@ -248,7 +241,6 @@ bool patcher_get_putstatic(patchref_t *pr)
        md_icacheflush(pr->mpc, 2);
 
        /* patch the field value's address */
-       if (opt_shownops) disp += PATCHER_CALL_SIZE;
        assert(*((uint16_t*)(disp)) == 0x247c);
        *((intptr_t *) (disp+2)) = (intptr_t) fi->value;
 
@@ -283,9 +275,6 @@ bool patcher_get_putfield(patchref_t *pr)
        PATCH_BACK_ORIGINAL_MCODE;
        md_icacheflush(pr->mpc, 2);
 
-       /* if we show NOPs, we have to skip them */
-       if (opt_shownops) ra += PATCHER_CALL_SIZE;
-
        /* patch the field's offset */
        if (IS_LNG_TYPE(fi->type)) {
                /*
@@ -371,7 +360,6 @@ bool patcher_resolve_classref_to_flags(patchref_t *pr)
        md_icacheflush(pr->mpc, 2);
 
        /* patch class flags */
-       if (opt_shownops) disp += PATCHER_CALL_SIZE;
        assert( (*((u2*)(disp)) == 0x263c) || (*((u2*)(disp)) == 0x283c) );
        *((s4 *) (disp + 2)) = (s4) c->flags;
 
@@ -415,7 +403,6 @@ bool patcher_resolve_classref_to_vftbl(patchref_t *pr)
        md_icacheflush(pr->mpc, 2);
 
        /* patch super class' vftbl */
-       if (opt_shownops) disp += PATCHER_CALL_SIZE;
        assert( (*((u2*)disp) == 0x287c) || (*((u2*)disp)== 0x267c) );
 
        *((s4 *) (disp+2)) = (s4) c->vftbl;
@@ -460,9 +447,6 @@ bool patcher_instanceof_interface(patchref_t *pr)
        PATCH_BACK_ORIGINAL_MCODE;
        md_icacheflush(pr->mpc, 2);
 
-       /* if we show NOPs, we have to skip them */
-       if (opt_shownops) ra += PATCHER_CALL_SIZE;
-               
        /* patch super class index */
        disp = -(c->index);
        assert( *((u2*)(ra + 8)) == 0xd8bc );
@@ -514,9 +498,6 @@ bool patcher_checkcast_interface(patchref_t *pr)
        PATCH_BACK_ORIGINAL_MCODE;
        md_icacheflush(pr->mpc, 2);
 
-       /* if we show NOPs, we have to skip them */
-       if (opt_shownops) ra += PATCHER_CALL_SIZE;
-
        /* patch super class index */
        disp = -(c->index);
        assert ( *((u2 *)(ra + 8)) == 0xd8bc );
@@ -559,7 +540,6 @@ bool patcher_resolve_native_function(patchref_t *pr)
        md_icacheflush(pr->mpc, 2);
 
        /* patch native function pointer */
-       if (opt_shownops) disp += PATCHER_CALL_SIZE;
        *((ptrint *) (disp + 2)) = (ptrint) f;
 
        /* synchronize data cache */
@@ -601,7 +581,6 @@ bool patcher_invokeinterface(patchref_t *pr)
        md_icacheflush(pr->mpc, 2);
 
        /* if we show NOPs, we have to skip them */
-       if (opt_shownops) ra += PATCHER_CALL_SIZE;
        assert( *((uint32_t*)ra) == 0x246f0000 );
 
        /* patch interfacetable index (first #0) */
@@ -620,6 +599,8 @@ bool patcher_invokeinterface(patchref_t *pr)
 
        return true;
 }
+
+
 /*
  * These are local overrides for various environment variables in Emacs.
  * Please do not remove this and leave it at the end of the file, where
index 2a0a9dd9adabfc755f81247768a2f58c8e910d73..1c2bc975c52015d3a04f7a08dd22f71595071a7b 100644 (file)
@@ -139,11 +139,6 @@ bool patcher_get_putfield(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
 #if SIZEOF_VOID_P == 4
        if (IS_LNG_TYPE(fi->type)) {
 # if WORDS_BIGENDIAN == 1
@@ -378,11 +373,6 @@ bool patcher_invokevirtual(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
        /* patch vftbl index */
 
        *((s4 *) (ra + 1 * 4)) |=
@@ -428,11 +418,6 @@ bool patcher_invokeinterface(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
        /* patch interfacetable index */
 
        *((s4 *) (ra + 1 * 4)) |=
@@ -484,11 +469,6 @@ bool patcher_checkcast_interface(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
        /* patch super class index */
 
        *((s4 *) (ra + 2 * 4)) |= (s4) (-(c->index) & 0x0000ffff);
@@ -538,11 +518,6 @@ bool patcher_instanceof_interface(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
        /* patch super class index */
 
        *((s4 *) (ra + 2 * 4)) |= (s4) (-(c->index) & 0x0000ffff);
index ce7be53fb7057158879c6ed91ac60ec99c2db0be..2833b0fcfbdbc691cc95ef980b8021ef0aa2fd9a 100644 (file)
@@ -209,11 +209,6 @@ void patcher_add_patch_ref(jitdata *jd, functionptr patcher, void* ref, s4 disp)
        pr->mcode   = 0;
        pr->done    = false;
 
-       /* Generate NOPs for opt_shownops. */
-
-       if (opt_shownops)
-               PATCHER_NOPS;
-
 #if defined(ENABLE_JIT) && (defined(__I386__) || defined(__M68K__) || defined(__SPARC_64__) || defined(__X86_64__))
 
        /* XXX We can remove that when we don't use UD2 anymore on i386
index 13b50d814ca6df25c48ce7438fc3fbb07404fc59..d7ef9bc431ffe0f656d007f7ff6e2a92e36d4744 100644 (file)
@@ -288,11 +288,6 @@ bool patcher_get_putfield(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show NOPs, we have to skip them */
-
-       if (opt_shownops)
-               ra = ra + 1 * 4;
-
        /* patch the field's offset */
 
        if (IS_LNG_TYPE(fi->type)) {
@@ -397,11 +392,6 @@ bool patcher_invokevirtual(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show NOPs, we have to skip them */
-
-       if (opt_shownops)
-               ra = ra + 1 * 4;
-
        /* patch vftbl index */
 
        disp = (OFFSET(vftbl_t, table[0]) + sizeof(methodptr) * m->vftblindex);
@@ -448,11 +438,6 @@ bool patcher_invokeinterface(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show NOPs, we have to skip them */
-
-       if (opt_shownops)
-               ra = ra + 1 * 4;
-
        /* patch interfacetable index */
 
        disp = OFFSET(vftbl_t, interfacetable[0]) -
@@ -511,11 +496,6 @@ bool patcher_checkcast_interface(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show NOPs, we have to skip them */
-
-       if (opt_shownops)
-               ra = ra + 1 * 4;
-
        /* patch super class index */
 
        disp = -(c->index);
@@ -567,11 +547,6 @@ bool patcher_instanceof_interface(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show NOPs, we have to skip them */
-
-       if (opt_shownops)
-               ra = ra + 1 * 4;
-
        /* patch super class index */
 
        disp = -(c->index);
index c7c1eae6cafc932fc94f39b1c8777b6dc9ec8626..75c2fcb5e13a8547b349acc73c7f5376200b5b42 100644 (file)
@@ -156,11 +156,6 @@ bool patcher_get_putfield(patchref_t *pr)
 
        md_icacheflush(ra, 4);
 
-       /* if we show disassembly, we have to skip the nop */
-
-       if (opt_shownops)
-               ra = ra + 4;
-
        /* patch the field's offset */
 
        *((u4 *) ra) |= (s2) (fi->offset & 0x0000ffff);
@@ -263,11 +258,6 @@ bool patcher_invokevirtual(patchref_t *pr)
 
        md_icacheflush(ra, 4);
 
-       /* if we show disassembly, we have to skip the nop */
-
-       if (opt_shownops)
-               ra = ra + 4;
-
        /* patch vftbl index */
 
        disp = (OFFSET(vftbl_t, table[0]) + sizeof(methodptr) * m->vftblindex);
@@ -322,11 +312,6 @@ bool patcher_invokeinterface(patchref_t *pr)
 
        md_icacheflush(ra, 4);
 
-       /* if we show disassembly, we have to skip the nop */
-
-       if (opt_shownops)
-               ra = ra + 4;
-
        /* patch interfacetable index */
 
        disp = OFFSET(vftbl_t, interfacetable[0]) -
@@ -391,10 +376,6 @@ bool patcher_checkcast_interface(patchref_t *pr)
 
        md_icacheflush(ra, 4);
 
-       /* if we show NOPs, we have to skip them */
-       if (opt_shownops)
-               ra = ra +4;
-
        /* patch super class index */
        disp = -(c->index);
 
@@ -451,11 +432,6 @@ bool patcher_instanceof_interface(patchref_t *pr)
 
        md_icacheflush(ra, 4);
 
-       /* if we show disassembly, we have to skip the nop */
-
-       if (opt_shownops)
-               ra = ra + 4;
-
        /* patch super class index */
 
        disp = -(c->index);
index 8cb750ac9e50340626144c4f53efead7f62ca56f..8e4bbb8c931a295449907e9156b5b74955f13170 100644 (file)
@@ -49,7 +49,6 @@
 
 #define PATCHER_CALL_SIZE    2          /* size in bytes of a patcher call    */
 #define PATCHER_NOPS M_NOP3
-#define PATCHER_NOPS_SKIP   2
 
 /* branch defines ************************************************************/
 
index 94e40a9ff82b2f19dde32b86d7ba44c3ab6e69cc..57533fd8202f6782ab1cd386eaa4e283f7fbe4d3 100644 (file)
@@ -131,11 +131,6 @@ bool patcher_get_putfield(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* If NOPs are generated, skip them */
-
-       if (opt_shownops)
-               ra += PATCHER_NOPS_SKIP;
-
        /* If there is an operand load before, skip the load size passed in disp (see ICMD_PUTFIELD) */
 
        ra += disp;
@@ -219,11 +214,6 @@ bool patcher_invokevirtual(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* If NOPs are generated, skip them */
-
-       if (opt_shownops)
-               ra += PATCHER_NOPS_SKIP;
-
        /* patch vftbl index */
 
 
@@ -267,11 +257,6 @@ bool patcher_invokeinterface(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* If NOPs are generated, skip them */
-
-       if (opt_shownops)
-               ra += PATCHER_NOPS_SKIP;
-
        /* get interfacetable index */
 
        idx = (s4) (OFFSET(vftbl_t, interfacetable[0]) -
@@ -428,11 +413,6 @@ bool patcher_checkcast_instanceof_interface(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* If NOPs are generated, skip them */
-
-       if (opt_shownops)
-               ra += PATCHER_NOPS_SKIP;
-
        /* patch super class index */
 
        /* From here, split your editor and open codegen.c */
index ff6e996af6b717558ec14b853ba312fd9532cb95..56536ee1425a69894df1ee3bbe6b47dee8c92e4c 100644 (file)
@@ -231,22 +231,9 @@ bool patcher_get_putfield(u1 *sp)
        if (!(fi = resolve_field_eager(uf)))
                return false;
 
-       /* if we show disassembly, we have to skip the nop's */
+       /* store the patched instruction on the stack */
 
-       if (opt_shownops) {
-               /* patch the field's offset into the instruction */
-
-               *((u4 *) (ra + 2 * 4)) |= (s2) (fi->offset & 0x00001fff);
-
-               /* synchronize instruction cache */
-
-               md_icacheflush(ra + 2 * 4, 1 * 4);
-       }
-       else {
-               /* otherwise store the patched instruction on the stack */
-
-               *((u4 *) (sp + 3 * 8)) |= (s2) (fi->offset & 0x00001fff);
-       }
+       *((u4 *) (sp + 3 * 8)) |= (s2) (fi->offset & 0x00001fff);
 
        return true;
 }
@@ -445,28 +432,11 @@ bool patcher_invokevirtual(u1 *sp)
        if (!(m = resolve_method_eager(um)))
                return false;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops) {
-               ra = ra + PATCHER_CALL_SIZE;
+       /* patch vftbl index */
 
-               /* patch vftbl index */
-
-               *((s4 *) (ra + 1 * 4)) |=
-                       (s4) ((OFFSET(vftbl_t, table[0]) +
-                                  sizeof(methodptr) * m->vftblindex) & 0x00001fff);
-
-               /* synchronize instruction cache */
-
-               md_icacheflush(ra + 1 * 4, 1 * 4);
-       }
-       else {
-               /* patch vftbl index */
-
-               *((s4 *) (sp + 3 * 8 + 4)) |=
-                       (s4) ((OFFSET(vftbl_t, table[0]) +
-                                  sizeof(methodptr) * m->vftblindex) & 0x00001fff);
-       }
+       *((s4 *) (sp + 3 * 8 + 4)) |=
+               (s4) ((OFFSET(vftbl_t, table[0]) +
+                          sizeof(methodptr) * m->vftblindex) & 0x00001fff);
 
        return true;
 }
@@ -501,42 +471,20 @@ bool patcher_invokeinterface(u1 *sp)
        if (!(m = resolve_method_eager(um)))
                return false;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops) {
-               ra = ra + PATCHER_CALL_SIZE;
+       /* patch interfacetable index */
 
-               /* patch interfacetable index */
-
-               *((s4 *) (ra + 1 * 4)) |= 
-                       (s4) ((OFFSET(vftbl_t, interfacetable[0]) -
-                               sizeof(methodptr*) * m->clazz->index) & 0x00001fff);
-
-               /* patch method offset */
-
-               *((s4 *) (ra + 2 * 4)) |=
-                       (s4) ((sizeof(methodptr) * (m - m->clazz->methods)) & 0x00001fff);
-
-               /* synchronize instruction cache */
-
-               md_icacheflush(ra + 1 * 4, 2 * 4);
-       }
-       else {
-               /* patch interfacetable index */
-
-               *((s4 *) (sp + 3 * 8 + 4)) |=
-                       (s4) ((OFFSET(vftbl_t, interfacetable[0]) -
-                               sizeof(methodptr*) * m->clazz->index) & 0x00001fff);
+       *((s4 *) (sp + 3 * 8 + 4)) |=
+               (s4) ((OFFSET(vftbl_t, interfacetable[0]) -
+                          sizeof(methodptr*) * m->clazz->index) & 0x00001fff);
 
-               /* patch method offset */
+       /* patch method offset */
 
-               *((s4 *) (ra + 2 * 4)) |=
-                       (s4) ((sizeof(methodptr) * (m - m->clazz->methods)) & 0x00001fff);
+       *((s4 *) (ra + 2 * 4)) |=
+               (s4) ((sizeof(methodptr) * (m - m->clazz->methods)) & 0x00001fff);
 
-               /* synchronize instruction cache */
+       /* synchronize instruction cache */
 
-               md_icacheflush(ra + 2 * 4, 1 * 4);
-       }
+       md_icacheflush(ra + 2 * 4, 1 * 4);
 
        return true;
 }
@@ -614,11 +562,6 @@ bool patcher_checkcast_interface(u1 *sp)
        if (!(c = resolve_classref_eager(cr)))
                return false;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
        /* patch super class index */
 
        *((s4 *) (ra + 2 * 4)) |= (s4) (-(c->index) & 0x00001fff);
@@ -629,10 +572,7 @@ bool patcher_checkcast_interface(u1 *sp)
 
        /* synchronize instruction cache */
 
-       if (opt_shownops)
-               md_icacheflush(ra - 2 * 4, (6 + EXCEPTION_CHECK_INSTRUCTIONS) * 4);
-       else
-               md_icacheflush(ra, (4 + EXCEPTION_CHECK_INSTRUCTIONS) * 4);
+       md_icacheflush(ra, (4 + EXCEPTION_CHECK_INSTRUCTIONS) * 4);
 
        return true;
 }
@@ -667,11 +607,6 @@ bool patcher_instanceof_interface(u1 *sp)
        if (!(c = resolve_classref_eager(cr)))
                return false;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
        /* patch super class index */
 
        *((s4 *) (ra + 2 * 4)) |= (s4) ((c->index) & 0x00001fff);
@@ -681,10 +616,7 @@ bool patcher_instanceof_interface(u1 *sp)
 
        /* synchronize instruction cache */
 
-       if (opt_shownops)
-               md_icacheflush(ra - PATCHER_CALL_SIZE * 4, 8 * 4);
-       else
-               md_icacheflush(ra, 6 * 4);
+       md_icacheflush(ra, 6 * 4);
 
        return true;
 }
index 18e81ddc69e2c9677b44443dfbe1786e16eea900..aed1918f52876ab7bcbef948579dbe88346bed65 100644 (file)
@@ -173,11 +173,6 @@ bool patcher_resolve_classref_to_flags(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
        /* patch class flags */
 
 /*     *datap = c->flags; */
@@ -253,11 +248,6 @@ bool patcher_get_putfield(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
        /* Patch the field's offset: we check for the field type, because
           the instructions have different lengths. */
 
@@ -312,11 +302,6 @@ bool patcher_putfieldconst(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
        /* patch the field's offset */
 
        if (IS_2_WORD_TYPE(fi->type) || IS_ADR_TYPE(fi->type)) {
@@ -409,11 +394,6 @@ bool patcher_invokevirtual(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
        /* patch vftbl index */
 
        *((int32_t *) (ra + 3 + 3)) =
@@ -454,11 +434,6 @@ bool patcher_invokeinterface(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
        /* patch interfacetable index */
 
        *((int32_t *) (ra + 3 + 3)) =
@@ -503,11 +478,6 @@ bool patcher_checkcast_interface(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
        /* patch super class index */
 
        *((int32_t *) (ra + 7 + 3)) = c->index;
@@ -548,11 +518,6 @@ bool patcher_instanceof_interface(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* if we show disassembly, we have to skip the nop's */
-
-       if (opt_shownops)
-               ra = ra + PATCHER_CALL_SIZE;
-
        /* patch super class index */
 
        *((int32_t *) (ra + 7 + 3)) = c->index;
index 68def40bcc0ede872830e103c699099fc3a48f84..cb4fd010ea7616ae7c179a1d139ccc50a73d98a9 100644 (file)
@@ -83,7 +83,6 @@ bool compileverbose =  false;           /* trace compiler actions             */
 bool showstack = false;
 
 bool opt_showdisassemble    = false;    /* generate disassembler listing      */
-bool opt_shownops           = false;
 bool opt_showddatasegment   = false;    /* generate data segment listing      */
 bool opt_showintermediate   = false;    /* generate intermediate code listing */
 
index 09738742b582d2c5185f891c83d166846667652f..b36130aec70efc3d73395d1f4a5f9d092ad4f542 100644 (file)
@@ -109,7 +109,6 @@ extern bool compileverbose;
 extern bool showstack;
 
 extern bool opt_showdisassemble;
-extern bool opt_shownops;
 extern bool opt_showddatasegment;
 extern bool opt_showintermediate;
 
index 0335c5f971beccbdcf98f35f2c0b69df84926154..d7966f300f9b358dc5137c713a8db7d814f422e5 100644 (file)
@@ -1176,10 +1176,6 @@ VM::VM(JavaVMInitArgs* vm_args)
                                        opt_showdisassemble = true;
                                        compileverbose = true;
                                        break;
-
-                               case 'o':
-                                       opt_shownops = true;
-                                       break;
 #endif
 
                                case 'd':