Skip to content

Conversation

@EgorBo
Copy link
Member

@EgorBo EgorBo commented Nov 5, 2025

No description provided.

@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 Nov 5, 2025
@EgorBo
Copy link
Member Author

EgorBo commented Nov 5, 2025

@MihuBot

@dotnet-policy-service
Copy link
Contributor

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


result = (CORINFO_METHOD_HANDLE)pUnboxedMD;
requiresInstMTArg = !!pUnboxedMD->RequiresInstMethodTableArg();
// Give up on methods which may potentially expose byrefs to struct's fields:
Copy link
Member

Choose a reason for hiding this comment

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

This makes assumptions about the kind of optimizations that the JIT may perform. Should this check be done by the JIT, or be explicitly requested in the JIT/EE API?

// Give up on methods which may potentially expose byrefs to struct's fields:
// * byref return types
// * byref-like return types
// * byref to byref-like types in parameters
Copy link
Member

@jakobbotsch jakobbotsch Nov 6, 2025

Choose a reason for hiding this comment

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

What about a native pointer to a byref like type? Or worse, a void pointer cast in the body to a pointer to a byref like type.

I'm curious what exposed the problem here. It reminds me of the "unboxing of nullables" case a little bit where we don't produce a heap pointer. I wonder if we have to spec ourselves into being allowed to do this optimization.
(More robust would probably be to remove the box when we can prove that it doesn't escape.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants