Skip to main content

Module stack

Module stack 

Source
Expand description

Stack scheduling for EVM code generation.

This module handles the translation from MIR’s SSA values to EVM’s stack-based model. The key abstraction is StackModel, which tracks which MIR values are at which stack depths.

§Submodules

  • model: Core stack model tracking value positions
  • scheduler: Stack scheduler for generating DUP/SWAP sequences
  • shuffler: Optimal stack layout transitions (backward analysis)
  • spill: Spill management for values beyond depth 16

Re-exports§

pub use shuffler::BlockStackLayout;
pub use shuffler::LayoutAnalysis;
pub use shuffler::ShuffleResult;
pub use shuffler::StackShuffler;
pub use shuffler::TargetSlot;
pub use shuffler::combine_stack_layouts;
pub use shuffler::estimate_shuffle_cost;
pub use shuffler::ideal_binary_op_entry;
pub use shuffler::ideal_operand_layout;
pub use shuffler::ideal_unary_op_entry;
pub use shuffler::is_freely_generable;

Modules§

shuffler
Stack shuffler for optimal stack layout transitions.

Structs§

SpillManager
Manages spill slots for values that cannot fit on the stack.
SpillSlot
A slot in memory where a spilled value is stored.
StackModel
Represents the current state of the EVM stack.
StackScheduler
Stack scheduler that generates stack manipulation operations.

Enums§

ScheduledOp
A scheduled operation to emit.
StackOp
Operations to emit for stack manipulation.