(unit: &'a CompiledUnit)
| 82 | } |
| 83 | |
| 84 | pub fn from_unit(unit: &'a CompiledUnit) -> Self { |
| 85 | let options = DisassemblerOptions::new(); |
| 86 | let source_map = unit.source_map().clone(); |
| 87 | let index_view = match unit { |
| 88 | CompiledUnit::Module(NamedCompiledModule { module, .. }) => { |
| 89 | BinaryIndexedView::Module(module) |
| 90 | } |
| 91 | CompiledUnit::Script(NamedCompiledScript { script, .. }) => { |
| 92 | BinaryIndexedView::Script(script) |
| 93 | } |
| 94 | }; |
| 95 | |
| 96 | let source_mapping = SourceMapping::new(source_map, index_view); |
| 97 | Disassembler::new(source_mapping, options) |
| 98 | } |
| 99 | |
| 100 | pub fn add_coverage_map(&mut self, coverage_map: ExecCoverageMap) { |
| 101 | self.coverage_map = Some(coverage_map); |
nothing calls this directly
no test coverage detected