* Remove padding for ReJit in CodeGen::genAllocLclFrame in src/coreclr/jit/codegenxarch.cpp
* Remove JIT_FLAG_PROF_REJIT_NOPS in src/coreclr/jit/jitee.h
* Remove CORJIT_FLAG_PROF_REJIT_NOPS in src/coreclr/inc/corjitflags.h
* Remove CORJIT_FLAG_PROF_REJIT_NOPS in src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs
* Remove genPrologPadForReJit() in src/coreclr/jit
* Remove dead code in src/coreclr/jit
* Update JIT/EE interface GUID in src/coreclr/inc/jiteeversionguid.h
CORJIT_FLAG_MAKEFINALCODE = 18, // Use the final code generator, i.e., not the interpreter.
CORJIT_FLAG_READYTORUN = 19, // Use version-resilient code generation
CORJIT_FLAG_PROF_ENTERLEAVE = 20, // Instrument prologues/epilogues
- CORJIT_FLAG_PROF_REJIT_NOPS = 21, // Insert NOPs to ensure code is re-jitable
+ CORJIT_FLAG_UNUSED11 = 21,
CORJIT_FLAG_PROF_NO_PINVOKE_INLINE = 22, // Disables PInvoke inlining
CORJIT_FLAG_SKIP_VERIFICATION = 23, // (lazy) skip verification - determined without doing a full resolve. See comment below
CORJIT_FLAG_PREJIT = 24, // jit or prejit is the execution engine.
CORJIT_FLAG_FRAMED = 31, // All methods have an EBP frame
CORJIT_FLAG_ALIGN_LOOPS = 32, // add NOPs before loops to align them at 16 byte boundaries
CORJIT_FLAG_PUBLISH_SECRET_PARAM = 33, // JIT must place stub secret param into local 0. (used by IL stubs)
- CORJIT_FLAG_UNUSED11 = 34,
+ CORJIT_FLAG_UNUSED12 = 34,
CORJIT_FLAG_SAMPLING_JIT_BACKGROUND = 35, // JIT is being invoked as a result of stack sampling for hot methods in the background
CORJIT_FLAG_USE_PINVOKE_HELPERS = 36, // The JIT should use the PINVOKE_{BEGIN,END} helpers instead of emitting inline transitions
CORJIT_FLAG_REVERSE_PINVOKE = 37, // The JIT should insert REVERSE_PINVOKE_{ENTER,EXIT} helpers into method prolog/epilog
- CORJIT_FLAG_UNUSED12 = 38,
+ CORJIT_FLAG_UNUSED13 = 38,
CORJIT_FLAG_TIER0 = 39, // This is the initial tier for tiered compilation which should generate code as quickly as possible
CORJIT_FLAG_TIER1 = 40, // This is the final tier (for now) for tiered compilation which should generate high quality code
#if defined(TARGET_ARM)
CORJIT_FLAG_RELATIVE_CODE_RELOCS = 41, // JIT should generate PC-relative address computations instead of EE relocation records
#else // !defined(TARGET_ARM)
- CORJIT_FLAG_UNUSED13 = 41,
+ CORJIT_FLAG_UNUSED14 = 41,
#endif // !defined(TARGET_ARM)
CORJIT_FLAG_NO_INLINING = 42, // JIT should not inline any called method into this method
- CORJIT_FLAG_UNUSED14 = 43,
- CORJIT_FLAG_UNUSED15 = 44,
- CORJIT_FLAG_UNUSED16 = 45,
- CORJIT_FLAG_UNUSED17 = 46,
- CORJIT_FLAG_UNUSED18 = 47,
- CORJIT_FLAG_UNUSED19 = 48,
- CORJIT_FLAG_UNUSED20 = 49,
- CORJIT_FLAG_UNUSED21 = 50,
- CORJIT_FLAG_UNUSED22 = 51,
- CORJIT_FLAG_UNUSED23 = 52,
- CORJIT_FLAG_UNUSED24 = 53,
- CORJIT_FLAG_UNUSED25 = 54,
- CORJIT_FLAG_UNUSED26 = 55,
- CORJIT_FLAG_UNUSED27 = 56,
- CORJIT_FLAG_UNUSED28 = 57,
- CORJIT_FLAG_UNUSED29 = 58,
- CORJIT_FLAG_UNUSED30 = 59,
- CORJIT_FLAG_UNUSED31 = 60,
- CORJIT_FLAG_UNUSED32 = 61,
- CORJIT_FLAG_UNUSED33 = 62,
- CORJIT_FLAG_UNUSED34 = 63
+ CORJIT_FLAG_UNUSED15 = 43,
+ CORJIT_FLAG_UNUSED16 = 44,
+ CORJIT_FLAG_UNUSED17 = 45,
+ CORJIT_FLAG_UNUSED18 = 46,
+ CORJIT_FLAG_UNUSED19 = 47,
+ CORJIT_FLAG_UNUSED20 = 48,
+ CORJIT_FLAG_UNUSED21 = 49,
+ CORJIT_FLAG_UNUSED22 = 50,
+ CORJIT_FLAG_UNUSED23 = 51,
+ CORJIT_FLAG_UNUSED24 = 52,
+ CORJIT_FLAG_UNUSED25 = 53,
+ CORJIT_FLAG_UNUSED26 = 54,
+ CORJIT_FLAG_UNUSED27 = 55,
+ CORJIT_FLAG_UNUSED28 = 56,
+ CORJIT_FLAG_UNUSED29 = 57,
+ CORJIT_FLAG_UNUSED30 = 58,
+ CORJIT_FLAG_UNUSED31 = 59,
+ CORJIT_FLAG_UNUSED32 = 60,
+ CORJIT_FLAG_UNUSED33 = 61,
+ CORJIT_FLAG_UNUSED34 = 62,
+ CORJIT_FLAG_UNUSED35 = 63
};
CORJIT_FLAGS()
//
//////////////////////////////////////////////////////////////////////////////////////////////////////////
-constexpr GUID JITEEVersionIdentifier = { /* a7bb194e-4e7c-4850-af12-ea9f30ea5a13 */
- 0xa7bb194e,
- 0x4e7c,
- 0x4850,
- {0xaf, 0x12, 0xea, 0x9f, 0x30, 0xea, 0x5a, 0x13}
+constexpr GUID JITEEVersionIdentifier = { /* 89b87d02-e032-4f00-b5cf-dfdee25bbae2 */
+ 0x89b87d02,
+ 0xe032,
+ 0x4f00,
+ {0xb5, 0xcf, 0xdf, 0xde, 0xe2, 0x5b, 0xba, 0xe2}
};
//////////////////////////////////////////////////////////////////////////////////////////////////////////
void genProfilingLeaveCallback(unsigned helper);
#endif // PROFILING_SUPPORTED
- void genPrologPadForReJit();
-
// clang-format off
void genEmitCall(int callType,
CORINFO_METHOD_HANDLE methHnd,
void instInit();
void instGen(instruction ins);
-#ifdef TARGET_XARCH
- void instNop(unsigned size);
-#endif
void inst_JMP(emitJumpKind jmp, BasicBlock* tgtBlock);
instGen_Set_Reg_To_Imm(EA_PTRSIZE, rOffset, -(ssize_t)pageSize);
instGen_Set_Reg_To_Imm(EA_PTRSIZE, rLimit, -(ssize_t)frameSize);
- //
- // Can't have a label inside the ReJIT padding area
- //
- genPrologPadForReJit();
-
// There's a "virtual" label here. But we can't create a label in the prolog, so we use the magic
// `emitIns_J` with a negative `instrCount` to branch back a specific number of instructions.
/*****************************************************************************
*
- * Generates appropriate NOP padding for a function prolog to support ReJIT.
- */
-
-void CodeGen::genPrologPadForReJit()
-{
- assert(compiler->compGeneratingProlog);
-
-#ifdef TARGET_XARCH
- if (!compiler->opts.jitFlags->IsSet(JitFlags::JIT_FLAG_PROF_REJIT_NOPS))
- {
- return;
- }
-
-#if defined(FEATURE_EH_FUNCLETS)
-
- // No need to generate pad (nops) for funclets.
- // When compiling the main function (and not a funclet)
- // the value of funCurrentFunc->funKind is equal to FUNC_ROOT.
- if (compiler->funCurrentFunc()->funKind != FUNC_ROOT)
- {
- return;
- }
-
-#endif // FEATURE_EH_FUNCLETS
-
- unsigned size = GetEmitter()->emitGetPrologOffsetEstimate();
- if (size < 5)
- {
- instNop(5 - size);
- }
-#endif
-}
-
-/*****************************************************************************
- *
* Reserve space for a function prolog.
*/
if (!GetInterruptible())
{
- /*-------------------------------------------------------------------------
- *
- * The 'real' prolog ends here for non-interruptible methods.
- * For fully-interruptible methods, we extend the prolog so that
- * we do not need to track GC inforation while shuffling the
- * arguments.
- *
- * Make sure there's enough padding for ReJIT.
- *
- */
- genPrologPadForReJit();
+ // The 'real' prolog ends here for non-interruptible methods.
+ // For fully-interruptible methods, we extend the prolog so that
+ // we do not need to track GC inforation while shuffling the
+ // arguments.
GetEmitter()->emitMarkPrologEnd();
}
//
// Increase the prolog size here only if fully interruptible.
- // And again make sure it's big enough for ReJIT
//
if (GetInterruptible())
{
- genPrologPadForReJit();
GetEmitter()->emitMarkPrologEnd();
}
if (compiler->opts.compScopeInfo && (compiler->info.compVarScopesCount > 0))
GetEmitter()->emitIns_R_AR(INS_lea, EA_PTRSIZE, REG_STACK_PROBE_HELPER_ARG, REG_SPBASE, spOffset);
regSet.verifyRegUsed(REG_STACK_PROBE_HELPER_ARG);
- // Can't have a call until we have enough padding for ReJit.
- genPrologPadForReJit();
genEmitHelperCall(CORINFO_HELP_STACK_PROBE, 0, EA_UNKNOWN);
if (compiler->info.compPublishStubParam)
GetEmitter()->emitIns_R_AR(INS_lea, EA_PTRSIZE, REG_STACK_PROBE_HELPER_ARG, REG_SPBASE, -(int)frameSize);
regSet.verifyRegUsed(REG_STACK_PROBE_HELPER_ARG);
- // Can't have a call until we have enough padding for ReJit.
- genPrologPadForReJit();
genEmitHelperCall(CORINFO_HELP_STACK_PROBE, 0, EA_UNKNOWN);
if (initReg == REG_DEFAULT_HELPER_CALL_TARGET)
inst_IV(INS_push, (size_t)compiler->compProfilerMethHnd);
}
- //
- // Can't have a call until we have enough padding for rejit
- //
- genPrologPadForReJit();
-
// This will emit either
// "call ip-relative 32-bit offset" or
// "mov rax, helper addr; call rax"
int callerSPOffset = compiler->lvaToCallerSPRelativeOffset(0, isFramePointerUsed());
GetEmitter()->emitIns_R_AR(INS_lea, EA_PTRSIZE, REG_ARG_1, genFramePointerReg(), -callerSPOffset);
- // Can't have a call until we have enough padding for rejit
- genPrologPadForReJit();
-
// This will emit either
// "call ip-relative 32-bit offset" or
// "mov rax, helper addr; call rax"
int callerSPOffset = compiler->lvaToCallerSPRelativeOffset(0, isFramePointerUsed());
GetEmitter()->emitIns_R_AR(INS_lea, EA_PTRSIZE, REG_PROFILER_ENTER_ARG_1, genFramePointerReg(), -callerSPOffset);
- // Can't have a call until we have enough padding for rejit
- genPrologPadForReJit();
-
// We can use any callee trash register (other than RAX, RDI, RSI) for call target.
// We use R11 here. This will emit either
// "call ip-relative 32-bit offset" or
#endif
}
-#ifdef TARGET_XARCH
-/*****************************************************************************
- *
- * Generate a multi-byte NOP instruction.
- */
-
-void CodeGen::instNop(unsigned size)
-{
- assert(size <= 15);
- GetEmitter()->emitIns_Nop(size);
-}
-#endif
-
/*****************************************************************************
*
* Generate a jump instruction.
JIT_FLAG_MAKEFINALCODE = 18, // Use the final code generator, i.e., not the interpreter.
JIT_FLAG_READYTORUN = 19, // Use version-resilient code generation
JIT_FLAG_PROF_ENTERLEAVE = 20, // Instrument prologues/epilogues
- JIT_FLAG_PROF_REJIT_NOPS = 21, // Insert NOPs to ensure code is re-jitable
+ JIT_FLAG_UNUSED11 = 21,
JIT_FLAG_PROF_NO_PINVOKE_INLINE = 22, // Disables PInvoke inlining
JIT_FLAG_SKIP_VERIFICATION = 23, // (lazy) skip verification - determined without doing a full resolve. See comment below
JIT_FLAG_PREJIT = 24, // jit or prejit is the execution engine.
JIT_FLAG_FRAMED = 31, // All methods have an EBP frame
JIT_FLAG_ALIGN_LOOPS = 32, // add NOPs before loops to align them at 16 byte boundaries
JIT_FLAG_PUBLISH_SECRET_PARAM = 33, // JIT must place stub secret param into local 0. (used by IL stubs)
- JIT_FLAG_UNUSED11 = 34,
+ JIT_FLAG_UNUSED12 = 34,
JIT_FLAG_SAMPLING_JIT_BACKGROUND = 35, // JIT is being invoked as a result of stack sampling for hot methods in the background
JIT_FLAG_USE_PINVOKE_HELPERS = 36, // The JIT should use the PINVOKE_{BEGIN,END} helpers instead of emitting inline transitions
JIT_FLAG_REVERSE_PINVOKE = 37, // The JIT should insert REVERSE_PINVOKE_{ENTER,EXIT} helpers into method prolog/epilog
- JIT_FLAG_UNUSED12 = 38,
+ JIT_FLAG_UNUSED13 = 38,
JIT_FLAG_TIER0 = 39, // This is the initial tier for tiered compilation which should generate code as quickly as possible
JIT_FLAG_TIER1 = 40, // This is the final tier (for now) for tiered compilation which should generate high quality code
#if defined(TARGET_ARM)
JIT_FLAG_RELATIVE_CODE_RELOCS = 41, // JIT should generate PC-relative address computations instead of EE relocation records
#else // !defined(TARGET_ARM)
- JIT_FLAG_UNUSED13 = 41,
+ JIT_FLAG_UNUSED14 = 41,
#endif // !defined(TARGET_ARM)
JIT_FLAG_NO_INLINING = 42, // JIT should not inline any called method into this method
- JIT_FLAG_UNUSED14 = 43,
- JIT_FLAG_UNUSED15 = 44,
- JIT_FLAG_UNUSED16 = 45,
- JIT_FLAG_UNUSED17 = 46,
- JIT_FLAG_UNUSED18 = 47,
- JIT_FLAG_UNUSED19 = 48,
- JIT_FLAG_UNUSED20 = 49,
- JIT_FLAG_UNUSED21 = 50,
- JIT_FLAG_UNUSED22 = 51,
- JIT_FLAG_UNUSED23 = 52,
- JIT_FLAG_UNUSED24 = 53,
- JIT_FLAG_UNUSED25 = 54,
- JIT_FLAG_UNUSED26 = 55,
- JIT_FLAG_UNUSED27 = 56,
- JIT_FLAG_UNUSED28 = 57,
- JIT_FLAG_UNUSED29 = 58,
- JIT_FLAG_UNUSED30 = 59,
- JIT_FLAG_UNUSED31 = 60,
- JIT_FLAG_UNUSED32 = 61,
- JIT_FLAG_UNUSED33 = 62,
- JIT_FLAG_UNUSED34 = 63
+ JIT_FLAG_UNUSED15 = 43,
+ JIT_FLAG_UNUSED16 = 44,
+ JIT_FLAG_UNUSED17 = 45,
+ JIT_FLAG_UNUSED18 = 46,
+ JIT_FLAG_UNUSED19 = 47,
+ JIT_FLAG_UNUSED20 = 48,
+ JIT_FLAG_UNUSED21 = 49,
+ JIT_FLAG_UNUSED22 = 50,
+ JIT_FLAG_UNUSED23 = 51,
+ JIT_FLAG_UNUSED24 = 52,
+ JIT_FLAG_UNUSED25 = 53,
+ JIT_FLAG_UNUSED26 = 54,
+ JIT_FLAG_UNUSED27 = 55,
+ JIT_FLAG_UNUSED28 = 56,
+ JIT_FLAG_UNUSED29 = 57,
+ JIT_FLAG_UNUSED30 = 58,
+ JIT_FLAG_UNUSED31 = 59,
+ JIT_FLAG_UNUSED32 = 60,
+ JIT_FLAG_UNUSED33 = 61,
+ JIT_FLAG_UNUSED34 = 62,
+ JIT_FLAG_UNUSED35 = 63
};
// clang-format on
FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_MAKEFINALCODE, JIT_FLAG_MAKEFINALCODE);
FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_READYTORUN, JIT_FLAG_READYTORUN);
FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_PROF_ENTERLEAVE, JIT_FLAG_PROF_ENTERLEAVE);
- FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_PROF_REJIT_NOPS, JIT_FLAG_PROF_REJIT_NOPS);
FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_PROF_NO_PINVOKE_INLINE, JIT_FLAG_PROF_NO_PINVOKE_INLINE);
FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_SKIP_VERIFICATION, JIT_FLAG_SKIP_VERIFICATION);
FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_PREJIT, JIT_FLAG_PREJIT);
CORJIT_FLAG_MAKEFINALCODE = 18, // Use the final code generator, i.e., not the interpreter.
CORJIT_FLAG_READYTORUN = 19, // Use version-resilient code generation
CORJIT_FLAG_PROF_ENTERLEAVE = 20, // Instrument prologues/epilogues
- CORJIT_FLAG_PROF_REJIT_NOPS = 21, // Insert NOPs to ensure code is re-jitable
+ CORJIT_FLAG_UNUSED7 = 21,
CORJIT_FLAG_PROF_NO_PINVOKE_INLINE = 22, // Disables PInvoke inlining
CORJIT_FLAG_SKIP_VERIFICATION = 23, // (lazy) skip verification - determined without doing a full resolve. See comment below
CORJIT_FLAG_PREJIT = 24, // jit or prejit is the execution engine.