feat: fuse ref-typed producer chains into single closure#28
Merged
Conversation
Extend LOCAL_GET (ref local) and CONST_GET (ref const) to peek forward for a complete ref-op pattern and emit one fused closure for the whole sequence, eliminating the box/push/pop/unbox round-trips between the producers and the consumer. Patterns fused: - (LOCAL_GET | CONST_GET) ref ; (STRING_LEN | ARRAY_LEN | REF_IS_NULL) - (LOCAL_GET | CONST_GET) ref ; (LOCAL_GET | CONST_GET) ref ; (STRING_EQ/NE/LT/GT/LE/GE | REF_EQ/NE) - (LOCAL_GET | CONST_GET) ref ; (LOCAL_GET | CONST_GET | I32_CONST) i32 ; (ARRAY_GET | STRUCT_GET) Also implement the previously-missing ARRAY_LEN standalone handler. https://claude.ai/code/session_01RrSBvV6e6HJPo6sFrX24Vq
Merge peekRefLoader, peekI32Loader, fuse1ArgRefOp, fuse2ArgRefOp, fuseArrayGet, and fuseStructGet into one fuseRefOp helper that mirrors the fuseI32 / fuseI64 / fuseF32 / fuseF64 shape (peek + switch + single closure body), and replace the four sequential fusion attempts in the LOCAL_GET / CONST_GET ref branches with a single fuseRefOp call so the ref branches read the same way the primitive branches do. https://claude.ai/code/session_01RrSBvV6e6HJPo6sFrX24Vq
Owner
Author
PR Review — feat: fuse ref-typed producer chains into single closureDecision✅ Merge-Ready SummaryThis PR is ready for merge. It implements a focused optimization for ref-type bytecode instruction chains, eliminating unnecessary box/push/pop/unbox round-trips. Strengths:
Patterns fused:
Readiness Checklist
Ready to merge. Generated by Claude Code |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #28 +/- ##
==========================================
+ Coverage 55.77% 56.20% +0.43%
==========================================
Files 48 48
Lines 7659 7876 +217
==========================================
+ Hits 4272 4427 +155
- Misses 2949 2995 +46
- Partials 438 454 +16 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extend LOCAL_GET (ref local) and CONST_GET (ref const) to peek forward
for a complete ref-op pattern and emit one fused closure for the whole
sequence, eliminating the box/push/pop/unbox round-trips between the
producers and the consumer.
Patterns fused:
(STRING_EQ/NE/LT/GT/LE/GE | REF_EQ/NE)
(ARRAY_GET | STRUCT_GET)
Also implement the previously-missing ARRAY_LEN standalone handler.
https://claude.ai/code/session_01RrSBvV6e6HJPo6sFrX24Vq