Step -> ControlFlow (use ?)
This commit is contained in:
@@ -8,14 +8,12 @@ impl<'gc> crate::Vm<'gc> {
|
||||
mc: &gc_arena::Mutation<'gc>,
|
||||
) -> Step {
|
||||
let offset = reader.read_i32();
|
||||
if let Some(step) = self.try_force(0, reader, mc) {
|
||||
return step;
|
||||
}
|
||||
self.try_force(0, reader, mc)?;
|
||||
let cond = self.pop();
|
||||
if cond.as_inline::<bool>() == Some(false) {
|
||||
reader.set_pc(((reader.pc() as isize) + (offset as isize)) as usize);
|
||||
}
|
||||
Step::Continue
|
||||
Step::Continue(())
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
@@ -25,21 +23,19 @@ impl<'gc> crate::Vm<'gc> {
|
||||
mc: &gc_arena::Mutation<'gc>,
|
||||
) -> Step {
|
||||
let offset = reader.read_i32();
|
||||
if let Some(step) = self.try_force(0, reader, mc) {
|
||||
return step;
|
||||
}
|
||||
self.try_force(0, reader, mc)?;
|
||||
let cond = self.pop();
|
||||
if cond.as_inline::<bool>() == Some(true) {
|
||||
reader.set_pc(((reader.pc() as isize) + (offset as isize)) as usize);
|
||||
}
|
||||
Step::Continue
|
||||
Step::Continue(())
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub(crate) fn op_jump(&mut self, reader: &mut BytecodeReader<'_>) -> Step {
|
||||
let offset = reader.read_i32();
|
||||
reader.set_pc(((reader.pc() as isize) + (offset as isize)) as usize);
|
||||
Step::Continue
|
||||
Step::Continue(())
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
|
||||
Reference in New Issue
Block a user