Skip to content
This repository was archived by the owner on Nov 13, 2026. It is now read-only.
This repository was archived by the owner on Nov 13, 2026. It is now read-only.

Generate reverse PInvoke transitions in the JIT #611

Closed

Description

@jkotas

The JIT needs to generate the following code in prolog/epilog of reverse PInvoke calls. There needs to be a new flag added to JIT-EE interface to mark these methods (e.g. it can be called CORINFO_FLG_NATIVECALLABLE):

    <regular prolog – allocate stack frame, spill argument registers, etc.>
    ReservePInvokeTransitionFrame frame; // opaque local - the size is returned via JIT-EE interface
    lea arg0, &frame
    // No managed references can be in registers before the ENTER callout
    call JIT_REVERSEPINVOKE_ENTER // new JIT helper
    …
    <method body>
    …
    lea arg0, &frame
    call JIT_REVERSEPINVOKE_EXIT // new JIT helper
    // No managed references can be in registers after the EXIT callout
    <regular epilog– setup return value, deallocate stack frame and return, etc.>

None of this exist in RyuJIT today, but there are other prolog/epilog callbacks with similar structure.

Activity

  1. added this to the milestone on Jan 8, 2016
  2. assigned and unassigned on Jan 11, 2016
  3. jkotas commented on Jun 24, 2016

    @jkotas
    MemberAuthor

    This is done.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions