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

Method drop

cranelift/codegen/src/timing.rs:292–305  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

290 /// Dropping a timing token indicated the end of the pass.
291 impl Drop for DefaultTimingToken {
292 fn drop(&mut self) {
293 let now = monotonic_instant();
294 let duration = now.duration_since(self.start);
295 log::debug!("timing: Ending {}: {}ms", self.pass, duration.as_millis());
296 let old_cur = CURRENT_PASS.with(|p| p.replace(self.prev));
297 assert_eq!(self.pass, old_cur, "Timing tokens dropped out of order");
298 PASS_TIME.with(|rc| {
299 let mut table = rc.borrow_mut();
300 table.pass[self.pass.idx()].total += duration;
301 if let Some(parent) = table.pass.get_mut(self.prev.idx()) {
302 parent.child += duration;
303 }
304 })
305 }
306 }
307}
308

Callers

nothing calls this directly

Calls 6

monotonic_instantFunction · 0.85
duration_sinceMethod · 0.80
idxMethod · 0.80
withMethod · 0.45
replaceMethod · 0.45
get_mutMethod · 0.45

Tested by

no test coverage detected