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

Method inst_roots

compiler/src/modules/vm/cache.rs:171–178  ·  view source on GitHub ↗

GC root iterator for `InstanceCache` entries: yields the cached method Val and class Val so the collector keeps both alive while the cache holds them. */

(&self)

Source from the content-addressed store, hash-verified

169
170 /* GC root iterator for `InstanceCache` entries: yields the cached method Val and class Val so the collector keeps both alive while the cache holds them. */
171 pub fn inst_roots(&self) -> impl Iterator<Item = Val> + '_ {
172 self.slots.iter().filter_map(|s| s.inst).flat_map(|c| {
173 // SAFETY: `method_bits` was recorded from a live `Val`; class Val is reconstructed from the stored heap idx.
174 let method = unsafe { Val::from_raw(c.method_bits) };
175 let class = Val::heap(c.class);
176 [method, class].into_iter()
177 })
178 }
179
180 fn specialize(opcode: &OpCode, ta: u8, tb: u8) -> Option<FastOp> {
181 match (opcode, ta, tb) {

Callers 1

collectMethod · 0.80

Calls 1

iterMethod · 0.45

Tested by

no test coverage detected