Complete the filtering for MethodImpl.AggressiveOptimization (dotnet/coreclr#26756)
authorAndrew Au <andrewau@microsoft.com>
Wed, 18 Sep 2019 20:34:22 +0000 (13:34 -0700)
committerMichal Strehovský <MichalStrehovsky@users.noreply.github.com>
Wed, 18 Sep 2019 20:34:22 +0000 (22:34 +0200)
Commit migrated from https://github.com/dotnet/coreclr/commit/2deec4cb9cff5bb03e7d9c71da043e3cbd9edea3

src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunLibraryRootProvider.cs
src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs

index acff969..43a4538 100644 (file)
@@ -107,9 +107,6 @@ namespace ILCompiler
                 if (method.IsInternalCall)
                     continue;
 
-                if (method.IsAggressiveOptimization)
-                    continue;
-
                 try
                 {
                     CheckCanGenerateMethod(method);
index e732636..6b133a1 100644 (file)
@@ -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()