Skip to content

[clr-interp] Implement missing support for startup path - #118404

Merged
janvorli merged 5 commits into
dotnet:mainfrom
kotlarmilos:feature/clr-interp-startup-path-refactor
Aug 6, 2025
Merged

[clr-interp] Implement missing support for startup path#118404
janvorli merged 5 commits into
dotnet:mainfrom
kotlarmilos:feature/clr-interp-startup-path-refactor

Conversation

@kotlarmilos

Copy link
Copy Markdown
Member

Description

This PR includes several improvements to support interpreting methods on startup path:

  • Refactor string allocation to use a native-sized integer instead of a fixed-size integer type
  • Add support for CPBLK operation in the interpreter
  • Special-case constructors for RuntimeMethodHandle, RuntimeFieldHandle, and similar types to support value-type semantics

Contributes to #117556

…pport for CPBLK operation in interpreter; Special-case RuntimeHandle constructors
CopilotAI review requested due to automatic review settings August 5, 2025 18:16
@kotlarmiloskotlarmilos self-assigned this Aug 5, 2025
@github-actionsgithub-actionsBot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Aug 5, 2025
@kotlarmiloskotlarmilos added this to the 10.0.0 milestone Aug 5, 2025
@kotlarmiloskotlarmilos removed the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Aug 5, 2025

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 missing support for interpreting methods on the startup path by adding CPBLK instruction support, refactoring string allocation to use native-sized integers, and handling special constructor cases for runtime handle types.

Key changes:

  • Adds CPBLK (copy block) instruction implementation to the interpreter
  • Changes string allocation methods from int to nint for length parameters
  • Special-cases constructors for RuntimeMethodHandle, RuntimeFieldHandle, and RuntimeArgumentHandle to use value-type semantics

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

FileDescription
src/coreclr/vm/interpexec.cppImplements CPBLK instruction execution using memcpy
src/coreclr/interpreter/intops.defDefines CPBLK instruction metadata
src/coreclr/interpreter/compiler.cppAdds CPBLK compilation support and special constructor handling
src/coreclr/System.Private.CoreLib/src/System/String.CoreCLR.csChanges string allocation length parameter from int to nint

Comment threadsrc/coreclr/interpreter/compiler.cpp Outdated
Comment threadsrc/coreclr/vm/interpexec.cpp Outdated
Comment threadsrc/coreclr/interpreter/compiler.cpp Outdated
kg
kg approved these changes Aug 5, 2025
Comment threadsrc/coreclr/interpreter/compiler.cpp Outdated
Comment threadsrc/coreclr/vm/interpexec.cpp Outdated

@janvorlijanvorli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thank you!

@janvorli

Copy link
Copy Markdown
Member

/ba-g The System.Net.WebSockets.Client.Tests.CancelTest_SharedHandler_Loopback.ConnectAsync_Cancel_ThrowsCancellationException test failure is unrelated and happens because of a timeout.

@janvorli
janvorli merged commit e1feed8 into dotnet:mainAug 6, 2025
90 of 92 checks passed
@janvorlijanvorli mentioned this pull request Jul 10, 2025
66 tasks
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Sep 6, 2025
Sign up for freeto 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.

7 participants

@kotlarmilos@janvorli@kg@BrzVlad@jkotas@SingleAccretion