mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-24 18:51:13 +08:00
refactor: 收集路径原地化退役移动式sweep与门控
This commit is contained in:
@@ -697,20 +697,11 @@ fn async_state_mut(obj: &JsObject) -> Option<&mut AsyncState> {
|
||||
None
|
||||
} else {
|
||||
// SAFETY: native_data 在 create_async_context 中由 Box::into_raw 分配,
|
||||
// 生命周期与异步上下文对象一致;GC 路径(mark 边收集、执行期门控扫描)只读状态盒。
|
||||
// 生命周期与异步上下文对象一致;GC 路径(mark 边收集)只读状态盒。
|
||||
Some(unsafe { &mut *ptr })
|
||||
}
|
||||
}
|
||||
|
||||
/// 异步挂起帧是否持有 for-in 迭代器:执行期收集门控按指针扫描
|
||||
/// (迭代器体是堆上 Box,门控是保守门)。
|
||||
pub(crate) fn async_holds_suspended_for_in(obj: &JsObject) -> bool {
|
||||
let Some(state) = async_state_mut(obj) else {
|
||||
return false;
|
||||
};
|
||||
!state.suspended.for_in_iters.is_empty()
|
||||
}
|
||||
|
||||
/// 异步状态内全部引用边的扁平列表(GC mark 边):对象/字符串/BigInt 均产出,
|
||||
/// 消费侧按值类型分发到对象栈与存活集。
|
||||
pub(crate) fn async_native_edges(obj: &JsObject) -> Vec<JsValue> {
|
||||
|
||||
Reference in New Issue
Block a user