pub struct FrameStateSlotBuilder { /* private fields */ }Expand description
Builder for a stackslot descriptor.
Implementations§
Source§impl FrameStateSlotBuilder
impl FrameStateSlotBuilder
Sourcepub fn new(func_key: FuncKey, pointer_size: u32) -> FrameStateSlotBuilder
pub fn new(func_key: FuncKey, pointer_size: u32) -> FrameStateSlotBuilder
Create a new state-slot builder.
Sourcepub fn add_local(&mut self, ty: FrameValType) -> FrameStateSlotOffset
pub fn add_local(&mut self, ty: FrameValType) -> FrameStateSlotOffset
Add a local to the state-slot.
Locals must be added in local index order, and must be added before any stack shapes are defined. The offset in the state slot is returned.
Sourcepub fn local_offset(&self, local: u32) -> FrameStateSlotOffset
pub fn local_offset(&self, local: u32) -> FrameStateSlotOffset
Get a local’s offset in the state-slot.
Sourcepub fn push_stack(
&mut self,
parent: Option<FrameStackShape>,
ty: FrameValType,
) -> (FrameStackShape, FrameStateSlotOffset)
pub fn push_stack( &mut self, parent: Option<FrameStackShape>, ty: FrameValType, ) -> (FrameStackShape, FrameStateSlotOffset)
Push a stack entry. Returns the stack-shape descriptor and the offset at which to write the pushed value.
Sourcepub fn stack_last_offset(&self, shape: FrameStackShape) -> FrameStateSlotOffset
pub fn stack_last_offset(&self, shape: FrameStackShape) -> FrameStateSlotOffset
Get the offset for the top slot in a given stack shape.