From a089c92ad3a3682c295e3e5b4e15be28cccdb0d3 Mon Sep 17 00:00:00 2001 From: Sergey Andreenko Date: Tue, 19 Jun 2018 18:01:36 -0700 Subject: [PATCH] Fix Complus_JitMinOpts for the first method (dotnet/coreclr#18555) Commit migrated from https://github.com/dotnet/coreclr/commit/1731c34ffbffbe3157ebd1368ab5420483efe1fc --- src/coreclr/src/jit/compiler.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/coreclr/src/jit/compiler.cpp b/src/coreclr/src/jit/compiler.cpp index 4af8d5f..9706ece 100644 --- a/src/coreclr/src/jit/compiler.cpp +++ b/src/coreclr/src/jit/compiler.cpp @@ -4078,7 +4078,8 @@ void Compiler::compSetOptimizationLevel() if (!theMinOptsValue && (jitMinOpts > 0)) { - unsigned methodCount = Compiler::jitTotalMethodCompiled; + // jitTotalMethodCompiled does not include the method that is being compiled now, so make +1. + unsigned methodCount = Compiler::jitTotalMethodCompiled + 1; unsigned methodCountMask = methodCount & 0xFFF; unsigned kind = (jitMinOpts & 0xF000000) >> 24; switch (kind) -- 2.7.4