pub struct RareData {
pub accessors: PropMap<Accessor>,
pub attrs: PropMap<PropertyAttributes>,
pub holes: Option<Box<Vec<bool>>>,
pub primitive: Option<Value>,
pub private_brands: Vec<u64>,
pub private_fields: Vec<(u64, Rc<str>, Value)>,
pub intl_locale: Option<Rc<str>>,
pub error_stack: Option<String>,
}Expand description
オブジェクトの稀な拡張データ(アクセサ記述子、属性フラグ表、配列の穴)。
通常の素のオブジェクト・関数・配列の大多数(98%以上)はこれらを持たないため、
Option<Box<RareData>>(8バイト)として分離し、Obj 本体のサイズを 96B → 72B(25%縮小)に抑える。
Fields§
§accessors: PropMap<Accessor>§attrs: PropMap<PropertyAttributes>§holes: Option<Box<Vec<bool>>>§primitive: Option<Value>値の包みオブジェクト(new Number(5)・new String("a")・new Boolean(false)・Object(1))の中身(仕様の [[NumberData]] 等)。
【2026-11-18】以前は包みが空のオブジェクトで、new Number(5)+1 が NaN・new String("ab").length が undefined だった。
private_brands: Vec<u64>クラスプライベートメソッド/アクセサ用のブランド一覧(クラス評価ごとの一意 ID)。
private_fields: Vec<(u64, Rc<str>, Value)>クラスプライベートフィールドの実値((brand_id, 名前, 値))。props には入れないため列挙・hasOwnProperty・in に露出しない。
intl_locale: Option<Rc<str>>Intl.Locale の内部スロット [[Locale]](hasOwnProperty / ownKeys に露出しない)。
error_stack: Option<String>Error インスタンスの [[ErrorData]] 内部スロット兼スタック文字列(hasOwnProperty に露出しない)。
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for RareData
impl !Send for RareData
impl !Sync for RareData
impl !UnwindSafe for RareData
impl Freeze for RareData
impl Unpin for RareData
impl UnsafeUnpin for RareData
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