-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[clr-interp] Implement tail-calling for delegates and support for delegates in wasm #120205
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
Conversation
…egates in wasm - Disable shuffle thunk creation for portable entrypoints and enable ILDelegateShuffle thunks instead - Also implement the shuffle thunk in the interpreter directly so that most cases don't need to even use those in WASM or cases where we have pregenerated code - Add a new opcode for tail-calling a delegate method
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.
Pull Request Overview
This PR implements tail-calling for delegates in the CLR interpreter and enables delegate support in WebAssembly by modifying how delegate shuffle thunks are handled.
- Adds a new
INTOP_CALLDELEGATE_TAILopcode for tail-calling delegate methods - Disables shuffle thunk creation for portable entrypoints and enables IL delegate shuffle thunks instead
- Implements shuffle thunk logic directly in the interpreter to avoid needing shuffle thunks for most WASM cases
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/coreclr/vm/interpexec.cpp | Implements tail-call delegate handling and direct shuffle thunk execution in interpreter |
| src/coreclr/vm/comdelegate.cpp | Disables portable shuffle array generation and enables IL delegate shuffle thunks for portable entrypoints |
| src/coreclr/interpreter/inc/intops.def | Adds new INTOP_CALLDELEGATE_TAIL opcode definition |
| src/coreclr/interpreter/compiler.cpp | Emits INTOP_CALLDELEGATE_TAIL opcode for tail-call delegate invocations |
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.
Looks right other than Copilot's comment pointing out the potential null dereference for static delegates
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.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
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.
LGTM, thank you!
Uh oh!
There was an error while loading. Please reload this page.