Uh oh!
There was an error while loading. Please reload this page.
[clr-interp] Implement tail-calling for delegates and support for delegates in wasm - #120205
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.
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 |
Uh oh!
There was an error while loading. Please reload this page.
kg
left a comment
There was a problem hiding this comment.
Looks right other than Copilot's comment pointing out the potential null dereference for static delegates
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.