From 45afaf92989faf211bb39e9d27ead7c88984bd7e Mon Sep 17 00:00:00 2001 From: Egor Bogatov Date: Thu, 19 Sep 2024 23:33:29 +0200 Subject: [PATCH] JIT: Don't expand virtual calls too early for minopts (#108002) --- src/coreclr/jit/importercalls.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/coreclr/jit/importercalls.cpp b/src/coreclr/jit/importercalls.cpp index 05ec46c51d1999..243829e086b9e3 100644 --- a/src/coreclr/jit/importercalls.cpp +++ b/src/coreclr/jit/importercalls.cpp @@ -376,8 +376,11 @@ var_types Compiler::impImportCall(OPCODE opcode, call = gtNewCallNode(CT_USER_FUNC, callInfo->hMethod, callRetTyp, di); call->gtFlags |= GTF_CALL_VIRT_VTABLE; - // Mark this method to expand the virtual call target early in fgMorphCall - call->AsCall()->SetExpandedEarly(); + if (opts.OptimizationEnabled()) + { + // Mark this method to expand the virtual call target early in fgMorphCall + call->AsCall()->SetExpandedEarly(); + } break; }