Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEgor Bogatov <egorbo@gmail.com>2021-03-10 09:36:04 +0300
committerGitHub <noreply@github.com>2021-03-10 09:36:04 +0300
commitbeb14c143947346cf9c09ca056a0cee7fcc72108 (patch)
tree15002443cd9b6f1970f72252a067ab8be36e0e41 /src/coreclr/jit/flowgraph.cpp
parent3eddf4a06b0755747f8e8d659264694eef1f31ee (diff)
JIT: Non-void ThrowHelpers (#48589)
Diffstat (limited to 'src/coreclr/jit/flowgraph.cpp')
-rw-r--r--src/coreclr/jit/flowgraph.cpp23
1 files changed, 4 insertions, 19 deletions
diff --git a/src/coreclr/jit/flowgraph.cpp b/src/coreclr/jit/flowgraph.cpp
index 8b89c2e5945..9fb40992904 100644
--- a/src/coreclr/jit/flowgraph.cpp
+++ b/src/coreclr/jit/flowgraph.cpp
@@ -684,31 +684,16 @@ PhaseStatus Compiler::fgImport()
bool Compiler::fgIsThrow(GenTree* tree)
{
- if ((tree->gtOper != GT_CALL) || (tree->AsCall()->gtCallType != CT_HELPER))
+ if (!tree->IsCall())
{
return false;
}
-
- // TODO-Throughput: Replace all these calls to eeFindHelper() with a table based lookup
-
- if ((tree->AsCall()->gtCallMethHnd == eeFindHelper(CORINFO_HELP_OVERFLOW)) ||
- (tree->AsCall()->gtCallMethHnd == eeFindHelper(CORINFO_HELP_VERIFICATION)) ||
- (tree->AsCall()->gtCallMethHnd == eeFindHelper(CORINFO_HELP_RNGCHKFAIL)) ||
- (tree->AsCall()->gtCallMethHnd == eeFindHelper(CORINFO_HELP_THROWDIVZERO)) ||
- (tree->AsCall()->gtCallMethHnd == eeFindHelper(CORINFO_HELP_THROWNULLREF)) ||
- (tree->AsCall()->gtCallMethHnd == eeFindHelper(CORINFO_HELP_THROW)) ||
- (tree->AsCall()->gtCallMethHnd == eeFindHelper(CORINFO_HELP_RETHROW)) ||
- (tree->AsCall()->gtCallMethHnd == eeFindHelper(CORINFO_HELP_THROW_TYPE_NOT_SUPPORTED)) ||
- (tree->AsCall()->gtCallMethHnd == eeFindHelper(CORINFO_HELP_THROW_PLATFORM_NOT_SUPPORTED)))
+ GenTreeCall* call = tree->AsCall();
+ if ((call->gtCallType == CT_HELPER) && s_helperCallProperties.AlwaysThrow(eeGetHelperNum(call->gtCallMethHnd)))
{
- noway_assert(tree->gtFlags & GTF_CALL);
- noway_assert(tree->gtFlags & GTF_EXCEPT);
+ noway_assert(call->gtFlags & GTF_EXCEPT);
return true;
}
-
- // TODO-CQ: there are a bunch of managed methods in System.ThrowHelper
- // that would be nice to recognize.
-
return false;
}