| 514 | pub ops: OpCounts, |
| 515 | } |
| 516 | |
| 517 | impl ProfileSink { |
| 518 | pub fn new(isolate: bool) -> Self { |
| 519 | ProfileSink { isolate, records: FxHashMap::default() } |
| 520 | } |
| 521 | |
| 522 | /// Accumulate one constant's record (additive in fuel + op counts, set-union |
| 523 | /// in producers) so repeated flushes for the same constant combine correctly. |
| 524 | pub fn record( |
| 525 | &mut self, |
| 526 | consumer: Address, |
| 527 | fuel: u64, |
| 528 | producers: impl IntoIterator<Item = Address>, |
| 529 | ops: OpCounts, |
| 530 | ) { |
| 531 | let rec = self.records.entry(consumer).or_default(); |