Repository navigation
JIT: REX.W prefix jmp [abs32] form used for tailcalls - #136845
Conversation
Like other instructions emitted in the epilog this one must be rex.w prefixed for the unwinder to recognize it as being part of an epilog. Also avoid using APX registers for the target register; encoding those will require prefixes that also are not recognized by the unwinder. Fix dotnet#129071
|
Azure Pipelines: Successfully started running 5 pipeline(s). 10 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
APX will require UnwindInfo v3. UnwindInfo v3 does not disassemble the epilogs, and thus it does not have restrictions around instructions encodings. |
Good point! Undid that. |
|
cc @dotnet/jit-contrib PTAL @adamperlin |
JulieLeeMSFT
left a comment
There was a problem hiding this comment.
LGTM.
Both the size-computation path (emitxarch.cpp:11229-11234) and the encoding path (emitxarch.cpp:18511-18516) are consistent with how the existing addressing mode form already handles this at emitxarch.cpp:11171-11176 -- the reserved size and emitted bytes stay in sync.
The fix is scoped tightly to INS_tail_i_jmp only.
Like other instructions emitted in the epilog this one must be rex.w prefixed for the unwinder to recognize it as being part of an epilog.
Fix #129071
I did have Copilot validate based on the instructions in #129071 (comment), and it did see corruptions with the baseline JIT but not with the fixed JIT. No test added since it is very difficult to force the JIT to emit this form of epilog jump.