Uh oh!
There was an error while loading. Please reload this page.
Implement interpreter PInvoke Calli - #119356
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements missing PInvoke support for the interpreter's Calli (indirect call) functionality in the CoreCLR runtime. The implementation ensures proper GC mode handling when calling native functions through function pointers.
Key changes:
- Added a new
InvokePInvokeCalliStubfunction that handles PInvoke calls with proper GC mode transitions - Extended the Calli opcode to include PInvoke detection information
- Refactored Calli emission code to centralize the logic and include calling convention analysis
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/vm/wasm/helpers.cpp | Added stub implementation of InvokePInvokeCalliStub for WASM platform |
| src/coreclr/vm/interpexec.cpp | Implemented InvokePInvokeCalliStub with proper GC transitions and updated Calli execution logic |
| src/coreclr/interpreter/intops.def | Extended Calli opcodes to include an additional parameter for PInvoke detection |
| src/coreclr/interpreter/compiler.h | Added declaration for new EmitCalli helper method |
| src/coreclr/interpreter/compiler.cpp | Implemented EmitCalli method and refactored call emission to use it |
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.
The Calli implementation was missing support for the case when the targer is a pinvoke. That resulted in errors due to incorrect GC mode. This change fixes that.
1b6d8da to
137d62bCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
* Disable calli with marshalled pinvokes * Refactor the target invocation methods
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.
The Calli implementation was missing support for the case when the targer is a pinvoke. That resulted in errors due to incorrect GC mode. This change fixes that.