From: Lubomir Litchev Date: Fri, 1 Apr 2016 06:15:21 +0000 (-0700) Subject: Don't add nop padding for rejitting a funclet prolog. X-Git-Tag: submit/tizen/20210909.063632~11030^2~10964^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=069aeaf02703856efa7106f1aa256eb889c5ff97;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Don't add nop padding for rejitting a funclet prolog. This is along standing issue in RyuJit. When ngenning the crossgen tool passes CORJIT_FLG_PROF_REJIT_NOPS flag. The padding for rejitting should be added only for the main function and not the funclets when compiling a method. Trying to generate a rejit padding for a funclet in debug and checked build results in a failing assertion. Fixes issue 3601. Commit migrated from https://github.com/dotnet/coreclr/commit/40409548f182d26c75a0b850484c660ab5987281 --- diff --git a/src/coreclr/src/jit/codegencommon.cpp b/src/coreclr/src/jit/codegencommon.cpp index 2349994..d4eefac 100644 --- a/src/coreclr/src/jit/codegencommon.cpp +++ b/src/coreclr/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) {