Skip to content

Async resumption stubs in crossgen require special casing from the jit to set the thumb bit #125788

Closed

Description

@jtschuster

See #125421 and #126294 for more information.

The runtime and ilc handle setting the thumb bit during compilation/emission of methods. ILC emits symbol definitions with the thumb bit, but crossgen emits method body symbols as RVAs of the code, and adds an addend to any relocs to the symbols. This meant that when the JIT would emit a reloc directly to the resumption stub, it needed to include the thumb bit addend only in crossgen compilations in #125421. It may be helpful to unify on a single behavior, either including the thumb bit in symbol definitions for method body nodes (make the field entries PCode) or making the resumption stub entrypoint a fixup.

ILC probably can't remove the thumb the method symbol definitions without messing up linking, so I don't see that as an option.

cc @MichalStrehovsky @jakobbotsch

Activity

  1. added this to the 11.0.0 milestone on Mar 19, 2026
  2. jtschuster commented on May 14, 2026

    @jtschuster
    MemberAuthor

    I created a draft PR adding the thumb bit to the symbol definition in crossgen2: #128235

    The differences in output are in the DelayLoadMethodCallThunks table and ExceptionInfo. Both of these currently have fields that are RVA's of methods, not PCode, and are not used to jump into the method code, so they don't have the thumb bit. If we make this change, we'd either need to update the name and expectation, and maybe use PCode instead of PInstr for the fields, or create a new node type to represent the RVA of the method code rather that a pointer to the method code. I don't yet have a preference or intuition on what would be better.

    cc @davidwrighton @MichalStrehovsky if you have opinions

  3. MichalStrehovsky commented on May 14, 2026

    @MichalStrehovsky
    Member

    Does the draft PR work with the subtractions? If so, I don't see anything bad with doing subtractions where needed. If I'm counting correctly, we'd be swapping 4 places that need to do additions for 2 places that need to do subtractions. So less special casing.

  4. davidwrighton commented on May 15, 2026

    @davidwrighton
    Member

    I'm ok with your simplification. I want I'll and crossgen2 to be as similar as is reasonable.

  5. locked and limited conversation to collaborators on Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions