-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Mono] Stop falling back to interpreter for runtime invoke #95469
[Mono] Stop falling back to interpreter for runtime invoke #95469
Conversation
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
All CI failures are known and unrelated to this PR. |
@@ -3401,7 +3401,7 @@ mono_llvmonly_runtime_invoke (MonoMethod *method, RuntimeInvokeInfo *info, void | |||
for (i = 0; i < sig->param_count; ++i) { | |||
MonoType *t = sig->params [i]; | |||
|
|||
if (!m_type_is_byref (t) && (MONO_TYPE_IS_REFERENCE (t) || t->type == MONO_TYPE_PTR)) { | |||
if (!m_type_is_byref (t) && (MONO_TYPE_IS_REFERENCE (t) || t->type == MONO_TYPE_PTR || t->type == MONO_TYPE_FNPTR)) { | |||
param_refs [i] = params [i]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested locally. Full aot, which iOS uses, didn't go through this codepath.
This PR stops most of the runtime invoke calls falling back to interpreter when
MONO_AOT_MODE_LLVMONLY_INTERP
mode is set.MONO_AOT_MODE_LLVMONLY_INTERP
mode is set only when one of these two switches is passed to Mono AOT:WASM AOT is the only major target uses it. It was setup here:
runtime/src/mono/wasm/build/WasmApp.Native.targets
Line 665 in 7bbfcc4
This PR should resolve some of, if not all of, the performance regression (dotnet/perf-autofiling-issues#24928) introduced by enabling
WasmStripILAfterAOT
by default.This PR also contains a fix to the problem with Mono LLVM AOT when a runtime invoke calling a method with delegate parameters. The delegate parameter wasn't handled properly before.
The following C# program is a demonstration of the problem
cc: @lewing