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)
| 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) { |