MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / push_user_stack_map

Method push_user_stack_map

cranelift/codegen/src/machinst/buffer.rs:1825–1845  ·  view source on GitHub ↗

Push a user stack map onto this buffer. The stack map is associated with the given `return_addr` code offset. This must be the PC for the instruction just *after* this stack map's associated instruction. For example in the sequence `call $foo; add r8, rax`, the `return_addr` must be the offset of the start of the `add` instruction. Stack maps must be pushed in sorted `return_addr` order.

(
        &mut self,
        emit_state: &I::State,
        return_addr: CodeOffset,
        mut stack_map: ir::UserStackMap,
    )

Source from the content-addressed store, hash-verified

1823 ///
1824 /// Stack maps must be pushed in sorted `return_addr` order.
1825 pub fn push_user_stack_map(
1826 &mut self,
1827 emit_state: &I::State,
1828 return_addr: CodeOffset,
1829 mut stack_map: ir::UserStackMap,
1830 ) {
1831 let span = emit_state.frame_layout().active_size();
1832 trace!("Adding user stack map @ {return_addr:#x} spanning {span} bytes: {stack_map:?}");
1833
1834 debug_assert!(
1835 self.user_stack_maps
1836 .last()
1837 .map_or(true, |(prev_addr, _, _)| *prev_addr < return_addr),
1838 "pushed stack maps out of order: {} is not less than {}",
1839 self.user_stack_maps.last().unwrap().0,
1840 return_addr,
1841 );
1842
1843 stack_map.finalize(emit_state.frame_layout().sp_to_sized_stack_slots());
1844 self.user_stack_maps.push((return_addr, span, stack_map));
1845 }
1846
1847 /// Push a debug tag associated with the current buffer offset.
1848 pub fn push_debug_tags(&mut self, pos: MachDebugTagPos, tags: &[DebugTag]) {

Callers 5

emitFunction · 0.80
emit_uncompressedMethod · 0.80
emitMethod · 0.80
pulley_emitFunction · 0.80

Calls 5

active_sizeMethod · 0.80
frame_layoutMethod · 0.45
finalizeMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected