mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-26 19:51:11 +08:00
feat: Atomics.waitAsync/pause 异步臂与 notify 唤醒面
This commit is contained in:
@@ -75,6 +75,12 @@ impl Vm {
|
||||
for job in &self.job_queue {
|
||||
crate::promise::for_each_job_value(job, &mut f);
|
||||
}
|
||||
// Atomics waiter 表登记的 promise 是 GC 根(run 内跨调用存活)。
|
||||
for promises in self.atomics_waiters.values() {
|
||||
for p in promises {
|
||||
f(*p);
|
||||
}
|
||||
}
|
||||
for iter in &self.iters.for_in_iters {
|
||||
if iter.is_null() {
|
||||
continue;
|
||||
@@ -150,6 +156,12 @@ impl Vm {
|
||||
for job in &mut self.job_queue {
|
||||
crate::promise::rewrite_job_values(job, &mut rewrite);
|
||||
}
|
||||
// Atomics waiter 表中的 promise 随 sweep 重写(与 mark 段一一对应)。
|
||||
for promises in self.atomics_waiters.values_mut() {
|
||||
for p in promises {
|
||||
*p = rewrite(*p);
|
||||
}
|
||||
}
|
||||
for iter in &mut self.iters.for_in_iters {
|
||||
if iter.is_null() {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user