pub struct StackMap<'a> { /* private fields */ }Expand description
A map for determining where live GC references live in a stack frame.
Note that this is currently primarily documented as cranelift’s
binemit::StackMap, so for detailed documentation about this please read
the docs over there.
Implementations§
Source§impl<'a> StackMap<'a>
impl<'a> StackMap<'a>
Sourcepub fn lookup(pc: u32, section: &'a [u8]) -> Option<StackMap<'a>>
pub fn lookup(pc: u32, section: &'a [u8]) -> Option<StackMap<'a>>
Looks up a stack map for pc within the section provided.
The section should be produced by StackMapSection in the
compile::stack_map module. The pc should be relative to the start
of the .text section in the final executable.
Sourcepub fn iter(
section: &'a [u8],
) -> Option<impl Iterator<Item = (u32, StackMap<'a>)> + 'a>
pub fn iter( section: &'a [u8], ) -> Option<impl Iterator<Item = (u32, StackMap<'a>)> + 'a>
Iterate over the stack maps contained in the given stack map section.
This function takes a section as its first argument which must have
been created with StackMapSection builder. This is intended to be the
raw ELF_WASMTIME_STACK_MAP section from the compilation artifact.
The yielded offsets are relative to the start of the text section for this map’s code object.
Sourcepub fn frame_size(&self) -> u32
pub fn frame_size(&self) -> u32
Returns the byte size of this stack map’s frame.
Sourcepub unsafe fn sp(&self, fp: *mut usize) -> *mut usize
pub unsafe fn sp(&self, fp: *mut usize) -> *mut usize
Given a frame pointer, get the stack pointer.
§Safety
The fp must be the frame pointer at the code offset that this stack
map is associated with.