Look up (or compute) the list of `FrameData`s from a physical `Frame`.
(
&'a mut self,
registry: &ModuleRegistry,
frame: Frame,
)
| 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. |