From e076e83493ea009525960da7396e76744e9465f9 Mon Sep 17 00:00:00 2001 From: Andrew Au Date: Wed, 18 Sep 2019 13:34:22 -0700 Subject: [PATCH] Complete the filtering for MethodImpl.AggressiveOptimization (dotnet/coreclr#26756) Commit migrated from https://github.com/dotnet/coreclr/commit/2deec4cb9cff5bb03e7d9c71da043e3cbd9edea3 --- .../Compiler/ReadyToRunLibraryRootProvider.cs | 3 --- .../JitInterface/CorInfoImpl.ReadyToRun.cs | 14 +++++++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunLibraryRootProvider.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunLibraryRootProvider.cs index acff969..43a4538 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunLibraryRootProvider.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunLibraryRootProvider.cs @@ -107,9 +107,6 @@ namespace ILCompiler if (method.IsInternalCall) continue; - if (method.IsAggressiveOptimization) - continue; - try { CheckCanGenerateMethod(method); diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs index e732636..6b133a1 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs @@ -148,11 +148,23 @@ namespace Internal.JitInterface throw new NotSupportedException(); } + private bool ShouldSkipCompilation(IMethodNode methodCodeNodeNeedingCode) + { + return methodCodeNodeNeedingCode.Method.IsAggressiveOptimization; + } + public void CompileMethod(IReadyToRunMethodCodeNode methodCodeNodeNeedingCode) { _methodCodeNode = methodCodeNodeNeedingCode; - CompileMethodInternal(methodCodeNodeNeedingCode); + if (!ShouldSkipCompilation(methodCodeNodeNeedingCode)) + { + CompileMethodInternal(methodCodeNodeNeedingCode); + } + else + { + PublishEmptyCode(); + } } private SignatureContext GetSignatureContext() -- 2.7.4