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
24 changes: 5 additions & 19 deletions src/coreclr/src/jit/importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15595,23 +15595,6 @@ void Compiler::impImportBlockCode(BasicBlock* block)

case CEE_THROW:

if (compIsForInlining())
{
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// TODO: Will this be too strict, given that we will inline many basic blocks?
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

/* Do we have just the exception on the stack ?*/

if (verCurrentState.esStackDepth != 1)
{
/* if not, just don't inline the method */

compInlineResult->NoteFatal(InlineObservation::CALLEE_THROW_WITH_INVALID_STACK);
return;
}
}

if (tiVerificationNeeded)
{
tiRetVal = impStackTop().seTypeInfo;
Expand All @@ -15622,11 +15605,14 @@ void Compiler::impImportBlockCode(BasicBlock* block)
}
}

block->bbSetRunRarely(); // any block with a throw is rare
/* Pop the exception object and create the 'throw' helper call */
// Any block with a throw is rarely executed.
block->bbSetRunRarely();

// Pop the exception object and create the 'throw' helper call
op1 = gtNewHelperCallNode(CORINFO_HELP_THROW, TYP_VOID, gtNewCallArgs(impPopStack().val));

// Fall through to clear out the eval stack.

EVAL_APPEND:
if (verCurrentState.esStackDepth > 0)
{
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/src/jit/inline.def
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ INLINE_OBSERVATION(NOT_PROFITABLE_INLINE, bool, "unprofitable inline",
INLINE_OBSERVATION(RANDOM_REJECT, bool, "random reject", FATAL, CALLEE)
INLINE_OBSERVATION(STACK_CRAWL_MARK, bool, "uses stack crawl mark", FATAL, CALLEE)
INLINE_OBSERVATION(STFLD_NEEDS_HELPER, bool, "stfld needs helper", FATAL, CALLEE)
INLINE_OBSERVATION(THROW_WITH_INVALID_STACK, bool, "throw with invalid stack", FATAL, CALLEE)
INLINE_OBSERVATION(TOO_MANY_ARGUMENTS, bool, "too many arguments", FATAL, CALLEE)
INLINE_OBSERVATION(TOO_MANY_LOCALS, bool, "too many locals", FATAL, CALLEE)
INLINE_OBSERVATION(EXPLICIT_TAIL_PREFIX, bool, "explicit tail prefix in callee",FATAL, CALLEE)
Expand Down