summaryrefslogtreecommitdiff
path: root/src/jit/flowgraph.cpp
diff options
context:
space:
mode:
authorBruce Forstall <brucefo@microsoft.com>2016-10-26 15:52:06 -0700
committerBruce Forstall <brucefo@microsoft.com>2016-10-27 12:08:20 -0700
commite72536c32676b412cfead025b577d4e8c18d1c2f (patch)
tree41c0b6f18262cdacc29070e5fa880c6ba82c1081 /src/jit/flowgraph.cpp
parent675622bb85f3c78de1967a78052d7280a2834611 (diff)
downloadcoreclr-e72536c32676b412cfead025b577d4e8c18d1c2f.tar.gz
coreclr-e72536c32676b412cfead025b577d4e8c18d1c2f.tar.bz2
coreclr-e72536c32676b412cfead025b577d4e8c18d1c2f.zip
Introduce new CORJIT_FLAGS type
The "JIT flags" currently passed between the EE and the JIT have traditionally been bit flags in a 32-bit word. Recently, a second 32-bit word was added to accommodate additional flags, but that set of flags is definitely "2nd class": they are not universally passed, and require using a separate set of bit definitions, and comparing those bits against the proper, 2nd word. This change replaces all uses of bare DWORD or 'unsigned int' types representing flags with CORJIT_FLAGS, which is now an opaque type. All flag names were renamed from CORJIT_FLG_* to CORJIT_FLAG_* to ensure all cases were changed to use the new names, which are also scoped within the CORJIT_FLAGS type itself. Another motivation to do this, besides cleaner code, is to allow enabling the SSE/AVX flags for x86. For x86, we had fewer bits available in the "first word", so would have to either put them in the "second word", which, as stated, was very much 2nd class and not plumbed through many usages, or we could move other bits to the "second word", with the same issues. Neither was a good option. RyuJIT compiles with both COR_JIT_EE_VERSION > 460 and <= 460. I introduced a JitFlags adapter class in jitee.h to handle both JIT flag types. All JIT code uses this JitFlags type, which operates identically to the new CORJIT_FLAGS type. In addition to introducing the new CORJIT_FLAGS type, the SSE/AVX flags are enabled for x86. The JIT-EE interface GUID is changed, as this is a breaking change.
Diffstat (limited to 'src/jit/flowgraph.cpp')
-rw-r--r--src/jit/flowgraph.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/jit/flowgraph.cpp b/src/jit/flowgraph.cpp
index b8a46a7ca8..2d5b9756db 100644
--- a/src/jit/flowgraph.cpp
+++ b/src/jit/flowgraph.cpp
@@ -6654,7 +6654,7 @@ void Compiler::fgImport()
impImport(fgFirstBB);
- if (!(opts.eeFlags & CORJIT_FLG_SKIP_VERIFICATION))
+ if (!opts.jitFlags->IsSet(JitFlags::JIT_FLAG_SKIP_VERIFICATION))
{
CorInfoMethodRuntimeFlags verFlag;
verFlag = tiIsVerifiableCode ? CORINFO_FLG_VERIFIABLE : CORINFO_FLG_UNVERIFIABLE;
@@ -8289,7 +8289,7 @@ void Compiler::fgAddInternal()
CORINFO_JUST_MY_CODE_HANDLE* pDbgHandle = nullptr;
CORINFO_JUST_MY_CODE_HANDLE dbgHandle = nullptr;
- if (opts.compDbgCode && !(opts.eeFlags & CORJIT_FLG_IL_STUB))
+ if (opts.compDbgCode && !opts.jitFlags->IsSet(JitFlags::JIT_FLAG_IL_STUB))
{
dbgHandle = info.compCompHnd->getJustMyCodeHandle(info.compMethodHnd, &pDbgHandle);
}
@@ -14019,7 +14019,7 @@ bool Compiler::fgOptimizeBranch(BasicBlock* bJump)
// we are willing to have more code expansion since we
// won't be running code from this page
//
- if (opts.eeFlags & CORJIT_FLG_PREJIT)
+ if (opts.jitFlags->IsSet(JitFlags::JIT_FLAG_PREJIT))
{
if (rareJump)
{
@@ -18661,7 +18661,7 @@ FILE* Compiler::fgOpenFlowGraphFile(bool* wbDontClose, Phases phas
bool createDuplicateFgxFiles = true;
#ifdef DEBUG
- if (opts.eeFlags & CORJIT_FLG_PREJIT)
+ if (opts.jitFlags->IsSet(JitFlags::JIT_FLAG_PREJIT))
{
pattern = JitConfig.NgenDumpFg();
filename = JitConfig.NgenDumpFgFile();
@@ -21504,10 +21504,17 @@ void Compiler::fgInvokeInlineeCompiler(GenTreeCall* call,
pParam->pThis->eeGetMethodFullName(pParam->fncHandle),
pParam->pThis->dspPtr(pParam->inlineInfo->tokenLookupContextHandle)));
- CORJIT_FLAGS compileFlagsForInlinee;
- memcpy(&compileFlagsForInlinee, pParam->pThis->opts.jitFlags, sizeof(compileFlagsForInlinee));
- compileFlagsForInlinee.corJitFlags &= ~CORJIT_FLG_LOST_WHEN_INLINING;
- compileFlagsForInlinee.corJitFlags |= CORJIT_FLG_SKIP_VERIFICATION;
+ JitFlags compileFlagsForInlinee = *pParam->pThis->opts.jitFlags;
+
+ // The following flags are lost when inlining.
+ // (This is checked in Compiler::compInitOptions().)
+ compileFlagsForInlinee.Clear(JitFlags::JIT_FLAG_BBOPT);
+ compileFlagsForInlinee.Clear(JitFlags::JIT_FLAG_BBINSTR);
+ compileFlagsForInlinee.Clear(JitFlags::JIT_FLAG_PROF_ENTERLEAVE);
+ compileFlagsForInlinee.Clear(JitFlags::JIT_FLAG_DEBUG_EnC);
+ compileFlagsForInlinee.Clear(JitFlags::JIT_FLAG_DEBUG_INFO);
+
+ compileFlagsForInlinee.Set(JitFlags::JIT_FLAG_SKIP_VERIFICATION);
#ifdef DEBUG
if (pParam->pThis->verbose)