Skip to content

Conversation

davidwrighton
Copy link
Member

  • Add a new opcode
  • Add a new invocation method. Note that this needs to have the same copy the CallStubHeader logic as calli, as the target is not consistent from use to use

- Add a new opcode
- Add a new invocation method. Note that this needs to have the same copy the CallStubHeader logic as calli, as the target is not consistent from use to use
@Copilot Copilot AI review requested due to automatic review settings August 5, 2025 18:47
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Aug 5, 2025
@davidwrighton davidwrighton added area-CodeGen-Interpreter-coreclr and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Aug 5, 2025
Copy link
Contributor

@Copilot Copilot AI left a 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 intrinsic handling for delegate Invoke methods in the CoreCLR interpreter by introducing a specialized execution path for delegate invocations. The changes optimize delegate calls by avoiding generic method dispatch overhead.

Key changes:

  • Adds a new INTOP_CALLDELEGATE opcode specifically for delegate invoke operations
  • Implements InvokeDelegateInvokeMethod function that handles delegate-specific invocation logic
  • Updates the compiler to detect and emit the new opcode for delegate invoke methods

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/coreclr/vm/interpexec.cpp Adds InvokeDelegateInvokeMethod function and INTOP_CALLDELEGATE case handler
src/coreclr/interpreter/intops.def Defines the new INTOP_CALLDELEGATE opcode
src/coreclr/interpreter/compiler.cpp Updates compiler to detect delegate invoke methods and emit the new opcode

@davidwrighton davidwrighton changed the title [Interpreter] Intrinic handling for Delegate Invoke methods [clr-interp] Intrinic handling for Delegate Invoke methods Aug 5, 2025
Copy link
Member

@janvorli janvorli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@jkotas
Copy link
Member

jkotas commented Aug 6, 2025

Test failure looks related to the PR:

System.Exception: Interpreted App failed execution
at InterpreterTester.RunTests()

@davidwrighton davidwrighton merged commit 5c5ed27 into dotnet:main Aug 7, 2025
90 of 92 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Sep 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants