Skip to content

bugc: flatten TCO back-edge JUMP context#244

Open
gnidan wants to merge 1 commit into
mainfrom
compiler-flatten-tco-jump
Open

bugc: flatten TCO back-edge JUMP context#244
gnidan wants to merge 1 commit into
mainfrom
compiler-flatten-tco-jump

Conversation

@gnidan

@gnidan gnidan commented Jul 3, 2026

Copy link
Copy Markdown
Member

The TCO back-edge JUMP emitted a gather wrapper around its invoke and return contexts. Multiple discriminator keys can coexist on a single context object, so the JUMP now carries a flat combined context with both invoke and return directly (buildTailCallJumpOptions). Also updates a neighboring call-site comment that still described the old gather shape.

optimizer-contexts.test's countCallSites now checks invoke and return independently (not either/or), so a flat multi-discriminator context is counted in both; the TCO assertion finds the back-edge JUMP by the presence of both discriminators rather than a gather wrapper.

The TCO back-edge JUMP previously emitted a gather wrapper around
its invoke and return contexts. Multiple discriminator keys can
coexist on a single context object without gather wrapping, so the
JUMP now carries a flat combined context with both `invoke` and
`return` keys directly. Also updates the neighboring call-site
comment that still described the old gather shape.

Updates the countCallSites helper in optimizer-contexts.test to
check invoke and return independently rather than as an either/or,
so flat multi-discriminator contexts get counted in both buckets.
The TCO-specific assertion now finds the back-edge JUMP by the
presence of both discriminators rather than by a gather wrapper.
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://ethdebug.github.io/format/pr-preview/pr-244/

Built to branch gh-pages at 2026-07-03 21:52 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

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.

1 participant