Check method can compile before rooting (#729)
authorFadi Hanna <fadim@microsoft.com>
Fri, 13 Dec 2019 03:10:29 +0000 (22:10 -0500)
committerGitHub <noreply@github.com>
Fri, 13 Dec 2019 03:10:29 +0000 (22:10 -0500)
commitb65649eb8e28c9a58bb561059363869b9fd84748
tree14fc4f9495d2b77d6051b0ef3509c507123b7553
parent26bb3b1776dbfc9832d006ae78d09dfdb4c1da9c
Check method can compile before rooting (#729)

* Check if a method should be skipped from compilation, and if so, do not root it.

* Harden various signature nodes against type system exceptions

Use existing validation API in CompilerTypeSystemContext to validate types on the various signature-emitting nodes: if it throws a
TypeSystem exception due to a malformed type/method, the exception will propagate, get handled, and cause the current
method being compiled to abort and be skipped (otherwise, the compiler will crash while emitting these problematic signatures)
src/coreclr/src/tools/Common/Compiler/CompilerTypeSystemContext.Validation.cs
src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DelegateCtorSignature.cs
src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/FieldFixupSignature.cs
src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/GenericLookupSignature.cs
src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/MethodFixupSignature.cs
src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ModuleTokenResolver.cs
src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/NewArrayFixupSignature.cs
src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/NewObjectFixupSignature.cs
src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/TypeFixupSignature.cs
src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunLibraryRootProvider.cs
src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs