Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
runtime
提交
c3fa7655
R
runtime
项目概览
dotNET Platform
/
runtime
12 个月 前同步成功
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
runtime
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
c3fa7655
编写于
3月 20, 2022
作者:
J
Jan Kotas
提交者:
GitHub
3月 20, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Delete IL verifier support in the VM (#66616)
Contributes to #32648
上级
fa1f2834
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
95 deletion
+14
-95
src/coreclr/vm/jitinterface.cpp
src/coreclr/vm/jitinterface.cpp
+11
-85
src/coreclr/vm/jitinterface.h
src/coreclr/vm/jitinterface.h
+3
-10
未找到文件。
src/coreclr/vm/jitinterface.cpp
浏览文件 @
c3fa7655
...
...
@@ -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
,
...
...
src/coreclr/vm/jitinterface.h
浏览文件 @
c3fa7655
...
...
@@ -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
f
VerifyOnly
=
false
,
bool
f
AllowInlining
=
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录