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

Method declare_value_needs_stack_map

cranelift/frontend/src/frontend.rs:556–565  ·  view source on GitHub ↗

Declare that the given value is a GC reference that requires inclusion in a stack map when it is live across GC safepoints. All values that are uses of this variable will be spilled to the stack before each safepoint and reloaded afterwards. Stack maps allow the garbage collector to identify the on-stack GC roots. Between spilling the stack and it being reloading again, the stack can be updated t

(&mut self, val: Value)

Source from the content-addressed store, hash-verified

554 ///
555 /// Panics if `val` is larger than 16 bytes.
556 pub fn declare_value_needs_stack_map(&mut self, val: Value) {
557 log::trace!("declare_value_needs_stack_map({val:?})");
558
559 // We rely on these properties in `insert_safepoint_spills`.
560 let size = self.func.dfg.value_type(val).bytes();
561 assert!(size <= 16);
562 assert!(size.is_power_of_two());
563
564 self.func_ctx.ssa.stack_map_values_mut().insert(val);
565 }
566
567 /// Creates a jump table in the function, to be used by [`br_table`](InstBuilder::br_table) instructions.
568 pub fn create_jump_table(&mut self, data: JumpTableData) -> JumpTable {

Calls 4

stack_map_values_mutMethod · 0.80
bytesMethod · 0.45
value_typeMethod · 0.45
insertMethod · 0.45