Skip to content

Fix remaining uses of hccall #116561

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

Merged
merged 3 commits into from
Jun 17, 2025

Conversation

davidwrighton
Copy link
Member

@davidwrighton davidwrighton commented Jun 11, 2025

It is not generally safe to call jit helpers from native code anymore, and as such we don't need the HCCALL macro anymore.
 
This should fix #110512 and #116360

@Copilot Copilot AI review requested due to automatic review settings June 11, 2025 22:22
@davidwrighton davidwrighton requested a review from jkotas June 11, 2025 22:22
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 removes legacy HCCALL usage and switches to direct calls of JIT helper functions, replacing dynamic native wrappers with managed implementations and updating related declarations.

  • Directly call JIT helper entrypoints instead of using the HCCALL macro
  • Update StaticFieldAddressArgs to hold a code pointer and wire up managed StaticsHelpers methods
  • Remove unused native helper stubs and macro definitions

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/coreclr/vm/prestub.cpp Assigns helper entrypoint directly and switches to managed helper
src/coreclr/vm/jitinterface.h Changes staticBaseHelper type to PCODE, removes HCCALL typedef
src/coreclr/vm/jithelpers.cpp Deletes obsolete static field helper implementations
src/coreclr/vm/interpexec.cpp Replaces HCCALL1 invocations with direct helper calls
src/coreclr/vm/fcall.h Removes HCCALL macro definitions
src/coreclr/vm/corelib.h Adds method definitions for the new managed helpers
StaticsHelpers.cs (CoreLib) Introduces StaticFieldAddressArgs and managed helper methods

Copy link
Contributor

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

@davidwrighton
Copy link
Member Author

/ba-g The errors here are unrelated and not new

@davidwrighton davidwrighton requested a review from jkotas June 16, 2025 21:24
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!

@janvorli janvorli merged commit 300eba1 into dotnet:main Jun 17, 2025
94 of 97 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test failure: readytorun/tests/mainv2/mainv2.cmd
3 participants