pub enum Slot {
Agg(u32),
AggSet(Vec<u32>),
Other,
}Expand description
Abstract value at a stack or local slot during the analysis.
Per-path refinement (#463 follow-up — precision pass): a slot can
hold a set of allocation sites, not just one, because two
branches of an if/match can each push a distinct MakeRecord
/ MakeTuple value onto the stack and the join point’s “either-
or” semantics must be modeled without losing tracking. The
3-variant shape keeps the singleton case zero-alloc — Slot::Agg
is plain 8 bytes inline — and only branch-merges allocate.
Variants§
Agg(u32)
Holds a single tracked aggregate (a record from
Op::MakeRecord or a tuple from Op::MakeTuple) allocated at
this pc. As long as every consumer reads this slot via a field
/ element read (GetField / GetElem), Pop, or a
StoreLocal/LoadLocal round-trip, the site stays a
stack-alloc candidate. The escape rules are identical for both
aggregate kinds — only the codegen opcode differs — so the
analysis tracks them with one variant keyed on the alloc pc.
AggSet(Vec<u32>)
Holds one of N tracked aggregates, depending on which branch
reached this program point. Produced at join points where
distinct Agg(p) and Agg(q) flow together; the set remains
tracked across the merge so the eventual consumer (e.g.
Return under Policy::RequestScope) decides whether any
site leaks. Invariant: vec is sorted, dedup’d, length ≥ 2 —
Slot::from_sites normalizes single-element / empty inputs.
Other
Anything else — primitives, already-escaped aggregates, values produced by ops we don’t model precisely. Treated as not-a-tracked-aggregate for escape purposes.
Trait Implementations§
impl Eq for Slot
impl StructuralPartialEq for Slot
Auto Trait Implementations§
impl Freeze for Slot
impl RefUnwindSafe for Slot
impl Send for Slot
impl Sync for Slot
impl Unpin for Slot
impl UnsafeUnpin for Slot
impl UnwindSafe for Slot
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.