未验证 提交 c3fa7655 编写于 作者: J Jan Kotas 提交者: GitHub

Delete IL verifier support in the VM (#66616)

Contributes to #32648
上级 fa1f2834
......@@ -2365,13 +2365,6 @@ CORINFO_METHOD_HANDLE CEEInfo::GetDelegateCtor(
MODE_PREEMPTIVE;
} CONTRACTL_END;
if (isVerifyOnly())
{
// No sense going through the optimized case just for verification and it can cause issues parsing
// uninstantiated generic signatures.
return methHnd;
}
CORINFO_METHOD_HANDLE result = NULL;
JIT_TO_EE_TRANSITION();
......@@ -2697,9 +2690,6 @@ void CEEInfo::ScanToken(Module * pModule, CORINFO_RESOLVED_TOKEN * pResolvedToke
if (pModule->IsSystem())
return;
if (isVerifyOnly())
return;
//
// Scan method instantiation
//
......@@ -2884,10 +2874,6 @@ void CEEInfo::ComputeRuntimeLookupForSharedGenericToken(DictionaryEntryKind entr
PRECONDITION(CheckPointer(pResultLookup));
} CONTRACTL_END;
// We should never get here when we are only verifying
_ASSERTE(!isVerifyOnly());
pResultLookup->lookupKind.needsRuntimeLookup = true;
pResultLookup->lookupKind.runtimeLookupFlags = 0;
......@@ -3691,13 +3677,6 @@ CorInfoInitClassResult CEEInfo::initClass(
JIT_TO_EE_TRANSITION();
{
// Do not bother figuring out the initialization if we are only verifying the method.
if (isVerifyOnly())
{
result = CORINFO_INITCLASS_NOT_REQUIRED;
goto exit;
}
FieldDesc * pFD = (FieldDesc *)field;
_ASSERTE(pFD == NULL || pFD->IsStatic());
......@@ -5173,7 +5152,7 @@ void CEEInfo::getCallInfo(
{
BYTE * indcell = NULL;
if (!(flags & CORINFO_CALLINFO_KINDONLY) && !isVerifyOnly())
if (!(flags & CORINFO_CALLINFO_KINDONLY))
{
// We shouldn't be using GetLoaderAllocator here because for LCG, we need to get the
// VirtualCallStubManager from where the stub will be used.
......@@ -5826,9 +5805,6 @@ CorInfoHelpFunc CEEInfo::getCastingHelper(CORINFO_RESOLVED_TOKEN * pResolvedToke
MODE_PREEMPTIVE;
} CONTRACTL_END;
if (isVerifyOnly())
return fThrowing ? CORINFO_HELP_CHKCASTANY : CORINFO_HELP_ISINSTANCEOFANY;
CorInfoHelpFunc result = CORINFO_HELP_UNDEF;
JIT_TO_EE_TRANSITION();
......@@ -9455,7 +9431,7 @@ CorInfoTypeWithMod CEEInfo::getArgType (
case ELEMENT_TYPE_PTR:
// Load the type eagerly under debugger to make the eval work
if (!isVerifyOnly() && CORDisableJITOptimizations(pModule->GetDebuggerInfoBits()))
if (CORDisableJITOptimizations(pModule->GetDebuggerInfoBits()))
{
// NOTE: in some IJW cases, when the type pointed at is unmanaged,
// the GetTypeHandle may fail, because there is no TypeDef for such type.
......@@ -12108,12 +12084,6 @@ void* CEEJitInfo::getFieldAddress(CORINFO_FIELD_HANDLE fieldHnd,
if (ppIndirection != NULL)
*ppIndirection = NULL;
// Do not bother with initialization if we are only verifying the method.
if (isVerifyOnly())
{
return (void *)0x10;
}
JIT_TO_EE_TRANSITION();
FieldDesc* field = (FieldDesc*) fieldHnd;
......@@ -12164,12 +12134,6 @@ CORINFO_CLASS_HANDLE CEEJitInfo::getStaticFieldCurrentClass(CORINFO_FIELD_HANDLE
*pIsSpeculative = true;
}
// Only examine the field's value if we are producing jitted code.
if (isVerifyOnly())
{
return result;
}
JIT_TO_EE_TRANSITION();
FieldDesc* field = (FieldDesc*) fieldHnd;
......@@ -12752,7 +12716,6 @@ CorJitResult invokeCompileMethodHelper(EEJitManager *jitMgr,
// If we're doing an "import_only" compilation, it's for verification, so don't interpret.
// (We assume that importation is completely architecture-independent, or at least nearly so.)
if (FAILED(ret) &&
!jitFlags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_IMPORT_ONLY) &&
(forceInterpreter || !jitFlags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_MAKEFINALCODE)))
{
if (SUCCEEDED(ret = Interpreter::GenerateInterpreterStub(comp, info, nativeEntry, nativeSizeOfCode)))
......@@ -12777,7 +12740,6 @@ CorJitResult invokeCompileMethodHelper(EEJitManager *jitMgr,
// If we're doing an "import_only" compilation, it's for verification, so don't interpret.
// (We assume that importation is completely architecture-independent, or at least nearly so.)
if (FAILED(ret) &&
!jitFlags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_IMPORT_ONLY) &&
(forceInterpreter || !jitFlags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_MAKEFINALCODE)))
{
if (SUCCEEDED(ret = Interpreter::GenerateInterpreterStub(comp, info, nativeEntry, nativeSizeOfCode)))
......@@ -12802,7 +12764,7 @@ CorJitResult invokeCompileMethodHelper(EEJitManager *jitMgr,
// If the JIT fails we keep the IL around and will
// try reJIT the same IL. VSW 525059
//
if (SUCCEEDED(ret) && !jitFlags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_IMPORT_ONLY) && !((CEEJitInfo*)comp)->JitAgain())
if (SUCCEEDED(ret) && !((CEEJitInfo*)comp)->JitAgain())
{
((CEEJitInfo*)comp)->CompressDebugInfo();
......@@ -12962,14 +12924,6 @@ CORJIT_FLAGS GetDebuggerCompileFlags(Module* pModule, CORJIT_FLAGS flags)
flags.Set(CORJIT_FLAGS::CORJIT_FLAG_DEBUG_CODE);
}
if (flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_IMPORT_ONLY))
{
// If we are only verifying the method, dont need any debug info and this
// prevents getVars()/getBoundaries() from being called unnecessarily.
flags.Clear(CORJIT_FLAGS::CORJIT_FLAG_DEBUG_INFO);
flags.Clear(CORJIT_FLAGS::CORJIT_FLAG_DEBUG_CODE);
}
return flags;
}
......@@ -12987,10 +12941,7 @@ CORJIT_FLAGS GetCompileFlags(MethodDesc * ftn, CORJIT_FLAGS flags, CORINFO_METHO
//
// Get CPU specific flags
//
if (!flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_IMPORT_ONLY))
{
flags.Add(ExecutionManager::GetEEJitManager()->GetCPUCompileFlags());
}
flags.Add(ExecutionManager::GetEEJitManager()->GetCPUCompileFlags());
//
// Find the debugger and profiler related flags
......@@ -13215,12 +13166,8 @@ PCODE UnsafeJitFunction(PrepareCodeConfig* config,
getMethodInfoHelper(ftn, ftnHnd, ILHeader, &methodInfo);
// If it's generic then we can only enter through an instantiated md (unless we're just verifying it)
_ASSERTE(flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_IMPORT_ONLY) || !ftn->IsGenericMethodDefinition());
// If it's an instance method then it must not be entered from a generic class
_ASSERTE(flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_IMPORT_ONLY) || ftn->IsStatic() ||
ftn->GetNumGenericClassArgs() == 0 || ftn->HasClassInstantiation());
// If it's generic then we can only enter through an instantiated md
_ASSERTE(!ftn->IsGenericMethodDefinition());
// method attributes and signature are consistant
_ASSERTE(!!ftn->IsStatic() == ((methodInfo.args.callConv & CORINFO_CALLCONV_HASTHIS) == 0));
......@@ -13257,8 +13204,7 @@ PCODE UnsafeJitFunction(PrepareCodeConfig* config,
for (;;)
{
CEEJitInfo jitInfo(ftn, ILHeader, jitMgr, flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_IMPORT_ONLY),
!flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_NO_INLINING));
CEEJitInfo jitInfo(ftn, ILHeader, jitMgr, !flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_NO_INLINING));
#if (defined(TARGET_AMD64) || defined(TARGET_ARM64))
#ifdef TARGET_AMD64
......@@ -13337,8 +13283,7 @@ PCODE UnsafeJitFunction(PrepareCodeConfig* config,
#ifdef PERF_TRACK_METHOD_JITTIMES
//Because we're not calling QPC enough. I'm not going to track times if we're just importing.
LARGE_INTEGER methodJitTimeStart = {0};
if (!flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_IMPORT_ONLY))
QueryPerformanceCounter (&methodJitTimeStart);
QueryPerformanceCounter (&methodJitTimeStart);
#endif
LOG((LF_CORDB, LL_EVERYTHING, "Calling invokeCompileMethod...\n"));
......@@ -13363,7 +13308,6 @@ PCODE UnsafeJitFunction(PrepareCodeConfig* config,
#ifdef PERF_TRACK_METHOD_JITTIMES
//store the time in the string buffer. Module name and token are unique enough. Also, do not
//capture importing time, just actual compilation time.
if (!flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_IMPORT_ONLY))
{
LARGE_INTEGER methodJitTimeStop;
QueryPerformanceCounter(&methodJitTimeStop);
......@@ -13390,8 +13334,7 @@ PCODE UnsafeJitFunction(PrepareCodeConfig* config,
// Note: if we're only importing (ie, verifying/
// checking to make sure we could JIT, but not actually generating code (
// eg, for inlining), then DON'T TELL THE DEBUGGER about this.
if (!flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_IMPORT_ONLY) &&
!flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_MCJIT_BACKGROUND)
if (!flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_MCJIT_BACKGROUND)
#ifdef FEATURE_STACK_SAMPLING
&& !flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_SAMPLING_JIT_BACKGROUND)
#endif // FEATURE_STACK_SAMPLING
......@@ -13416,12 +13359,6 @@ PCODE UnsafeJitFunction(PrepareCodeConfig* config,
ThrowExceptionForJit(res);
}
if (flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_IMPORT_ONLY))
{
// We are done
break;
}
if (!nativeEntry)
COMPlusThrow(kInvalidProgramException);
......@@ -14590,9 +14527,7 @@ InfoAccessType CEEInfo::constructStringLiteral(CORINFO_MODULE_HANDLE scopeHnd,
InfoAccessType CEEInfo::emptyStringLiteral(void ** ppValue)
{
LIMITED_METHOD_CONTRACT;
_ASSERTE(isVerifyOnly());
*ppValue = (void *)0x10;
return IAT_PVALUE;
UNREACHABLE(); // only called on derived class.
}
void* CEEInfo::getFieldAddress(CORINFO_FIELD_HANDLE fieldHnd,
......@@ -14609,12 +14544,6 @@ void* CEEInfo::getFieldAddress(CORINFO_FIELD_HANDLE fieldHnd,
if (ppIndirection != NULL)
*ppIndirection = NULL;
// Do not bother with initialization if we are only verifying the method.
if (isVerifyOnly())
{
return (void *)0x10;
}
JIT_TO_EE_TRANSITION();
FieldDesc* field = (FieldDesc*)fieldHnd;
......@@ -14632,10 +14561,7 @@ CORINFO_CLASS_HANDLE CEEInfo::getStaticFieldCurrentClass(CORINFO_FIELD_HANDLE fi
bool* pIsSpeculative)
{
LIMITED_METHOD_CONTRACT;
_ASSERTE(isVerifyOnly());
if (pIsSpeculative != NULL)
*pIsSpeculative = true;
return NULL;
UNREACHABLE(); // only called on derived class.
}
void* CEEInfo::getMethodSync(CORINFO_METHOD_HANDLE ftnHnd,
......
......@@ -466,11 +466,6 @@ protected:
CORINFO_EH_CLAUSE* clause,
COR_ILMETHOD_DECODER* pILHeader);
bool isVerifyOnly()
{
return m_fVerifyOnly;
}
public:
void* getAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method, void **ppIndirection);
......@@ -489,9 +484,8 @@ public:
TypeHandle typeHnd = TypeHandle() /* optional in */,
CORINFO_CLASS_HANDLE *clsRet = NULL /* optional out */ );
CEEInfo(MethodDesc * fd = NULL, bool fVerifyOnly = false, bool fAllowInlining = true) :
CEEInfo(MethodDesc * fd = NULL, bool fAllowInlining = true) :
m_pMethodBeingCompiled(fd),
m_fVerifyOnly(fVerifyOnly),
m_pThread(GetThreadNULLOk()),
m_hMethodForSecurity_Key(NULL),
m_pMethodForSecurity_Value(NULL),
......@@ -567,7 +561,6 @@ public:
protected:
MethodDesc* m_pMethodBeingCompiled; // Top-level method being compiled
bool m_fVerifyOnly;
Thread * m_pThread; // Cached current thread for faster JIT-EE transitions
CORJIT_FLAGS m_jitFlags;
......@@ -792,8 +785,8 @@ public:
#endif
CEEJitInfo(MethodDesc* fd, COR_ILMETHOD_DECODER* header,
EEJitManager* jm, bool fVerifyOnly, bool allowInlining = true)
: CEEInfo(fd, fVerifyOnly, allowInlining),
EEJitManager* jm, bool allowInlining = true)
: CEEInfo(fd, allowInlining),
m_jitManager(jm),
m_CodeHeader(NULL),
m_CodeHeaderRW(NULL),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册