Step -> ControlFlow (use ?)

This commit is contained in:
2026-04-21 09:31:41 +08:00
parent 11b0b8a78e
commit b31c2a4906
11 changed files with 86 additions and 128 deletions
+6 -8
View File
@@ -22,7 +22,7 @@ impl<'gc> crate::Vm<'gc> {
},
);
self.with_env = Some(scope);
Step::Continue
Step::Continue(())
}
#[inline(always)]
@@ -31,7 +31,7 @@ impl<'gc> crate::Vm<'gc> {
unreachable!("no with_scope to pop");
};
self.with_env = scope.prev;
Step::Continue
Step::Continue(())
}
#[inline(always)]
@@ -43,7 +43,7 @@ impl<'gc> crate::Vm<'gc> {
env: self.env,
with_env: self.with_env,
});
Step::Continue
Step::Continue(())
}
#[inline(always)]
@@ -66,9 +66,7 @@ impl<'gc> crate::Vm<'gc> {
)));
};
self.push(env);
if let Some(step) = self.try_force(0, reader, mc) {
return step;
}
self.try_force(0, reader, mc)?;
let env = match self.pop_forced_expect_gc::<AttrSet>() {
Ok(val) => val,
@@ -77,7 +75,7 @@ impl<'gc> crate::Vm<'gc> {
let Some(val) = env.lookup(name) else {
reader.set_pc(reader.inst_start_pc());
self.with_env = prev;
return Step::Continue;
return Step::Continue(());
};
self.push(val);
@@ -85,6 +83,6 @@ impl<'gc> crate::Vm<'gc> {
unreachable!()
};
self.with_env = with_env;
Step::Continue
Step::Continue(())
}
}