(&self, vm: &mut Vm)
| 390 | } |
| 391 | |
| 392 | pub fn get_blocks(&self, vm: &mut Vm) -> Vec<u64> { |
| 393 | self.update_mapping_cache(vm); |
| 394 | let mapping = self.mapping_cache.borrow(); |
| 395 | let bitmap: &[u64] = bytemuck::cast_slice(vm.cpu.trace[self.storage].data()); |
| 396 | |
| 397 | if self.pack_bits { |
| 398 | bit_iter(bitmap).map(|x| mapping.get(x).map_or(0, |(addr, _)| *addr)).collect() |
| 399 | } |
| 400 | else { |
| 401 | bitmap |
| 402 | .iter() |
| 403 | .enumerate() |
| 404 | .filter(|(_, entry)| **entry != 0) |
| 405 | .map(|(i, _)| mapping.get(i).map_or(0, |(addr, _)| *addr)) |
| 406 | .collect() |
| 407 | } |
| 408 | } |
| 409 | |
| 410 | /// Returns the blocks corresponding to the bits indexed by `target` that are not set. |
| 411 | pub fn get_unreached_blocks(&self, vm: &mut Vm, target: &[u32]) -> Vec<u64> { |
no test coverage detected