pub(crate) struct PropSlot {
slot0: Cell<PropSlotEntry>,
slot1: Cell<PropSlotEntry>,
}Expand description
プロパティ参照の場所の覚え(A1 の段階 2: 2態インラインキャッシュ Bimorphic IC)。
obj.name において、直前に見つかったオブジェクト(自身 hops == 0 またはプロトタイプ連鎖先 hops >= 1)の
props 内の添字(挿入順の位置)を記憶する。
2つのスロット(slot0, slot1)を持ち、ループ内で2種類の異なるオブジェクト構造が交互に現れても
キャッシュスラッシングを起こさず O(1) で即座に値やメソッドを取り出す。
Fields§
§slot0: Cell<PropSlotEntry>§slot1: Cell<PropSlotEntry>Implementations§
Auto Trait Implementations§
impl !Freeze for PropSlot
impl !RefUnwindSafe for PropSlot
impl !Send for PropSlot
impl !Sync for PropSlot
impl !UnwindSafe for PropSlot
impl Unpin for PropSlot
impl UnsafeUnpin for PropSlot
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