-
Notifications
You must be signed in to change notification settings - Fork 95
MIR Codegen: Assembler Label & Jump Resolution #698
Copy link
Copy link
Open
Labels
A-codegenArea: code generation and MIRArea: code generation and MIRC-enhancementCategory: an issue proposing an enhancement or a PR with oneCategory: an issue proposing an enhancement or a PR with oneE-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.
Metadata
Metadata
Assignees
Labels
A-codegenArea: code generation and MIRArea: code generation and MIRC-enhancementCategory: an issue proposing an enhancement or a PR with oneCategory: an issue proposing an enhancement or a PR with oneE-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.
Summary
Implement correct label, jump, and PUSH-width resolution so scheduled EVM instruction sequences become final bytecode.
Parent issue: #687
Context
Currently, jumps in the codegen are placeholders. We need a proper assembler that:
Tasks
Label abstraction
JUMP/JUMPIinstructions target labels, not numeric offsetsTwo-pass assembly
PUSHn)Jump resolution
PUSHnfollowed byJUMP/JUMPIJUMPDEST handling
JUMPDESTlabel → JUMPDEST offsetJUMPDESTopcodes during linearizationExample
Patterns to follow
From Venom:
From Sonatina:
Acceptance Criteria
Estimated Complexity
Small-Medium - Well-understood algorithm but requires careful offset tracking
Dependencies