* configure.ac: Added option --enable-replacement.
authoredwin <none@none>
Tue, 2 Jan 2007 20:40:57 +0000 (20:40 +0000)
committeredwin <none@none>
Tue, 2 Jan 2007 20:40:57 +0000 (20:40 +0000)
* src/vm/jit/Makefile.am: Compile replace.c only for
ENABLE_REPLACEMENT.

* src/vm/jit/replace.h: Define empty macros unless ENABLE_REPLACEMENT.

* src/vm/jit/powerpc/emit.c: Enclosed replacement-specific code in
#if ENABLE_REPLACEMENT.
* src/vm/jit/powerpc/md.c: Likewise.
* src/vm/jit/powerpc/asmpart.S: Likewise.
* src/vm/jit/codegen-common.h: Likewise.
* src/vm/jit/sparc64/emit.c: Likewise.
* src/vm/jit/sparc64/md.c: Likewise.
* src/vm/jit/alpha/emit.c: Likewise.
* src/vm/jit/alpha/md.c: Likewise.
* src/vm/jit/alpha/asmpart.S: Likewise.
* src/vm/jit/code.c: Likewise.
* src/vm/jit/code.h: Likewise.
* src/vm/jit/tools/genoffsets.c: Likewise.
* src/vm/jit/show.c: Likewise.
* src/vm/jit/mips/emit.c: Likewise.
* src/vm/jit/mips/md.c: Likewise.
* src/vm/jit/mips/asmpart.S: Likewise.
* src/vm/jit/powerpc64/md.c: Likewise.
* src/vm/jit/powerpc64/asmpart.S: Likewise.
* src/vm/jit/i386/emit.c: Likewise.
* src/vm/jit/i386/md.c: Likewise.
* src/vm/jit/i386/asmpart.S: Likewise.
* src/vm/jit/asmpart.h: Likewise.
* src/vm/jit/x86_64/emit.c: Likewise.
* src/vm/jit/x86_64/md.c: Likewise.
* src/vm/jit/x86_64/asmpart.S: Likewise.
* src/vm/jit/codegen-common.c: Likewise.
* src/vm/jit/jit.h: Likewise.

30 files changed:
configure.ac
src/vm/jit/Makefile.am
src/vm/jit/alpha/asmpart.S
src/vm/jit/alpha/emit.c
src/vm/jit/alpha/md.c
src/vm/jit/asmpart.h
src/vm/jit/code.c
src/vm/jit/code.h
src/vm/jit/codegen-common.c
src/vm/jit/codegen-common.h
src/vm/jit/i386/asmpart.S
src/vm/jit/i386/emit.c
src/vm/jit/i386/md.c
src/vm/jit/jit.h
src/vm/jit/mips/asmpart.S
src/vm/jit/mips/emit.c
src/vm/jit/mips/md.c
src/vm/jit/powerpc/asmpart.S
src/vm/jit/powerpc/emit.c
src/vm/jit/powerpc/md.c
src/vm/jit/powerpc64/asmpart.S
src/vm/jit/powerpc64/md.c
src/vm/jit/replace.h
src/vm/jit/show.c
src/vm/jit/sparc64/emit.c
src/vm/jit/sparc64/md.c
src/vm/jit/tools/genoffsets.c
src/vm/jit/x86_64/asmpart.S
src/vm/jit/x86_64/emit.c
src/vm/jit/x86_64/md.c

index ec0505bc693c8856ab9b2d717505422f09ce0e49..2ddbdf87dfcaa2bd7791feda8db7f659529205f8 100644 (file)
@@ -651,6 +651,23 @@ if test x"${ENABLE_INLINING}" = "xyes"; then
 fi
 
 
+dnl check for replacement
+AC_MSG_CHECKING(whether on-stack replacement should be supported)
+AC_ARG_ENABLE([replacement],
+              [AS_HELP_STRING(--enable-replacement,enable on-stack replacement [[default=no]])],
+              [case "${enableval}" in
+                   yes) ENABLE_REPLACEMENT=yes;;
+                   *) ENABLE_REPLACEMENT=no;;
+               esac],
+              [ENABLE_REPLACEMENT=no])
+AC_MSG_RESULT(${ENABLE_REPLACEMENT})
+AM_CONDITIONAL([ENABLE_REPLACEMENT], test x"${ENABLE_REPLACEMENT}" = "xyes")
+
+if test x"${ENABLE_REPLACEMENT}" = "xyes"; then
+    AC_DEFINE([ENABLE_REPLACEMENT], 1, [use on-stack replacement])
+fi
+
+
 dnl check for loop optimization
 AC_MSG_CHECKING(whether loop optimization should be supported)
 AC_ARG_ENABLE([loop],
index 656f643f260da4df2df42fe37cc6ccbd1ac83c52..616397159c8358aaaff774525bfc594bbc662e41 100644 (file)
@@ -28,7 +28,7 @@
 ##
 ## Changes: Edwin Steiner
 ##
-## $Id: Makefile.am 5895 2006-11-03 14:03:40Z twisti $
+## $Id: Makefile.am 6265 2007-01-02 20:40:57Z edwin $
 
 ## Process this file with automake to produce Makefile.in
 
@@ -104,13 +104,14 @@ SCHEDULE_LIB = \
        schedule/libschedule.la
 endif
 
+REPLACE_SOURCES =
+
 if ENABLE_JIT
 REG_SOURCES = \
        reg.c \
        reg.h
 
-REPLACE_SOURCES = \
-       replace.c \
+REPLACE_SOURCES += \
        replace.h
 
 STACK_SOURCES = \
@@ -118,6 +119,11 @@ STACK_SOURCES = \
        stack.h
 endif
 
+if ENABLE_REPLACEMENT
+REPLACE_SOURCES += \
+       replace.c
+endif
+
 if WITH_BINUTILS_DISASSEMBLER
 DISASS_SOURCES = disass-common.c
 else
index f7df8260ebc9d022025c6764235fcb1d5666d50b..51065bdea68fb7d2770aec9475d538ee06953552 100644 (file)
@@ -31,7 +31,7 @@
             Christian Thalinger
                Edwin Steiner
 
-   $Id: asmpart.S 6147 2006-12-07 23:54:40Z edwin $
+   $Id: asmpart.S 6265 2007-01-02 20:40:57Z edwin $
 
 */
 
 
        .globl asm_patcher_wrapper
 
+#if defined(ENABLE_REPLACEMENT)
        .globl asm_replacement_out
        .globl asm_replacement_in
+#endif
 
        .globl asm_criticalsections
        .globl asm_getclassvalues_atomic
@@ -501,6 +503,8 @@ L_asm_patcher_wrapper_exception:
        .end    asm_patcher_wrapper
 
                
+#if defined(ENABLE_REPLACEMENT)
+
 /* asm_replacement_out *********************************************************
 
    This code is jumped to from the replacement-out stubs that are executed
@@ -741,6 +745,8 @@ asm_replacement_in:
 
        .end asm_replacement_in
 
+#endif /* defined(ENABLE_REPLACEMENT) */
+
 
        .ent    asm_getclassvalues_atomic
 
index cbb5bae993516ac6a9631a39d00fc40ca2c8c39d..1e60a40d1fa508d69d749a03655ec9400367e204 100644 (file)
@@ -467,6 +467,7 @@ void emit_patcher_stubs(jitdata *jd)
 
 *******************************************************************************/
 
+#if defined(ENABLE_REPLACEMENT)
 void emit_replacement_stubs(jitdata *jd)
 {
        codegendata *cd;
@@ -522,6 +523,7 @@ void emit_replacement_stubs(jitdata *jd)
                assert((cd->mcodeptr - savedmcodeptr) == 4*REPLACEMENT_STUB_SIZE);
        }
 }
+#endif /* defined(ENABLE_REPLACEMENT) */
 
 
 /* emit_verbosecall_enter ******************************************************
index 2db8ab28f2a4bd610172bde4d16dc76b6750a121..c3b6457fc132603f555b0da74aab0e2b2ba8045c 100644 (file)
@@ -30,7 +30,7 @@
             Christian Thalinger
             Edwin Steiner
 
-   $Id: md.c 6142 2006-12-07 23:02:52Z edwin $
+   $Id: md.c 6265 2007-01-02 20:40:57Z edwin $
 
 */
 
@@ -328,6 +328,7 @@ void md_icacheflush(u1 *addr, s4 nbytes)
 
 *******************************************************************************/
 
