struct PropSlotEntry {
index: u32,
hops: u8,
holder: *const RefCell<Obj>,
}Expand description
プロパティ参照の場所の覚え(A1 の段階 2: インラインキャッシュ)。
obj.name において、直前に見つかったオブジェクト(自身 hops == 0 またはプロトタイプ連鎖先 hops >= 1)の
props 内の添字(挿入順の位置)を記憶する。
同じ形状のオブジェクトや同じクラスのインスタンスを繰り返し走査するループでは、ハッシュ計算や線形探索・
プロトタイプ連鎖走査をスキップして O(1) で即座に値やメソッドを取り出す。
インラインキャッシュ(IC)の1スロットエントリ。
Fields§
§index: u32§hops: u8§holder: *const RefCell<Obj>Implementations§
Trait Implementations§
Source§impl Clone for PropSlotEntry
impl Clone for PropSlotEntry
impl Copy for PropSlotEntry
Auto Trait Implementations§
impl !RefUnwindSafe for PropSlotEntry
impl !Send for PropSlotEntry
impl !Sync for PropSlotEntry
impl !UnwindSafe for PropSlotEntry
impl Freeze for PropSlotEntry
impl Unpin for PropSlotEntry
impl UnsafeUnpin for PropSlotEntry
Blanket Implementations§
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
Mutably borrows from an owned value. Read more