summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/jit/codegencommon.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/jit/codegencommon.cpp b/src/jit/codegencommon.cpp
index 2349994ac4..d4eefac4ec 100644
--- a/src/jit/codegencommon.cpp
+++ b/src/jit/codegencommon.cpp
@@ -7619,7 +7619,22 @@ void CodeGen::genPrologPadForReJit()
#ifdef _TARGET_XARCH_
if (!(compiler->opts.eeFlags & CORJIT_FLG_PROF_REJIT_NOPS))
+ {
return;
+ }
+
+#if 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)
{