+#if defined(ENABLE_REPLACEMENT)
 void md_patch_replacement_point(codeinfo *code, s4 index, rplpoint *rp, u1 *savedmcode)
 {
        s4 disp;
@@ -364,6 +365,7 @@ void md_patch_replacement_point(codeinfo *code, s4 index, rplpoint *rp, u1 *save
        /* flush instruction cache */
     md_icacheflush(rp->pc,4);
 }
+#endif /* defined(ENABLE_REPLACEMENT) */
 
 /*
  * These are local overrides for various environment variables in Emacs.
index 1f5d5bca166bfe60bf8cf558b78a1262930ea1d5..ceb3edf4670b17690f4b6e211edc002dff459155 100644 (file)
@@ -30,7 +30,7 @@
    Changes: Christian Thalinger
             Edwin Steiner
 
-   $Id: asmpart.h 6147 2006-12-07 23:54:40Z edwin $
+   $Id: asmpart.h 6265 2007-01-02 20:40:57Z edwin $
 
 */
 
@@ -150,8 +150,10 @@ void intrp_asm_abstractmethoderror(void);
 void asm_patcher_wrapper(void);
 
 /* functions for on-stack replacement */
+#if defined(ENABLE_REPLACEMENT)
 void asm_replacement_out(void);
 void asm_replacement_in(executionstate_t *es, replace_safestack_t *st);
+#endif
 
 #if defined(ENABLE_THREADS)
 extern critical_section_node_t asm_criticalsections;
index 75fb6b344f08ff6bd60db1b78280640d61c85003..d106b8985e3f51b638c6777e65e30a77dd2cd973 100644 (file)
@@ -139,6 +139,7 @@ codeinfo *code_find_codeinfo_for_pc(u1 *pc)
   
 *******************************************************************************/
 
+#if defined(ENABLE_REPLACEMENT)
 int code_get_sync_slot_count(codeinfo *code)
 {
 #ifdef ENABLE_THREADS
@@ -173,6 +174,7 @@ int code_get_sync_slot_count(codeinfo *code)
 
 #endif /* ENABLE_THREADS */
 }
+#endif /* defined(ENABLE_REPLACEMENT) */
 
 
 /* code_get_stack_frame_size ***************************************************
@@ -196,6 +198,7 @@ int code_get_sync_slot_count(codeinfo *code)
   
 *******************************************************************************/
 
+#if defined(ENABLE_REPLACEMENT)
 int code_get_stack_frame_size(codeinfo *code)
 {
 #if 0
@@ -241,6 +244,7 @@ int code_get_stack_frame_size(codeinfo *code)
 
        return code->stackframesize;
 }
+#endif /* defined(ENABLE_REPLACEMENT) */
 
 
 /* code_codeinfo_free **********************************************************
@@ -260,7 +264,9 @@ void code_codeinfo_free(codeinfo *code)
        if (code->mcode != NULL)
                CFREE((void *) (ptrint) code->mcode, code->mcodelength);
 
+#if defined(ENABLE_REPLACEMENT)
        replace_free_replacement_points(code);
+#endif
 
        FREE(code, codeinfo);
 
index a8e4708441c810c41f5439e1b9bb842e1414f782..60ad5147e9d3d7877d3e61a0a48e6e4a0272e8a1 100644 (file)
@@ -79,6 +79,7 @@ struct codeinfo {
        s4            mcodelength;          /* length of generated machine code   */
 
        /* replacement */                                   
+#if defined(ENABLE_REPLACEMENT)
        rplpoint     *rplpoints;            /* replacement points                 */
        rplalloc     *regalloc;             /* register allocation info           */
        u1           *replacementstubs;     /* beginning of replacement stubs     */
@@ -90,6 +91,7 @@ struct codeinfo {
        u1            savedintcount;        /* number of callee saved int regs    */
        u1            savedfltcount;        /* number of callee saved flt regs    */
        u1           *savedmcode;           /* saved code under patches           */
+#endif /* defined(ENABLE_REPLACEMENT) */
 
        u4            frequency;            /* number of method invocations       */
        u4           *bbfrequency;                  
@@ -118,8 +120,10 @@ void code_codeinfo_free(codeinfo *code);
 
 codeinfo *code_find_codeinfo_for_pc(u1 *pc);
 
+#if defined(ENABLE_REPLACEMENT)
 int code_get_sync_slot_count(codeinfo *code);
 int code_get_stack_frame_size(codeinfo *code);
+#endif /* defined(ENABLE_REPLACEMENT) */
 
 void code_free_code_of_method(methodinfo *m);
 
index 221ab72f0a511df6731f4bdaad357a3adc9c9cd7..b1edbe18adf45d448979cdb1803c29371d24c130 100644 (file)
@@ -47,7 +47,7 @@
    memory. All functions writing values into the data area return the offset
    relative the begin of the code area (start of procedure).   
 
-   $Id: codegen-common.c 6251 2006-12-27 23:15:56Z twisti $
+   $Id: codegen-common.c 6265 2007-01-02 20:40:57Z edwin $
 
 */
 
@@ -628,6 +628,7 @@ u1 *codegen_get_pv_from_pc_nocheck(u1 *pc)
 
 *******************************************************************************/
 
+#if defined(ENABLE_REPLACEMENT)
 #if !defined(NDEBUG)
 void codegen_set_replacement_point_notrap(codegendata *cd, s4 type)
 #else
@@ -642,6 +643,7 @@ void codegen_set_replacement_point_notrap(codegendata *cd)
 
        cd->replacementpoint++;
 }
+#endif /* defined(ENABLE_REPLACEMENT) */
 
 
 /* codegen_set_replacement_point ***********************************************
@@ -650,6 +652,7 @@ void codegen_set_replacement_point_notrap(codegendata *cd)
 
 *******************************************************************************/
 
+#if defined(ENABLE_REPLACEMENT)
 #if !defined(NDEBUG)
 void codegen_set_replacement_point(codegendata *cd, s4 type)
 #else
@@ -668,6 +671,7 @@ void codegen_set_replacement_point(codegendata *cd)
 
        cd->lastmcodeptr = cd->mcodeptr + PATCHER_CALL_SIZE;
 }
+#endif /* defined(ENABLE_REPLACEMENT) */
 
 
 /* codegen_finish **************************************************************
@@ -814,6 +818,7 @@ void codegen_finish(jitdata *jd)
                *((ptrint *) ((ptrint) epoint + cd->linenumbertablesizepos)) = lrtlen;
        }
 
+#if defined(ENABLE_REPLACEMENT)
        /* replacement point resolving */
        {
                int i;
@@ -826,6 +831,7 @@ void codegen_finish(jitdata *jd)
                        rp->pc = (u1*) ((ptrint) epoint + (ptrint) rp->pc);
                }
        }
