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

Method lookup_or_compute

crates/wasmtime/src/runtime/debug.rs:635–656  ·  view source on GitHub ↗

Look up (or compute) the list of `FrameData`s from a physical `Frame`.

(
        &'a mut self,
        registry: &ModuleRegistry,
        frame: Frame,
    )

Source from the content-addressed store, hash-verified

633 /// Look up (or compute) the list of `FrameData`s from a physical
634 /// `Frame`.
635 fn lookup_or_compute<'a>(
636 &'a mut self,
637 registry: &ModuleRegistry,
638 frame: Frame,
639 ) -> &'a [FrameData] {
640 let pc = StoreCodePC::from_raw(frame.pc());
641 match self.by_pc.entry(pc) {
642 Entry::Occupied(frames) => frames.into_mut(),
643 Entry::Vacant(v) => {
644 // Although inlining can mix modules, `module` is the
645 // module that actually contains the physical PC
646 // (i.e., the outermost function that inlined the
647 // others).
648 let (store_code, frames) = VirtualFrame::decode(registry, frame.pc());
649 let frames = frames
650 .into_iter()
651 .map(|frame| FrameData::compute(frame, store_code))
652 .collect::<Vec<_>>();
653 v.insert(frames)
654 }
655 }
656 }
657}
658
659/// Internal data pre-computed for one stack frame.

Callers 3

exit_frameMethod · 0.80
parentMethod · 0.80
frame_dataMethod · 0.80

Calls 7

decodeFunction · 0.85
pcMethod · 0.80
into_mutMethod · 0.80
entryMethod · 0.45
mapMethod · 0.45
into_iterMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected