Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions src/coreclr/jit/async.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,14 +481,6 @@ bool AsyncLiveness::IsLocalCaptureUnnecessary(unsigned lclNum)
return true;
}

#ifdef FEATURE_EH_WINDOWS_X86
if (lclNum == m_comp->lvaShadowSPslotsVar)
{
// Only expected to be live in handlers
return true;
}
#endif

if (lclNum == m_comp->lvaRetAddrVar)
{
return true;
Expand Down
3 changes: 0 additions & 3 deletions src/coreclr/jit/codegen.h
Original file line number Diff line number Diff line change
Expand Up @@ -1260,9 +1260,6 @@ class CodeGen final : public CodeGenInterface
#endif // TARGET_ARM64

void genEHCatchRet(BasicBlock* block);
#if defined(FEATURE_EH_WINDOWS_X86)
void genEHFinallyOrFilterRet(BasicBlock* block);
#endif // FEATURE_EH_WINDOWS_X86

void genMultiRegStoreToSIMDLocal(GenTreeLclVar* lclNode);
void genMultiRegStoreToLocal(GenTreeLclVar* lclNode);
Expand Down
61 changes: 8 additions & 53 deletions src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,6 @@ void CodeGen::genMarkLabelsForCodegen()
case BBJ_CALLFINALLY:
// The finally target itself will get marked by walking the EH table, below, and marking
// all handler begins.
if (compiler->UsesCallFinallyThunks())
{
// For callfinally thunks, we need to mark the block following the callfinally/callfinallyret pair,
// as that's needed for identifying the range of the "duplicate finally" region in EH data.
Expand Down Expand Up @@ -1626,7 +1625,7 @@ void CodeGen::genJumpToThrowHlpBlk(emitJumpKind jumpKind, SpecialCodeKind codeKi
{
bool useThrowHlpBlk = compiler->fgUseThrowHelperBlocks();
#if defined(UNIX_X86_ABI)
// TODO: Is this really UNIX_X86_ABI specific? Should we guard with compiler->UsesFunclets() instead?
// TODO: Is this really UNIX_X86_ABI specific?
// Inline exception-throwing code in funclet to make it possible to unwind funclet frames.
useThrowHlpBlk = useThrowHlpBlk && (compiler->funCurrentFunc()->funKind == FUNC_ROOT);
#endif // UNIX_X86_ABI
Expand Down Expand Up @@ -4493,7 +4492,6 @@ void CodeGen::genReserveEpilog(BasicBlock* block)

void CodeGen::genReserveFuncletProlog(BasicBlock* block)
{
assert(compiler->UsesFunclets());
assert(block != nullptr);

/* Currently, no registers are live on entry to the prolog, except maybe
Expand Down Expand Up @@ -4524,7 +4522,6 @@ void CodeGen::genReserveFuncletProlog(BasicBlock* block)

void CodeGen::genReserveFuncletEpilog(BasicBlock* block)
{
assert(compiler->UsesFunclets());
assert(block != nullptr);

JITDUMP("Reserving funclet epilog IG for block " FMT_BB "\n", block->bbNum);
Expand Down Expand Up @@ -5379,31 +5376,6 @@ void CodeGen::genFnProlog()

genZeroInitFrame(untrLclHi, untrLclLo, initReg, &initRegZeroed);

#if defined(FEATURE_EH_WINDOWS_X86)
if (!compiler->UsesFunclets())
{
// when compInitMem is true the genZeroInitFrame will zero out the shadow SP slots
if (compiler->ehNeedsShadowSPslots() && !compiler->info.compInitMem)
{
// The last slot is reserved for ICodeManager::FixContext(ppEndRegion)
unsigned filterEndOffsetSlotOffs =
compiler->lvaLclStackHomeSize(compiler->lvaShadowSPslotsVar) - TARGET_POINTER_SIZE;

// Zero out the slot for nesting level 0
unsigned firstSlotOffs = filterEndOffsetSlotOffs - TARGET_POINTER_SIZE;

if (!initRegZeroed)
{
instGen_Set_Reg_To_Zero(EA_PTRSIZE, initReg);
initRegZeroed = true;
}

GetEmitter()->emitIns_S_R(ins_Store(TYP_I_IMPL), EA_PTRSIZE, initReg, compiler->lvaShadowSPslotsVar,
firstSlotOffs);
}
}
#endif // FEATURE_EH_WINDOWS_X86

genReportGenericContextArg(initReg, &initRegZeroed);

#ifdef JIT32_GCENCODER
Expand Down Expand Up @@ -5890,14 +5862,11 @@ void CodeGen::genGeneratePrologsAndEpilogs()

// Generate all the prologs and epilogs.

if (compiler->UsesFunclets())
{
// Capture the data we're going to use in the funclet prolog and epilog generation. This is
// information computed during codegen, or during function prolog generation, like
// frame offsets. It must run after main function prolog generation.
// Capture the data we're going to use in the funclet prolog and epilog generation. This is
// information computed during codegen, or during function prolog generation, like
// frame offsets. It must run after main function prolog generation.

genCaptureFuncletPrologEpilogInfo();
}
genCaptureFuncletPrologEpilogInfo();

// Walk the list of prologs and epilogs and generate them.
// We maintain a list of prolog and epilog basic blocks in
Expand Down Expand Up @@ -7101,24 +7070,10 @@ void CodeGen::genReturn(GenTree* treeNode)
#if defined(DEBUG) && defined(TARGET_XARCH)
bool doStackPointerCheck = compiler->opts.compStackCheckOnRet;

if (compiler->UsesFunclets())
// Don't do stack pointer check at the return from a funclet; only for the main function.
if (compiler->funCurrentFunc()->funKind != FUNC_ROOT)
{
// Don't do stack pointer check at the return from a funclet; only for the main function.
if (compiler->funCurrentFunc()->funKind != FUNC_ROOT)
{
doStackPointerCheck = false;
}
}
else
{
#if defined(FEATURE_EH_WINDOWS_X86)
// Don't generate stack checks for x86 finally/filter EH returns: these are not invoked
// with the same SP as the main function. See also CodeGen::genEHFinallyOrFilterRet().
if (compiler->compCurBB->KindIs(BBJ_EHFINALLYRET, BBJ_EHFAULTRET, BBJ_EHFILTERRET))
{
doStackPointerCheck = false;
}
#endif // FEATURE_EH_WINDOWS_X86
doStackPointerCheck = false;
}

genStackPointerCheck(doStackPointerCheck, compiler->lvaReturnSpCheck);
Expand Down
32 changes: 1 addition & 31 deletions src/coreclr/jit/codegenlinear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -658,26 +658,6 @@ void CodeGen::genCodeForBBlist()
#endif // DEBUG
} //------------------ END-FOR each block of the method -------------------

#if defined(FEATURE_EH_WINDOWS_X86)
// If this is a synchronized method on x86, and we generated all the code without
// generating the "exit monitor" call, then we must have deleted the single return block
// with that call because it was dead code. We still need to report the monitor range
// to the VM in the GC info, so create a label at the very end so we have a marker for
// the monitor end range.
//
// Do this before cleaning the GC refs below; we don't want to create an IG that clears
// the `this` pointer for lvaKeepAliveAndReportThis.

if (!compiler->UsesFunclets() && (compiler->info.compFlags & CORINFO_FLG_SYNCH) &&
(compiler->syncEndEmitCookie == nullptr))
{
JITDUMP("Synchronized method with missing exit monitor call; adding final label\n");
compiler->syncEndEmitCookie =
GetEmitter()->emitAddLabel(gcInfo.gcVarPtrSetCur, gcInfo.gcRegGCrefSetCur, gcInfo.gcRegByrefSetCur);
noway_assert(compiler->syncEndEmitCookie != nullptr);
}
#endif

// There could be variables alive at this point. For example see lvaKeepAliveAndReportThis.
// This call is for cleaning the GC refs
genUpdateLife(VarSetOps::MakeEmpty(compiler));
Expand Down Expand Up @@ -848,23 +828,13 @@ BasicBlock* CodeGen::genEmitEndBlock(BasicBlock* block)
break;

case BBJ_EHCATCHRET:
assert(compiler->UsesFunclets());
genEHCatchRet(block);
FALLTHROUGH;

case BBJ_EHFINALLYRET:
case BBJ_EHFAULTRET:
case BBJ_EHFILTERRET:
if (compiler->UsesFunclets())
{
genReserveFuncletEpilog(block);
}
#if defined(FEATURE_EH_WINDOWS_X86)
else
{
genEHFinallyOrFilterRet(block);
}
#endif // FEATURE_EH_WINDOWS_X86
genReserveFuncletEpilog(block);
break;

case BBJ_SWITCH:
Expand Down
Loading
Loading