fix(bytecode): skip DUPN/SWAPN/EXCHANGE immediates in analyze_legacy#3801
Open
cuiweixie wants to merge 1 commit into
Open
fix(bytecode): skip DUPN/SWAPN/EXCHANGE immediates in analyze_legacy#3801cuiweixie wants to merge 1 commit into
cuiweixie wants to merge 1 commit into
Conversation
Treat these opcodes like PUSH when building the jump table so JUMPDEST bytes in the immediate are not marked valid, and simplify padding now that incomplete immediates are covered by iterator overflow.
cuiweixie
force-pushed
the
fix/analyze-legacy-dupn-swapn-exchange-immediate
branch
from
July 15, 2026 23:03
8c93604 to
83a6bf9
Compare
Merging this PR will improve performance by 3.59%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | Simulation | blake2/2_rounds |
3.4 µs | 3.2 µs | +3.59% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing cuiweixie:fix/analyze-legacy-dupn-swapn-exchange-immediate (83a6bf9) with main (a094a93)
Footnotes
-
1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports. ↩
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.
Summary
DUPN/SWAPN/EXCHANGEduring legacy analysis (same asPUSH), so aJUMPDESTbyte in that immediate is not marked as a valid jump target.STOPwhen needed.Test plan
cargo test -p revm-bytecode --lib dupn_swapn -- --nocapturecargo test -p revm-bytecode --lib legacy::analysis::tests