* src/vm/jit/emit-common.h (emit_replacement_stubs): Removed.
* src/vm/jit/arm/emit.c,
* src/vm/jit/arm/codegen.c,
* src/vm/jit/powerpc/emit.c,
* src/vm/jit/powerpc/codegen.c,
* src/vm/jit/sparc64/emit.c,
* src/vm/jit/sparc64/codegen.c,
* src/vm/jit/alpha/emit.c,
* src/vm/jit/alpha/codegen.c,
* src/vm/jit/s390/emit.c,
* src/vm/jit/mips/emit.c,
* src/vm/jit/mips/codegen.c,
* src/vm/jit/m68k/codegen.c,
* src/vm/jit/powerpc64/emit.c,
* src/vm/jit/powerpc64/codegen.c,
* src/vm/jit/i386/emit.c,
* src/vm/jit/i386/codegen.c,
* src/vm/jit/x86_64/emit.c,
* src/vm/jit/x86_64/codegen.c
(emit_replacement_stubs): Removed.
(codegen_emit): Do not create replacement stubs anymore.
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: codegen.c 8186 2007-07-05 23:48:16Z michi $
+ $Id: codegen.c 8211 2007-07-18 19:52:23Z michi $
*/
dseg_createlinenumbertable(cd);
- /* generate stubs */
+ /* generate traps */
emit_patcher_traps(jd);
- REPLACEMENT_EMIT_STUBS(jd);
/* everything's ok */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: emit.c 8186 2007-07-05 23:48:16Z michi $
+ $Id: emit.c 8211 2007-07-18 19:52:23Z michi $
*/
}
-/* emit_replacement_stubs ******************************************************
-
- Generates the code for the replacement stubs.
-
-*******************************************************************************/
-
-#if defined(ENABLE_REPLACEMENT)
-void emit_replacement_stubs(jitdata *jd)
-{
- codegendata *cd;
- codeinfo *code;
- rplpoint *rplp;
- s4 disp;
- s4 i;
-#if !defined(NDEBUG)
- u1 *savedmcodeptr;
-#endif
-
- /* get required compiler data */
-
- cd = jd->cd;
- code = jd->code;
-
- rplp = code->rplpoints;
-
- /* store beginning of replacement stubs */
-
- code->replacementstubs = (u1*) (cd->mcodeptr - cd->mcodebase);
-
- for (i = 0; i < code->rplpointcount; ++i, ++rplp) {
- /* do not generate stubs for non-trappable points */
-
- if (rplp->flags & RPLPOINT_FLAG_NOTRAP)
- continue;
-
- /* check code segment size */
-
- MCODECHECK(100);
-
-#if !defined(NDEBUG)
- savedmcodeptr = cd->mcodeptr;
-#endif
-
- /* create stack frame - 16-byte aligned */
-
- M_LSUB_IMM(REG_SP, 2 * 8, REG_SP);
-
- /* push address of `rplpoint` struct */
-
- disp = dseg_add_address(cd, rplp);
- M_ALD(REG_ITMP3, REG_PV, disp);
- M_AST(REG_ITMP3, REG_SP, 0 * 8);
-
- /* jump to replacement function */
-
- disp = dseg_add_functionptr(cd, asm_replacement_out);
- M_ALD(REG_ITMP3, REG_PV, disp);
- M_JMP(REG_ZERO, REG_ITMP3);
-
- assert((cd->mcodeptr - savedmcodeptr) == 4*REPLACEMENT_STUB_SIZE);
- }
-}
-#endif /* defined(ENABLE_REPLACEMENT) */
-
-
/* emit_verbosecall_enter ******************************************************
Generates the code for the call trace.
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: codegen.c 8182 2007-07-05 20:36:16Z michi $
+ $Id: codegen.c 8211 2007-07-18 19:52:23Z michi $
*/
dseg_createlinenumbertable(cd);
- /* generate stubs */
+ /* generate traps */
emit_patcher_traps(jd);
- REPLACEMENT_EMIT_STUBS(jd);
/* everything's ok */
}
-/* emit_replacement_stubs ******************************************************
-
- Generates the code for the replacement stubs.
-
-*******************************************************************************/
-
-#if defined(ENABLE_REPLACEMENT)
-void emit_replacement_stubs(jitdata *jd)
-{
- codegendata *cd;
- codeinfo *code;
- rplpoint *rplp;
- u1 *savedmcodeptr;
- s4 disp;
- s4 i;
-
- /* get required compiler data */
-
- cd = jd->cd;
- code = jd->code;
-}
-#endif /* defined(ENABLE_REPLACEMENT) */
-
-
/* emit_verbosecall_enter ******************************************************
Generates the code for the call trace.
void emit_patcher_stubs(jitdata *jd);
void emit_patcher_traps(jitdata *jd);
-#if defined(ENABLE_REPLACEMENT)
-void emit_replacement_stubs(jitdata *jd);
-#endif
void emit_verbosecall_enter(jitdata *jd);
void emit_verbosecall_exit(jitdata *jd);
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: codegen.c 8210 2007-07-18 12:51:00Z twisti $
+ $Id: codegen.c 8211 2007-07-18 19:52:23Z michi $
*/
/* generate stubs */
emit_patcher_stubs(jd);
- REPLACEMENT_EMIT_STUBS(jd);
/* everything's ok */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: emit.c 8210 2007-07-18 12:51:00Z twisti $
+ $Id: emit.c 8211 2007-07-18 19:52:23Z michi $
*/
}
-/* emit_replacement_stubs ******************************************************
-
- Generates the code for the replacement stubs.
-
-*******************************************************************************/
-
-#if defined(ENABLE_REPLACEMENT)
-void emit_replacement_stubs(jitdata *jd)
-{
- codegendata *cd;
- codeinfo *code;
- rplpoint *rplp;
- s4 i;
- s4 branchmpc;
- s4 outcode;
-
- /* get required compiler data */
-
- cd = jd->cd;
- code = jd->code;
-
- rplp = code->rplpoints;
-
- /* store beginning of replacement stubs */
-
- code->replacementstubs = (u1*) (cd->mcodeptr - cd->mcodebase);
-
- for (i = 0; i < code->rplpointcount; ++i, ++rplp) {
- /* do not generate stubs for non-trappable points */
-
- if (rplp->flags & RPLPOINT_FLAG_NOTRAP)
- continue;
-
- /* check code segment size */
-
- MCODECHECK(512);
-
- /* note start of stub code */
-
- outcode = (s4) (cd->mcodeptr - cd->mcodebase);
-
- /* push address of `rplpoint` struct */
-
- M_PUSH_IMM(rplp);
-
- /* jump to replacement function */
-
- M_PUSH_IMM(asm_replacement_out);
- M_RET;
-
- /* add jump reference for COUNTDOWN points */
-
- if (rplp->flags & RPLPOINT_FLAG_COUNTDOWN) {
-
- branchmpc = (s4)rplp->pc + (7 + 6);
-
- md_codegen_patch_branch(cd, branchmpc, (s4) outcode);
- }
-
- assert(((cd->mcodeptr - cd->mcodebase) - outcode) == REPLACEMENT_STUB_SIZE);
- }
-}
-#endif /* defined(ENABLE_REPLACEMENT) */
-
-
/* emit_verbosecall_enter ******************************************************
Generates the code for the call trace.
/* generate stubs */
emit_patcher_stubs(jd);
- REPLACEMENT_EMIT_STUBS(jd);
return true;
}
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: codegen.c 8123 2007-06-20 23:50:55Z michi $
+ $Id: codegen.c 8211 2007-07-18 19:52:23Z michi $
*/
/* generate stubs */
emit_patcher_stubs(jd);
- REPLACEMENT_EMIT_STUBS(jd);
/* everything's ok */
}
-/* emit_replacement_stubs ******************************************************
-
- Generates the code for the replacement stubs.
-
-*******************************************************************************/
-
-#if defined(ENABLE_REPLACEMENT)
-void emit_replacement_stubs(jitdata *jd)
-{
- codegendata *cd;
- codeinfo *code;
- rplpoint *rplp;
- s4 disp;
- s4 i;
-#if !defined(NDEBUG)
- u1 *savedmcodeptr;
-#endif
-
- /* get required compiler data */
-
- cd = jd->cd;
- code = jd->code;
-
- rplp = code->rplpoints;
-
- /* store beginning of replacement stubs */
-
- code->replacementstubs = (u1*) (cd->mcodeptr - cd->mcodebase);
-
- for (i = 0; i < code->rplpointcount; ++i, ++rplp) {
- /* do not generate stubs for non-trappable points */
-
- if (rplp->flags & RPLPOINT_FLAG_NOTRAP)
- continue;
-
- /* check code segment size */
-
- MCODECHECK(100);
-
-#if !defined(NDEBUG)
- savedmcodeptr = cd->mcodeptr;
-#endif
-
- /* create stack frame - 16-byte aligned */
-
- M_ASUB_IMM(REG_SP, 2 * 8, REG_SP);
-
- /* push address of `rplpoint` struct */
-
- disp = dseg_add_address(cd, rplp);
- M_ALD(REG_ITMP3, REG_PV, disp);
- M_AST(REG_ITMP3, REG_SP, 0 * 8);
-
- /* jump to replacement function */
-
- disp = dseg_add_functionptr(cd, asm_replacement_out);
- M_ALD(REG_ITMP3, REG_PV, disp);
- M_JMP(REG_ITMP3);
- M_NOP; /* delay slot */
-
- assert((cd->mcodeptr - savedmcodeptr) == 4*REPLACEMENT_STUB_SIZE);
- }
-}
-#endif /* defined(ENABLE_REPLACEMENT) */
-
-
/* emit_verbosecall_enter ******************************************************
Generates the code for the call trace.
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: codegen.c 8196 2007-07-11 13:54:21Z twisti $
+ $Id: codegen.c 8211 2007-07-18 19:52:23Z michi $
*/
/* generate stubs */
emit_patcher_stubs(jd);
- REPLACEMENT_EMIT_STUBS(jd);
/* everything's ok */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: emit.c 8191 2007-07-08 15:15:53Z twisti $
+ $Id: emit.c 8211 2007-07-18 19:52:23Z michi $
*/
}
-/* emit_replacement_stubs ******************************************************
-
- Generates the code for the replacement stubs.
-
-*******************************************************************************/
-
-#if defined(ENABLE_REPLACEMENT)
-void emit_replacement_stubs(jitdata *jd)
-{
- codegendata *cd;
- codeinfo *code;
- rplpoint *rplp;
- s4 disp;
- s4 i;
-#if !defined(NDEBUG)
- u1 *savedmcodeptr;
-#endif
-
- /* get required compiler data */
-
- cd = jd->cd;
- code = jd->code;
-
- rplp = code->rplpoints;
-
- /* store beginning of replacement stubs */
-
- code->replacementstubs = (u1*) (cd->mcodeptr - cd->mcodebase);
-
- for (i = 0; i < code->rplpointcount; ++i, ++rplp) {
- /* do not generate stubs for non-trappable points */
-
- if (rplp->flags & RPLPOINT_FLAG_NOTRAP)
- continue;
-
- /* check code segment size */
-
- MCODECHECK(100);
-
-#if !defined(NDEBUG)
- savedmcodeptr = cd->mcodeptr;
-#endif
-
- /* create stack frame - keep 16-byte aligned */
-
- M_AADD_IMM(REG_SP, -4 * 4, REG_SP);
-
- /* push address of `rplpoint` struct */
-
- disp = dseg_add_address(cd, rplp);
- M_ALD(REG_ITMP3, REG_PV, disp);
- M_AST_INTERN(REG_ITMP3, REG_SP, 0 * 4);
-
- /* jump to replacement function */
-
- disp = dseg_add_functionptr(cd, asm_replacement_out);
- M_ALD(REG_ITMP3, REG_PV, disp);
- M_MTCTR(REG_ITMP3);
- M_RTS;
-
- assert((cd->mcodeptr - savedmcodeptr) == 4*REPLACEMENT_STUB_SIZE);
- }
-}
-#endif /* defined(ENABLE_REPLACEMENT) */
-
-
/* emit_verbosecall_enter ******************************************************
Generates the code for the call trace.
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: codegen.c 8123 2007-06-20 23:50:55Z michi $
+ $Id: codegen.c 8211 2007-07-18 19:52:23Z michi $
*/
/* generate stubs */
emit_patcher_stubs(jd);
- REPLACEMENT_EMIT_STUBS(jd);
/* everything's ok */
}
-/* emit_replacement_stubs ******************************************************
-
- Generates the code for the replacement stubs.
-
-*******************************************************************************/
-
-#if defined(ENABLE_REPLACEMENT)
-void emit_replacement_stubs(jitdata *jd)
-{
- codegendata *cd;
- codeinfo *code;
- rplpoint *replacementpoint;
- s4 disp;
- s4 i;
-#if !defined(NDEBUG)
- u1 *savedmcodeptr;
-#endif
-
- /* get required compiler data */
-
- cd = jd->cd;
- code = jd->code;
-
- replacementpoint = jd->code->rplpoints;
-
- for (i = 0; i < code->rplpointcount; ++i, ++replacementpoint) {
- /* do not generate stubs for non-trappable points */
-
- if (replacementpoint->flags & RPLPOINT_FLAG_NOTRAP)
- continue;
-
-
- /* check code segment size */
-
- MCODECHECK(200);
-
-#if !defined(NDEBUG)
- savedmcodeptr = cd->mcodeptr;
-#endif
- /* create stack frame - keep 16-byte aligned */
-
- M_AADD_IMM(REG_SP, -4 * 8, REG_SP);
-
- /* push address of `rplpoint` struct */
-
- disp = dseg_add_address(cd, replacementpoint);
- M_ALD(REG_ITMP3, REG_PV, disp);
- M_AST_INTERN(REG_ITMP3, REG_SP, 0 * 8);
-
- /* jump to replacement function */
-
- disp = dseg_add_functionptr(cd, asm_replacement_out);
- M_ALD(REG_ITMP3, REG_PV, disp);
- M_MTCTR(REG_ITMP3);
- M_RTS;
-
- assert((cd->mcodeptr - savedmcodeptr) == 4*REPLACEMENT_STUB_SIZE);
-
-#if 0
- /* note start of stub code */
-
- replacementpoint->outcode = (u1 *) (cd->mcodeptr - cd->mcodebase);
-
- /* make machine code for patching */
-
- savedmcodeptr = cd->mcodeptr;
- cd->mcodeptr = (u1 *) &(replacementpoint->mcode) + 1 /* big-endian */;
-
- disp = (ptrint)((s4*)replacementpoint->outcode - (s4*)replacementpoint->pc) - 1;
- M_BR(disp);
-
- cd->mcodeptr = savedmcodeptr;
-
- /* create stack frame - keep 16-byte aligned */
-
- M_AADD_IMM(REG_SP, -4 * 4, REG_SP);
-
- /* push address of `rplpoint` struct */
-
- disp = dseg_add_unique_address(cd, replacementpoint);
- M_ALD(REG_ITMP3, REG_PV, disp);
- M_AST_INTERN(REG_ITMP3, REG_SP, 0 * 4);
-
- /* jump to replacement function */
-
- disp = dseg_add_functionptr(cd, asm_replacement_out);
- M_ALD(REG_ITMP3, REG_PV, disp);
- M_MTCTR(REG_ITMP3);
- M_RTS;
-#endif
- }
-}
-#endif /* define(ENABLE_REPLACEMENT) */
-
/*
* 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
#define REPLACEMENT_POINT_RETURN(cd, iptr)
#define REPLACEMENT_POINT_INVOKE(cd, iptr)
#define REPLACEMENT_POINT_INVOKE_RETURN(cd, iptr)
-#define REPLACEMENT_EMIT_STUBS(jd)
#else /* defined(ENABLE_REPLACEMENT) */
cd->replacementpoint[-1].callsize = (cd->mcodeptr - cd->mcodebase)\
- (ptrint) cd->replacementpoint[-1].pc;
-#define REPLACEMENT_EMIT_STUBS(jd) \
- emit_replacement_stubs(jd);
-
/*** prototypes ********************************************************/
bool replace_create_replacement_points(jitdata *jd);
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: emit.c 8123 2007-06-20 23:50:55Z michi $
+ $Id: emit.c 8211 2007-07-18 19:52:23Z michi $
*/
}
-/* emit_replacement_stubs ******************************************************
-
- Generates the code for the replacement stubs.
-
-*******************************************************************************/
-
-void emit_replacement_stubs(jitdata *jd)
-{
-#if 0
- codegendata *cd;
- codeinfo *code;
- rplpoint *rplp;
- s4 disp;
- s4 i;
-
- /* get required compiler data */
-
- cd = jd->cd;
- code = jd->code;
-
- rplp = code->rplpoints;
-
- for (i = 0; i < code->rplpointcount; ++i, ++rplp) {
- /* check code segment size */
-
- MCODECHECK(512);
-
- /* note start of stub code */
-
- rplp->outcode = (u1 *) (ptrint) (cd->mcodeptr - cd->mcodebase);
-
- /* make machine code for patching */
-
- disp = (ptrint) (rplp->outcode - rplp->pc) - 5;
-
- rplp->mcode = 0xe9 | ((u8) disp << 8);
-
- /* push address of `rplpoint` struct */
-
- M_MOV_IMM(rplp, REG_ITMP3);
- M_PUSH(REG_ITMP3);
-
- /* jump to replacement function */
-
- M_MOV_IMM(asm_replacement_out, REG_ITMP3);
- M_JMP(REG_ITMP3);
- }
-#endif
-}
-
-
/* emit_verbosecall_enter ******************************************************
Generates the code for the call trace.
/* generate stubs */
emit_patcher_stubs(jd);
- REPLACEMENT_EMIT_STUBS(jd);
/* everything's ok */
}
-/* emit_replacement_stubs ******************************************************
-
- Generates the code for the replacement stubs.
-
-*******************************************************************************/
-
-#if defined(ENABLE_REPLACEMENT)
-void emit_replacement_stubs(jitdata *jd)
-{
-}
-#endif /* defined(ENABLE_REPLACEMENT) */
-
/* emit_verbosecall_enter ******************************************************
Generates the code for the call trace.
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: codegen.c 8115 2007-06-20 19:14:05Z michi $
+ $Id: codegen.c 8211 2007-07-18 19:52:23Z michi $
*/
/* generate stubs */
emit_patcher_stubs(jd);
- REPLACEMENT_EMIT_STUBS(jd);
/* everything's ok */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: emit.c 8123 2007-06-20 23:50:55Z michi $
+ $Id: emit.c 8211 2007-07-18 19:52:23Z michi $
*/
}
-/* emit_replacement_stubs ******************************************************
-
- Generates the code for the replacement stubs.
-
-*******************************************************************************/
-
-#if defined(ENABLE_REPLACEMENT)
-void emit_replacement_stubs(jitdata *jd)
-{
- codegendata *cd;
- codeinfo *code;
- rplpoint *rplp;
- s4 i;
-#if !defined(NDEBUG)
- u1 *savedmcodeptr;
-#endif
-
- /* get required compiler data */
-
- cd = jd->cd;
- code = jd->code;
-
- rplp = code->rplpoints;
-
- /* store beginning of replacement stubs */
-
- code->replacementstubs = (u1*) (cd->mcodeptr - cd->mcodebase);
-
- for (i = 0; i < code->rplpointcount; ++i, ++rplp) {
- /* do not generate stubs for non-trappable points */
-
- if (rplp->flags & RPLPOINT_FLAG_NOTRAP)
- continue;
-
- /* check code segment size */
-
- MCODECHECK(512);
-
- /* note start of stub code */
-
-#if !defined(NDEBUG)
- savedmcodeptr = cd->mcodeptr;
-#endif
-
- /* push address of `rplpoint` struct */
-
- M_MOV_IMM(rplp, REG_ITMP3);
- M_PUSH(REG_ITMP3);
-
- /* jump to replacement function */
-
- M_MOV_IMM(asm_replacement_out, REG_ITMP3);
- M_PUSH(REG_ITMP3);
- M_RET;
-
- assert((cd->mcodeptr - savedmcodeptr) == REPLACEMENT_STUB_SIZE);
- }
-}
-#endif /* defined(ENABLE_REPLACEMENT) */
-
-
/* emit_verbosecall_enter ******************************************************
Generates the code for the call trace.