Skip to content

Commit a270140

Browse files
authored
JIT: fix bug introduced by recent throw helper block changes (#93897)
`compUsesThrowHelper` indicates codegen will likely need to create a call to a helper, whether or not such calls are shared. In #93371 I didn't appreciate this, and so the JIT was failing to set `compUsesThrowHelper` in cases where a throw helper was going to be needed but throw helper calls were not going to be shared. Fixes #93710.
1 parent f28a8a7 commit a270140

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/coreclr/jit/flowgraph.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3537,9 +3537,15 @@ const char* sckName(SpecialCodeKind codeKind)
35373537
//
35383538
void Compiler::fgAddCodeRef(BasicBlock* srcBlk, SpecialCodeKind kind)
35393539
{
3540+
// Record that the code will call a THROW_HELPER
3541+
// so on Windows Amd64 we can allocate the 4 outgoing
3542+
// arg slots on the stack frame if there are no other calls.
3543+
//
3544+
compUsesThrowHelper = true;
3545+
35403546
if (!fgUseThrowHelperBlocks() && (kind != SCK_FAIL_FAST))
35413547
{
3542-
// FailFast will still use a thrwo helper, even in debuggable modes.
3548+
// FailFast will still use a common throw helper, even in debuggable modes.
35433549
//
35443550
return;
35453551
}
@@ -3548,11 +3554,6 @@ void Compiler::fgAddCodeRef(BasicBlock* srcBlk, SpecialCodeKind kind)
35483554

35493555
unsigned const refData = (kind == SCK_FAIL_FAST) ? 0 : bbThrowIndex(srcBlk);
35503556

3551-
// Record that the code will call a THROW_HELPER
3552-
// so on Windows Amd64 we can allocate the 4 outgoing
3553-
// arg slots on the stack frame if there are no other calls.
3554-
compUsesThrowHelper = true;
3555-
35563557
// Look for an existing entry that matches what we're looking for
35573558
//
35583559
AddCodeDsc* add = fgFindExcptnTarget(kind, refData);

0 commit comments

Comments
 (0)