(frame: VirtualFrame, store_code: &StoreCode)
| 719 | |
| 720 | impl FrameData { |
| 721 | fn compute(frame: VirtualFrame, store_code: &StoreCode) -> Self { |
| 722 | let frame_table = store_code.code_memory().frame_table().unwrap(); |
| 723 | // Parse the frame descriptor. |
| 724 | let (data, slot_to_fp_offset) = frame_table |
| 725 | .frame_descriptor(frame.frame_descriptor) |
| 726 | .unwrap(); |
| 727 | let frame_state_slot = FrameStateSlot::parse(data).unwrap(); |
| 728 | let slot_to_fp_offset = usize::try_from(slot_to_fp_offset).unwrap(); |
| 729 | |
| 730 | // Materialize the stack shape so we have O(1) access to its |
| 731 | // elements, and so we don't need to keep the borrow to the |
| 732 | // module alive. |
| 733 | let mut stack = frame_state_slot |
| 734 | .stack(frame.stack_shape) |
| 735 | .collect::<Vec<_>>(); |
| 736 | stack.reverse(); // Put top-of-stack last. |
| 737 | |
| 738 | // Materialize the local offsets/types so we don't need to |
| 739 | // keep the borrow to the module alive. |
| 740 | let locals = frame_state_slot.locals().collect::<Vec<_>>(); |
| 741 | |
| 742 | FrameData { |
| 743 | slot_to_fp_offset, |
| 744 | func_key: frame_state_slot.func_key(), |
| 745 | wasm_pc: frame.wasm_pc, |
| 746 | stack, |
| 747 | locals, |
| 748 | } |
| 749 | } |
| 750 | |
| 751 | fn slot_addr(&self, fp: usize) -> *mut u8 { |
| 752 | let fp: *mut u8 = core::ptr::with_exposed_provenance_mut(fp); |
nothing calls this directly
no test coverage detected