+#endif /* defined(ENABLE_REPLACEMENT) */
 
        /* add method into methodtree to find the entrypoint */
 
index 308e9b74ed39ee3b8d633d83aa887a6a99b14568..649665b95ef405459de174e54c31caab9a5ec2ca 100644 (file)
@@ -28,7 +28,7 @@
             Christian Ullrich
             Edwin Steiner
 
-   $Id: codegen-common.h 6091 2006-11-29 20:44:10Z twisti $
+   $Id: codegen-common.h 6265 2007-01-02 20:40:57Z edwin $
 
 */
 
@@ -152,7 +152,9 @@ struct codegendata {
        s4              maxstack;
        s4              stackframesize;    /* stackframe size of this method      */
 
+#if defined(ENABLE_REPLACEMENT)
        rplpoint       *replacementpoint;  /* current replacement point           */
+#endif
 };
 
 
@@ -258,6 +260,7 @@ void codegen_insertmethod(u1 *startpc, u1 *endpc);
 u1 *codegen_get_pv_from_pc(u1 *pc);
 u1 *codegen_get_pv_from_pc_nocheck(u1 *pc);
 
+#if defined(ENABLE_REPLACEMENT)
 #if !defined(NDEBUG)
 void codegen_set_replacement_point_notrap(codegendata *cd, s4 type);
 void codegen_set_replacement_point(codegendata *cd, s4 type);
@@ -265,6 +268,7 @@ void codegen_set_replacement_point(codegendata *cd, s4 type);
 void codegen_set_replacement_point_notrap(codegendata *cd);
 void codegen_set_replacement_point(codegendata *cd);
 #endif
+#endif /* defined(ENABLE_REPLACEMENT) */
 
 void codegen_finish(jitdata *jd);
 
index 3e16940cc2d4bfcb4f77a7866578e5553a16f076..605ac6be2001c9fd40015e42009f5db609cc8135 100644 (file)
@@ -31,7 +31,7 @@
    Changes: Joseph Wenninger
             Edwin Steiner
 
-   $Id: asmpart.S 6155 2006-12-08 00:17:11Z edwin $
+   $Id: asmpart.S 6265 2007-01-02 20:40:57Z edwin $
 
 */
 
 
        .globl asm_patcher_wrapper
 
+#if defined(ENABLE_REPLACEMENT)
        .globl asm_replacement_out
        .globl asm_replacement_in
+#endif
 
        .globl asm_builtin_f2i
        .globl asm_builtin_f2l
@@ -500,6 +502,7 @@ L_asm_patcher_wrapper_exception:
        pop     xpc                         /* get and remove return address      */
        jmp     L_asm_handle_exception
 
+#if defined(ENABLE_REPLACEMENT)
 
 /* asm_replacement_out *********************************************************
 
@@ -604,6 +607,8 @@ asm_replacement_in:
        /* jump to new code, hold your thumbs! ;) */
        ret
 
+#endif /* defined(ENABLE_REPLACEMENT) */
+
 
 /************************ function asm_builtin_x2x *****************************
 *                                                                              *
index 21544051bc402322b1eb5be5c44d5383721bb2d8..5a321b6e1cc73deac17a76c5bed8d0d26823c800 100644 (file)
@@ -26,7 +26,7 @@
 
    Authors: Christian Thalinger
 
-   $Id: emit.c 6171 2006-12-11 11:47:42Z twisti $
+   $Id: emit.c 6265 2007-01-02 20:40:57Z edwin $
 
 */
 
@@ -539,6 +539,7 @@ void emit_patcher_stubs(jitdata *jd)
 
 *******************************************************************************/
 
+#if defined(ENABLE_REPLACEMENT)
 void emit_replacement_stubs(jitdata *jd)
 {
        codegendata *cd;
@@ -589,6 +590,7 @@ void emit_replacement_stubs(jitdata *jd)
                assert((cd->mcodeptr - savedmcodeptr) == REPLACEMENT_STUB_SIZE);
        }
 }
+#endif /* defined(ENABLE_REPLACEMENT) */
        
 
 /* emit_verbosecall_enter ******************************************************
index 9080ac09779c3134f83f134ee822ca55066e640e..4accdd911b205dbfdac16b4d2da38d150dd137a4 100644 (file)
@@ -27,7 +27,7 @@
    Authors: Christian Thalinger
             Edwin Steiner
 
-   $Id: md.c 6142 2006-12-07 23:02:52Z edwin $
+   $Id: md.c 6265 2007-01-02 20:40:57Z edwin $
 
 */
 
@@ -248,6 +248,7 @@ void md_dcacheflush(u1 *addr, s4 nbytes)
 
 *******************************************************************************/
 
