feat: 实现最小 BigInt 子集(字面量/算术/比较/构造器,Temporal 前置)
This commit is contained in:
@@ -8,14 +8,13 @@
|
||||
//!
|
||||
//! 本文件只定义字段;方法随 `Vm` 存放。
|
||||
|
||||
use std::cell::Cell;
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::collections::HashMap;
|
||||
|
||||
use rustc_hash::FxBuildHasher;
|
||||
|
||||
use oxide_types::object::{JsObject, JsString};
|
||||
use oxide_types::value::JsValue;
|
||||
|
||||
use crate::session_gc::SessionGc;
|
||||
use crate::vm::ForInIter;
|
||||
|
||||
@@ -30,6 +29,10 @@ pub(crate) struct GcState {
|
||||
pub(crate) epoch_object_ptrs: Vec<*mut JsObject>,
|
||||
pub(crate) session_object_ptrs: Vec<*mut JsObject>,
|
||||
pub(crate) session_string_ptrs: Vec<*mut JsString>,
|
||||
/// BigInt 堆 box(`Box<i128>`)追踪表。`RefCell` 使 `&self` 的
|
||||
/// `convert_immutables` 也能登记新 box。与字符串不同,BigInt 不参与
|
||||
/// mark/sweep 回收(值量少),只在 full_reset 统一释放。
|
||||
pub(crate) session_bigint_ptrs: RefCell<Vec<*mut i128>>,
|
||||
pub(crate) session_bytes_allocated: usize,
|
||||
pub(crate) forwarding: HashMap<*mut JsObject, *mut JsObject, FxBuildHasher>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user