mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-25 19:21:11 +08:00
fix: 原生盒 mark 边收集去对象预过滤——盒内字符串/BigInt 边并入 live 标记闭合 sweep 悬垂
This commit is contained in:
@@ -110,7 +110,8 @@ fn alloc_set<H: VmHost>(vm: &mut H) -> *mut JsObject {
|
||||
vm.alloc_object(obj)
|
||||
}
|
||||
|
||||
/// 收集 Set 中作为对象引用的元素(GC 根边),供跨 epoch 遍历/重写时追踪。
|
||||
/// 收集 Set 内全部元素边(GC mark 边):对象/字符串/BigInt 均产出,
|
||||
/// 消费侧按值类型分发到对象栈与存活集。
|
||||
pub fn set_native_edges(obj: &JsObject) -> Vec<JsValue> {
|
||||
if !obj.is_set() {
|
||||
return Vec::new();
|
||||
@@ -119,13 +120,7 @@ pub fn set_native_edges(obj: &JsObject) -> Vec<JsValue> {
|
||||
if inner.is_null() {
|
||||
return Vec::new();
|
||||
}
|
||||
unsafe {
|
||||
(*inner)
|
||||
.iter()
|
||||
.map(|key| key.0)
|
||||
.filter(|value: &JsValue| value.is_object())
|
||||
.collect()
|
||||
}
|
||||
unsafe { (*inner).iter().map(|key| key.0).collect() }
|
||||
}
|
||||
|
||||
/// 克隆 Set 的 native 数据到新对象,用 `rewrite` 改写其中的对象引用。
|
||||
|
||||
Reference in New Issue
Block a user