+#if defined(ENABLE_REPLACEMENT)
 void md_patch_replacement_point(codeinfo *code, s4 index, rplpoint *rp, u1 *savedmcode)
 {
        s4 disp;
@@ -297,6 +298,7 @@ void md_patch_replacement_point(codeinfo *code, s4 index, rplpoint *rp, u1 *save
                        
     /* XXX if required asm_cacheflush(rp->pc,8); */
 }
+#endif /* defined(ENABLE_REPLACEMENT) */
 
 /*
  * These are local overrides for various environment variables in Emacs.
index de45e2d222e0dfd9bc6412fc91291e66660c45c5..bd8b0482bad8afdc934a4467990851146329f1bb 100644 (file)
@@ -29,7 +29,7 @@
             Christian Thalinger
             Edwin Steiner
 
-   $Id: jit.h 6211 2006-12-16 22:53:24Z edwin $
+   $Id: jit.h 6265 2007-01-02 20:40:57Z edwin $
 
 */
 
@@ -431,7 +431,9 @@ struct insinfo_inline {
        s4         *javalocals_end;   /* javalocals after inlined body            */
 
        /* fields set by replacement point creation ------------------------------*/
+#if defined(ENABLE_REPLACEMENT)
        rplpoint   *rp;             /* replacement point at INLINE_START          */
+#endif
 
        /* fields set by the codegen ---------------------------------------------*/
        s4          startmpc;       /* machine code offset of start of inlining   */
index dd6e54e1c71a23d3cf971e4015f1f107be6fc297..0aa1f5cf2a96b5be2828ae72dae58d4db913c78d 100644 (file)
@@ -29,7 +29,7 @@
    Changes: Christian Thalinger
             Edwin Steiner
 
-   $Id: asmpart.S 5930 2006-11-06 21:12:52Z twisti $
+   $Id: asmpart.S 6265 2007-01-02 20:40:57Z edwin $
 
 */
 
 
        .globl asm_patcher_wrapper
 
+#if defined(ENABLE_REPLACEMENT)
        .globl asm_replacement_out
        .globl asm_replacement_in
+#endif
 
        .globl asm_getclassvalues_atomic
        .globl asm_criticalsections
@@ -536,6 +538,7 @@ L_asm_patcher_wrapper_exception:
 
        .end    asm_patcher_wrapper
 
+#if defined(ENABLE_REPLACEMENT)
                
 /* asm_replacement_out *********************************************************
 
@@ -752,6 +755,8 @@ asm_replacement_in:
 
        .end asm_replacement_in
 
+#endif /* defined(ENABLE_REPLACEMENT) */
+
 
        .ent    asm_getclassvalues_atomic
 
index 1f64afe1f658754f6e98b8ff443acd04d22d0472..d9ef34e85a17e10f239985a472ef76117df9b5b2 100644 (file)
@@ -666,6 +666,7 @@ void emit_patcher_stubs(jitdata *jd)
 
 *******************************************************************************/
 
+#if defined(ENABLE_REPLACEMENT)
 void emit_replacement_stubs(jitdata *jd)
 {
        codegendata *cd;
@@ -722,6 +723,7 @@ void emit_replacement_stubs(jitdata *jd)
                assert((cd->mcodeptr - savedmcodeptr) == 4*REPLACEMENT_STUB_SIZE);
        }
 }
+#endif /* defined(ENABLE_REPLACEMENT) */
 
 
 /* emit_verbosecall_enter ******************************************************
index e9eed202b16e4c7dce53574fd7f61013ba7f46ef..2a9fa3c44a1c3eea9741729fd1a091809d7a39a7 100644 (file)
@@ -27,7 +27,7 @@
    Authors: Christian Thalinger
             Edwin Steiner
 
-   $Id: md.c 6180 2006-12-11 23:29:26Z twisti $
+   $Id: md.c 6265 2007-01-02 20:40:57Z edwin $
 
 */
 
@@ -341,6 +341,7 @@ void md_dcacheflush(u1 *addr, s4 nbytes)
 
 *******************************************************************************/
 
+#if defined(ENABLE_REPLACEMENT)
 void md_patch_replacement_point(codeinfo *code, s4 index, rplpoint *rp,
                                                                u1 *savedmcode)
 {
@@ -391,6 +392,7 @@ void md_patch_replacement_point(codeinfo *code, s4 index, rplpoint *rp,
        /* flush instruction cache */
     md_icacheflush(rp->pc,2*4);
 }
+#endif /* defined(ENABLE_REPLACEMENT) */
 
 /*
  * These are local overrides for various environment variables in Emacs.
index a415963a727ea32f81132c39e0dc6482cbcc5fbf..296abcfdb5ace557b397c5a87bf6129d6b4e9970 100644 (file)
@@ -31,7 +31,7 @@
    Changes: Christian Thalinger
             Edwin Steiner
 
-   $Id: asmpart.S 6182 2006-12-12 21:12:23Z twisti $
+   $Id: asmpart.S 6265 2007-01-02 20:40:57Z edwin $
 
 */
 
 
        .globl asm_patcher_wrapper
 
+#if defined(ENABLE_REPLACEMENT)
        .globl asm_replacement_out
        .globl asm_replacement_in
+#endif
 
        .globl asm_cacheflush
        .globl asm_criticalsections
@@ -1124,6 +1126,7 @@ L_asm_patcher_wrapper_exception:
        addi    sp,sp,8*4+LA_SIZE+(5+58)*4
        b       L_asm_handle_exception
 
+#if defined(ENABLE_REPLACEMENT)
 
 /* asm_replacement_out *********************************************************
 
@@ -1367,6 +1370,8 @@ asm_replacement_in:
        mtctr   itmp3
        bctr
 
+#endif /* defined(ENABLE_REPLACEMENT) */
+
 /*********************************************************************/
 
 asm_cacheflush:
index a4f75ceaa531f19a5584b9c50c030ee2c4dce2aa..4b5aa15706eb12074f44ddeb5b849b7f38c19e11 100644 (file)
@@ -525,6 +525,7 @@ void emit_patcher_stubs(jitdata *jd)
 
 *******************************************************************************/
 
+#if defined(ENABLE_REPLACEMENT)
 void emit_replacement_stubs(jitdata *jd)
 {
        codegendata *cd;
@@ -581,6 +582,7 @@ void emit_replacement_stubs(jitdata *jd)
                assert((cd->mcodeptr - savedmcodeptr) == 4*REPLACEMENT_STUB_SIZE);
        }
 }
+#endif /* defined(ENABLE_REPLACEMENT) */
 
 
 /* emit_verbosecall_enter ******************************************************
index 3b7d6faa7c0f3510505fc4f099c8d11af1c12d5a..8e6b0e84f792b95e46cd022b88cc30c502577ab6 100644 (file)
@@ -27,7 +27,7 @@
    Authors: Christian Thalinger
             Edwin Steiner
 
-   $Id: md.c 6142 2006-12-07 23:02:52Z edwin $
+   $Id: md.c 6265 2007-01-02 20:40:57Z edwin $
 
 */
 
@@ -332,6 +332,7 @@ void md_dcacheflush(u1 *addr, s4 nbytes)
 
 *******************************************************************************/
 
+#if defined(ENABLE_REPLACEMENT)
 void md_patch_replacement_point(codeinfo *code, s4 index, rplpoint *rp, u1 *savedmcode)
 {
        s4 disp;
@@ -367,6 +368,7 @@ void md_patch_replacement_point(codeinfo *code, s4 index, rplpoint *rp, u1 *save
        /* flush instruction cache */
     md_icacheflush(rp->pc,4);
 }
+#endif /* defined(ENABLE_REPLACEMENT) */
 
 /*
  * These are local overrides for various environment variables in Emacs.
index b500d5b253d9eaf181f22138cd7031a34e6ebb25..6ab2a0be04a6a916cee98f76c185aa20760ed8a9 100644 (file)
@@ -29,7 +29,7 @@
    Changes: Christian Thalinger
             Edwin Steiner
 
-   $Id: asmpart.S 6100 2006-12-01 11:38:47Z tbfg $
+   $Id: asmpart.S 6265 2007-01-02 20:40:57Z edwin $
 
 */
 
 
        .globl asm_patcher_wrapper
 
+#if defined(ENABLE_REPLACEMENT)
        .globl asm_replacement_out
        .globl .asm_replacement_in
+#endif
 
        .globl .asm_cacheflush          /* no function descriptor needed, only called direct */
        .globl asm_criticalsections
@@ -1071,6 +1073,7 @@ L_asm_patcher_wrapper_exception:
        addi    sp,sp,LA_SIZE+PA_SIZE+ARG_CNT*8+TMP_CNT*8+4*8+8*8
        b       L_asm_handle_exception
 
+#if defined(ENABLE_REPLACEMENT)
 
 /* asm_replacement_out *********************************************************
 
@@ -1285,6 +1288,8 @@ asm_replacement_out:
        mtctr   itmp3
        bctr
 
+#endif /* defined(ENABLE_REPLACEMENT) */
+
 /* asm_cacheflush **************************************************************
        copied from linux/arch/ppc64/kernel/vdso64/cacheflush.S
        assumes 128 byte cache line size.
index 348f561007cf9b3e621973dc2baf93a71dbd4e41..5244ce8125943c1e939038092774478d9a1b729a 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes: Edwin Steiner
 
-   $Id: md.c 6142 2006-12-07 23:02:52Z edwin $
+   $Id: md.c 6265 2007-01-02 20:40:57Z edwin $
 
 */
 
@@ -320,6 +320,7 @@ void md_dcacheflush(u1 *addr, s4 nbytes)
 
 *******************************************************************************/
 
+#if defined(ENABLE_REPLACEMENT)
 void md_patch_replacement_point(codeinfo *code, s4 index, rplpoint *rp, u1 *savedmcode)
 {
        s4 disp;
@@ -355,6 +356,7 @@ void md_patch_replacement_point(codeinfo *code, s4 index, rplpoint *rp, u1 *save
        /* flush instruction cache */
     md_icacheflush(rp->pc,4);
 }
+#endif /* defined(ENABLE_REPLACEMENT) */
 
 /*
  * These are local overrides for various environment variables in Emacs.
index 3f35448c987753827481215f7ae1818348eb3ac3..6cac73679a59567f7453acbf9e279dc9d15b2497 100644 (file)
 #ifndef _REPLACE_H
 #define _REPLACE_H
 
+#include "config.h"
+#include "vm/types.h"
+
+#if defined(ENABLE_REPLACEMENT)
+
 /* forward typedefs ***********************************************************/
 
 typedef struct rplpoint rplpoint;
@@ -45,9 +50,6 @@ typedef struct sourceframe_t sourceframe_t;
 typedef struct replace_safestack_t replace_safestack_t;
 typedef union  replace_val_t replace_val_t;
 
-#include "config.h"
-#include "vm/types.h"
-
 #include "arch.h"
 #include "md-abi.h"
 
@@ -285,6 +287,22 @@ void md_patch_replacement_point(codeinfo *code, s4 index, rplpoint *rp,
                                                                u1 *savedmcode);
 #endif
 
+#else /* !defined(ENABLE_REPLACEMENT) */
+
+/*** macros for the codegens (disabled version) ************************/
+
+#define REPLACEMENT_POINTS_INIT(cd, jd)
+#define REPLACEMENT_POINTS_RESET(cd, jd)
+#define REPLACEMENT_POINT_BLOCK_START(cd, bptr)
+#define REPLACEMENT_POINT_INLINE_START(cd, iptr)
+#define REPLACEMENT_POINT_INLINE_BODY(cd, iptr)
+#define REPLACEMENT_POINT_RETURN(cd, iptr)
+#define REPLACEMENT_POINT_INVOKE(cd, iptr)
+#define REPLACEMENT_POINT_INVOKE_RETURN(cd, iptr)
+#define REPLACEMENT_EMIT_STUBS(jd)
+
+#endif /* defined(ENABLE_REPLACEMENT) */
+
 #endif
 
 /*
index 107327ae727212e5858729ef6bc6809946c1435c..4410e3f7384a8799d0f470a40cca8bd86d69318e 100644 (file)
@@ -345,11 +345,13 @@ void show_method(jitdata *jd, int stage)
                printf("\n");
        }
 
+#if defined(ENABLE_REPLACEMENT)
        if (code->rplpoints) {
                printf("Replacement Points:\n");
                replace_show_replacement_points(code);
                printf("\n");
        }
+#endif /* defined(ENABLE_REPLACEMENT) */
 
 #if defined(ENABLE_DISASSEMBLER)
        /* show code before first basic block */
@@ -470,7 +472,10 @@ void show_basicblock(jitdata *jd, basicblock *bptr, int stage)
                }
 
                printf("======== %sL%03d ======== %s(flags: %d, bitflags: %01x, next: %d, type: ",
-                               (bptr->bitflags & BBFLAG_REPLACEMENT) ? "<REPLACE> " : "",
+#if defined(ENABLE_REPLACEMENT)
+                               (bptr->bitflags & BBFLAG_REPLACEMENT) ? "<REPLACE> " : 
+#endif
+                                                                                                               "",
                           bptr->nr, 
                           (deadcode && stage >= SHOW_STACK) ? "DEADCODE! " : "",
                           bptr->flags, bptr->bitflags, 
index 3fbb5b14150d21bf222267ae14cee9d15d08a544..0a431ceee29f8ddba56e292a53b49c53cdd75418 100644 (file)
@@ -364,9 +364,11 @@ void emit_patcher_stubs(jitdata *jd)
 
 *******************************************************************************/
 
+#if defined(ENABLE_REPLACEMENT)
 void emit_replacement_stubs(jitdata *jd)
 {
 }
+#endif /* defined(ENABLE_REPLACEMENT) */
 
 /* emit_verbosecall_enter ******************************************************
 
index fcffddb88f55ac2f96b68322a488cff5f17d1b26..86bf5bc82c56ece345c177a012feb1c31920bb92 100644 (file)
@@ -338,6 +338,7 @@ void md_dcacheflush(u1 *addr, s4 nbytes)
 
 *******************************************************************************/
 
+#if defined(ENABLE_REPLACEMENT)
 void md_patch_replacement_point(codeinfo *code, s4 index, rplpoint *rp, u1 *savedmcode)
 {
        s4 disp;
@@ -376,6 +377,7 @@ void md_patch_replacement_point(codeinfo *code, s4 index, rplpoint *rp, u1 *save
        /* flush instruction cache */
     /* md_icacheflush(rp->pc,4); */
 }
+#endif /* defined(ENABLE_REPLACEMENT) */
 
 /*
  * These are local overrides for various environment variables in Emacs.
index 12227a19053d0638d0af3250f68c15b8948f8aa6..2f227e5a8e7767544360a4ca1af1ee7cccea98fd 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes: Edwin Steiner
 
-   $Id: genoffsets.c 5950 2006-11-11 17:08:14Z edwin $
+   $Id: genoffsets.c 6265 2007-01-02 20:40:57Z edwin $
 
 */
 
@@ -58,7 +58,10 @@ int main(int argc, char **argv)
 
        printf("#define sizevmarg                  %3d\n", (s4) sizeof(vm_arg));
        printf("#define sizestackframeinfo         %3d\n", (s4) sizeof(stackframeinfo));
+
+#if defined(ENABLE_REPLACEMENT)
        printf("#define sizeexecutionstate         %3d\n", (s4) sizeof(executionstate_t));
+#endif
 
     printf("\n\n/* define some offsets */\n\n");
 
@@ -82,11 +85,13 @@ int main(int argc, char **argv)
        printf("#define offcast_super_diffval      %3d\n", (s4) OFFSET(castinfo, super_diffval));
        printf("#define offcast_sub_baseval        %3d\n", (s4) OFFSET(castinfo, sub_baseval));
 
+#if defined(ENABLE_REPLACEMENT)
        printf("#define offes_pc                   %3d\n", (s4) OFFSET(executionstate_t, pc));
        printf("#define offes_sp                   %3d\n", (s4) OFFSET(executionstate_t, sp));
        printf("#define offes_pv                   %3d\n", (s4) OFFSET(executionstate_t, pv));
        printf("#define offes_intregs              %3d\n", (s4) OFFSET(executionstate_t, intregs));
        printf("#define offes_fltregs              %3d\n", (s4) OFFSET(executionstate_t, fltregs));
+#endif /* defined(ENABLE_REPLACEMENT) */
 
        /* everything is ok */
 
index b78e47dfae25bbc0fe4834b5ebdddba7d00ef122..ae9b9ed4da75191152d39b98d6ccebab35b7ee4a 100644 (file)
@@ -30,7 +30,7 @@
 
    Changes: Edwin Steiner
 
-   $Id: asmpart.S 6147 2006-12-07 23:54:40Z edwin $
+   $Id: asmpart.S 6265 2007-01-02 20:40:57Z edwin $
 
 */
 
 
        .globl asm_patcher_wrapper
 
+#if defined(ENABLE_REPLACEMENT)
        .globl asm_replacement_out
        .globl asm_replacement_in
+#endif
 
        .globl asm_builtin_f2i
        .globl asm_builtin_f2l
@@ -566,6 +568,7 @@ L_asm_patcher_wrapper_exception:
        pop     xpc                         /* get and remove return address      */
        jmp     L_asm_handle_exception
 
+#if defined(ENABLE_REPLACEMENT)
 
 /* asm_replacement_out *********************************************************
 
@@ -717,6 +720,8 @@ asm_replacement_in:
        /* jump to new code */
        ret
 
+#endif /* defined(ENABLE_REPLACEMENT) */
+
 
 /* asm_builtin_x2x *************************************************************
 *                                                                              *
index f22aa41032e3259c70a6b22481067208bd3852bd..9ae2f6de2b0c90ae6e50c64dd2010bc1e3b66358 100644 (file)
@@ -26,7 +26,7 @@
 
    Authors: Christian Thalinger
 
-   $Id: emit.c 6171 2006-12-11 11:47:42Z twisti $
+   $Id: emit.c 6265 2007-01-02 20:40:57Z edwin $
 
 */
 
@@ -460,6 +460,7 @@ void emit_patcher_stubs(jitdata *jd)
 
 *******************************************************************************/
 
+#if defined(ENABLE_REPLACEMENT)
 void emit_replacement_stubs(jitdata *jd)
 {
        codegendata *cd;
@@ -512,6 +513,7 @@ void emit_replacement_stubs(jitdata *jd)
                assert((cd->mcodeptr - savedmcodeptr) == REPLACEMENT_STUB_SIZE);
        }
 }
+#endif /* defined(ENABLE_REPLACEMENT) */
 
 
 /* emit_verbosecall_enter ******************************************************
index cb81f3a8ae61ff36d45e81f5e7f7bb21aea051d1..958bd78a964d176b4686a77a589fb58f9661c378 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes: Edwin Steiner
 
-   $Id: md.c 6142 2006-12-07 23:02:52Z edwin $
+   $Id: md.c 6265 2007-01-02 20:40:57Z edwin $
 
 */
 
@@ -378,6 +378,7 @@ void md_dcacheflush(u1 *addr, s4 nbytes)
 
 *******************************************************************************/
 
+#if defined(ENABLE_REPLACEMENT)
 void md_patch_replacement_point(codeinfo *code, s4 index, rplpoint *rp, u1 *savedmcode)
 {
        s4 disp;
@@ -427,6 +428,7 @@ void md_patch_replacement_point(codeinfo *code, s4 index, rplpoint *rp, u1 *save
                        
     /* XXX if required asm_cacheflush(rp->pc,8); */
 }
+#endif /* defined(ENABLE_REPLACEMENT) */
 
 /*
  * These are local overrides for various environment variables in Emacs.