Skip to content
Merged
2 changes: 1 addition & 1 deletion src/coreclr/jit/codegenarm64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5937,7 +5937,7 @@ BasicBlock* CodeGen::genGetThrowHelper(SpecialCodeKind codeKind)
{
// For code with throw helper blocks, find and use the helper block for
// raising the exception. The block may be shared by other trees too.
Compiler::AddCodeDsc* add = compiler->fgFindExcptnTarget(codeKind, compiler->compCurBB);
Compiler::AddCodeDsc* add = compiler->fgGetExcptnTarget(codeKind, compiler->compCurBB);
assert((add != nullptr) && ("ERROR: failed to find exception throw block"));
assert(add->acdUsed);
excpRaisingBlock = add->acdDstBlk;
Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1623,7 +1623,7 @@ void CodeGen::genExitCode(BasicBlock* block)
// genJumpToThrowHlpBlk: Generate code for an out-of-line exception.
//
// Notes:
// For code that uses throw helper blocks, we share the helper blocks created by fgAddCodeRef().
// For code that uses throw helper blocks, we share the helper blocks.
// Otherwise, we generate the 'throw' inline.
//
// Arguments:
Expand Down Expand Up @@ -1653,7 +1653,7 @@ void CodeGen::genJumpToThrowHlpBlk(emitJumpKind jumpKind, SpecialCodeKind codeKi
excpRaisingBlock = failBlk;

#ifdef DEBUG
Compiler::AddCodeDsc* add = compiler->fgFindExcptnTarget(codeKind, compiler->compCurBB);
Compiler::AddCodeDsc* add = compiler->fgGetExcptnTarget(codeKind, compiler->compCurBB);
assert(add->acdUsed);
assert(excpRaisingBlock == add->acdDstBlk);
#if !FEATURE_FIXED_OUT_ARGS
Expand All @@ -1664,7 +1664,7 @@ void CodeGen::genJumpToThrowHlpBlk(emitJumpKind jumpKind, SpecialCodeKind codeKi
else
{
// Find the helper-block which raises the exception.
Compiler::AddCodeDsc* add = compiler->fgFindExcptnTarget(codeKind, compiler->compCurBB);
Compiler::AddCodeDsc* add = compiler->fgGetExcptnTarget(codeKind, compiler->compCurBB);
assert((add != nullptr) && ("ERROR: failed to find exception throw block"));
assert(add->acdUsed);
excpRaisingBlock = add->acdDstBlk;
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/jit/codegenloongarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6514,7 +6514,7 @@ inline void CodeGen::genJumpToThrowHlpBlk_la(
excpRaisingBlock = failBlk;

#ifdef DEBUG
Compiler::AddCodeDsc* add = compiler->fgFindExcptnTarget(codeKind, compiler->compCurBB);
Compiler::AddCodeDsc* add = compiler->fgGetExcptnTarget(codeKind, compiler->compCurBB);
assert(add->acdUsed);
assert(excpRaisingBlock == add->acdDstBlk);
#if !FEATURE_FIXED_OUT_ARGS
Expand All @@ -6525,7 +6525,7 @@ inline void CodeGen::genJumpToThrowHlpBlk_la(
else
{
// Find the helper-block which raises the exception.
Compiler::AddCodeDsc* add = compiler->fgFindExcptnTarget(codeKind, compiler->compCurBB);
Compiler::AddCodeDsc* add = compiler->fgGetExcptnTarget(codeKind, compiler->compCurBB);
assert((add != nullptr) && ("ERROR: failed to find exception throw block"));
assert(add->acdUsed);
excpRaisingBlock = add->acdDstBlk;
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/jit/codegenriscv64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6202,7 +6202,7 @@ void CodeGen::genJumpToThrowHlpBlk_la(
excpRaisingBlock = failBlk;

#ifdef DEBUG
Compiler::AddCodeDsc* add = compiler->fgFindExcptnTarget(codeKind, compiler->compCurBB);
Compiler::AddCodeDsc* add = compiler->fgGetExcptnTarget(codeKind, compiler->compCurBB);
assert(add->acdUsed);
assert(excpRaisingBlock == add->acdDstBlk);
#if !FEATURE_FIXED_OUT_ARGS
Expand All @@ -6213,7 +6213,7 @@ void CodeGen::genJumpToThrowHlpBlk_la(
else
{
// Find the helper-block which raises the exception.
Compiler::AddCodeDsc* add = compiler->fgFindExcptnTarget(codeKind, compiler->compCurBB);
Compiler::AddCodeDsc* add = compiler->fgGetExcptnTarget(codeKind, compiler->compCurBB);
assert((add != nullptr) && ("ERROR: failed to find exception throw block"));
assert(add->acdUsed);
excpRaisingBlock = add->acdDstBlk;
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/codegenwasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ void CodeGen::genCodeForNullCheck(GenTreeIndir* tree)
// TODO-WASM: refactor once we have implemented other cases invoking throw helpers
if (compiler->fgUseThrowHelperBlocks())
{
Compiler::AddCodeDsc* const add = compiler->fgFindExcptnTarget(SCK_NULL_CHECK, compiler->compCurBB);
Compiler::AddCodeDsc* const add = compiler->fgGetExcptnTarget(SCK_NULL_CHECK, compiler->compCurBB);

if (add == nullptr)
{
Expand Down
4 changes: 0 additions & 4 deletions src/coreclr/jit/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4898,10 +4898,6 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl
// Insert GC Polls
DoPhase(this, PHASE_INSERT_GC_POLLS, &Compiler::fgInsertGCPolls);

// Create any throw helper blocks that might be needed
//
DoPhase(this, PHASE_CREATE_THROW_HELPERS, &Compiler::fgCreateThrowHelperBlocks);

if (opts.OptimizationEnabled())
{
// Conditional to switch conversion, and switch peeling
Expand Down
11 changes: 5 additions & 6 deletions src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -6774,7 +6774,7 @@ class Compiler

struct AddCodeDsc
{
// After fgCreateThrowHelperBlocks, the block to which
// The block to which
// we jump to raise the exception.
BasicBlock* acdDstBlk;

Expand Down Expand Up @@ -6838,16 +6838,15 @@ class Compiler
private:
static unsigned acdHelper(SpecialCodeKind codeKind);

bool fgRngChkThrowAdded = false;
AddCodeDscMap* fgAddCodeDscMap = nullptr;

void fgAddCodeRef(BasicBlock* srcBlk, SpecialCodeKind kind);
PhaseStatus fgCreateThrowHelperBlocks();
AddCodeDsc* fgCreateAddCodeDsc(BasicBlock* fromBlock, SpecialCodeKind kind);
void fgCreateThrowHelperBlock(AddCodeDsc* add);

public:

bool fgRngChkThrowAdded = false;
bool fgHasAddCodeDscMap() const { return fgAddCodeDscMap != nullptr; }
AddCodeDsc* fgFindExcptnTarget(SpecialCodeKind kind, BasicBlock* fromBlock);
AddCodeDsc* fgGetExcptnTarget(SpecialCodeKind kind, BasicBlock* fromBlock, bool createIfNeeded = false);
bool fgUseThrowHelperBlocks();
void fgCreateThrowHelperBlockCode(AddCodeDsc* add);
void fgSequenceLocals(Statement* stmt);
Expand Down
Loading
Loading