Commit c37ea26
fix(hermes-base): fold UIntSwitchImm jump-table offsets in the equivalence check
The two switch instructions carry the jump-table offset in different
operands:
StringSwitchImm rX, <id>, <jtOffset>, <defaultLabel>, <count>
UIntSwitchImm rX, <jtOffset>, <defaultLabel>, <min>, <max>
Only the first shape was folded. Under -pretty-disassemble the default
target of a UIntSwitchImm prints as a label (`L3`), so the existing regex
— which expects a second number where the label is — never matched, and
a jump-table offset that had simply moved with instruction widths read as
a real difference. --verifyHermesBase then dropped a perfectly good delta
build and fell back to the plain compile, silently, on exactly the bundles
where switches are common.
Found while benchmarking delta mode on the RN 0.86 example app: the
~300 LOC scenario failed on one line (5937 vs 5938) and lost the delta
build, taking its patch from 97.8 KB to 381.0 KB — 3.9x larger. With this
fix all three scenarios verify clean (566k-591k instructions compared).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U1e5fWU5jWwgH4ctKwYx5y1 parent f372289 commit c37ea26
2 files changed
Lines changed: 22 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
643 | 643 | | |
644 | 644 | | |
645 | 645 | | |
646 | | - | |
647 | | - | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
648 | 653 | | |
649 | 654 | | |
| 655 | + | |
| 656 | + | |
650 | 657 | | |
651 | 658 | | |
652 | 659 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
464 | 477 | | |
465 | 478 | | |
466 | 479 | | |
| |||
0 commit comments