MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / record

Method record

compiler/src/modules/vm/cache.rs:111–125  ·  view source on GitHub ↗
(&mut self, ip: usize, opcode: &OpCode, ta: u8, tb: u8)

Source from the content-addressed store, hash-verified

109 }
110
111 pub fn record(&mut self, ip: usize, opcode: &OpCode, ta: u8, tb: u8) {
112 let Some(s) = self.slots.get_mut(ip) else { return };
113 let key = (ta << 4) | (tb & 0xF);
114 if s.type_key == key {
115 s.hits = s.hits.saturating_add(1);
116 if s.hits >= QUICK_THRESH && s.fast.is_none() {
117 s.fast = Self::specialize(opcode, ta, tb);
118 }
119 } else {
120 // Preserve `inst`, its lifecycle is independent of scalar specialisation.
121 s.type_key = key;
122 s.hits = 1;
123 s.fast = None;
124 }
125 }
126
127 #[inline]
128 pub fn get_fast(&self, ip: usize) -> Option<FastOp> {

Callers 1

exec_callMethod · 0.80

Calls 8

args_memoizableFunction · 0.85
result_memoizableFunction · 0.85
hash_argsFunction · 0.85
args_matchFunction · 0.85
get_mutMethod · 0.80
is_noneMethod · 0.80
pushMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected