From 5db87351776d5a55efcf78878939466920d65175 Mon Sep 17 00:00:00 2001 From: Sergey Andreenko Date: Tue, 10 Oct 2017 13:37:41 -0700 Subject: [PATCH] do not spill stack after CEE_NEWARR and CEE_NEWOBJ. (#14401) Fixes coreRT issue with "InitializeArray intrinsic must always be expanded". --- src/jit/importer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jit/importer.cpp b/src/jit/importer.cpp index 98873bb..f655955 100644 --- a/src/jit/importer.cpp +++ b/src/jit/importer.cpp @@ -2596,9 +2596,9 @@ inline IL_OFFSETX Compiler::impCurILOffset(IL_OFFSET offs, bool callInstruction) // true if it is legal, false if it could be a sequence that we do not want to divide. bool Compiler::impCanSpillNow(OPCODE prevOpcode) { - // Don't spill after ldtoken, because it could be a part of the InitializeArray sequence. + // Don't spill after ldtoken, newarr and newobj, because it could be a part of the InitializeArray sequence. // Avoid breaking up to guarantee that impInitializeArrayIntrinsic can succeed. - return prevOpcode != CEE_LDTOKEN; + return (prevOpcode != CEE_LDTOKEN) && (prevOpcode != CEE_NEWARR) && (prevOpcode != CEE_NEWOBJ); } /***************************************************************************** -- 2.7.4