You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Async resumption stubs in crossgen require special casing from the jit to set the thumb bit #125788
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.
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.
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.
Activity
jtschuster commentedon May 14, 2026
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
MichalStrehovsky commentedon May 14, 2026
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.
davidwrighton commentedon May 15, 2026
I'm ok with your simplification. I want I'll and crossgen2 to be as similar as is reasonable.