Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 30, 2026

Description

ARM32 JIT dump/disasm asserts when encountering async resume info references. The IF_T2_N2 instruction format handles both block address tables and async resume info, but the dump logic only expected the former.

Changes

  • Remove assert in emitarm.cpp:7308: Was failing when jdsc is null (async resume info case)
  • Add null check before table dump: Skip inline block address table dump when jdsc is null
  • Use nullptr instead of NULL: Modern C++ style throughout the code block
  • Add conditional printing: Print RWD%02zu format for async resume info (when jdsc is null) and J_M%03u_DS%02u format for block address tables (when jdsc is not null)
  • Clarify comment: Document when jdsc is null vs non-null

The fix preserves all existing dump behavior for block address tables while allowing async resume info to display properly without assertion.

// Before: would assert if jdsc is null and always print as DS format
assert(jdsc != NULL);
printf("... J_M%03u_DS%02u", ...);
if (id->idIns() == INS_movt) { /* dump table using jdsc */ }

// After: skip table dump when jdsc is null and use appropriate format
if (jdsc != nullptr)
    printf("... J_M%03u_DS%02u", ...);  // block address table
else
    printf("... RWD%02zu", ...);         // async resume info
if (jdsc != nullptr && id->idIns() == INS_movt) { /* dump table using jdsc */ }

Affects dump/disasm output only; no impact on code generation.

Original prompt

This section details on the original issue you should resolve

<issue_title>JIT: fix arm32 dump/disasm of references to async resume info</issue_title>
<issue_description>See #123781 (comment)

Seemingly IF_T2_N2 expects the data to resolve to a table of block addresses, so if we reuse this form for references to async resume info it doesn't display properly.

I think this just impacts dumping and disasm. But not 100% sure.
</issue_description>

<agent_instructions>Fix this issue by handling gracefully the situation where jdsc is null -- skip the inline table dump logic in that case</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 30, 2026 20:10
Co-authored-by: jakobbotsch <7887810+jakobbotsch@users.noreply.github.com>
Co-authored-by: jakobbotsch <7887810+jakobbotsch@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix arm32 dump/disasm of async resume info references JIT: fix arm32 dump/disasm of references to async resume info Jan 30, 2026
…s-table data

Co-authored-by: jakobbotsch <7887810+jakobbotsch@users.noreply.github.com>
@jakobbotsch jakobbotsch marked this pull request as ready for review January 30, 2026 20:34
@jakobbotsch jakobbotsch requested review from a team and Copilot January 30, 2026 20:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an ARM32 JIT dump/disasm assertion failure that occurs when encountering async resume info references. The IF_T2_N2 instruction format is used for both block address tables (jump tables) and async resume info references, but the dump logic only expected block address tables.

Changes:

  • Removes assertion that fails when jdsc is null (async resume info case)
  • Adds conditional logic to handle both block address tables and async resume info appropriately
  • Updates NULL to nullptr for C++ style consistency

@jakobbotsch jakobbotsch merged commit 2772854 into main Jan 31, 2026
129 of 133 checks passed
@jakobbotsch jakobbotsch deleted the copilot/fix-arm32-async-resume-info branch January 31, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JIT: fix arm32 dump/disasm of references to async resume info

3 participants