better type assertion ergonomic
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use gc_arena::{Gc, Mutation, RefLock};
|
||||
|
||||
use crate::{BytecodeReader, StepResult, ThunkState, Value};
|
||||
use crate::{BytecodeReader, Step, ThunkState, Value};
|
||||
|
||||
impl<'gc> crate::Vm<'gc> {
|
||||
#[inline(always)]
|
||||
@@ -8,7 +8,7 @@ impl<'gc> crate::Vm<'gc> {
|
||||
&mut self,
|
||||
reader: &mut BytecodeReader<'_>,
|
||||
mc: &Mutation<'gc>,
|
||||
) -> StepResult {
|
||||
) -> Step {
|
||||
let entry_point = reader.read_u32();
|
||||
let thunk = Gc::new(
|
||||
mc,
|
||||
@@ -18,8 +18,8 @@ impl<'gc> crate::Vm<'gc> {
|
||||
with_env: self.with_env,
|
||||
}),
|
||||
);
|
||||
self.push_stack(Value::new_gc(thunk));
|
||||
StepResult::Continue
|
||||
self.push(Value::new_gc(thunk));
|
||||
Step::Continue
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
@@ -27,7 +27,7 @@ impl<'gc> crate::Vm<'gc> {
|
||||
&mut self,
|
||||
reader: &mut BytecodeReader<'_>,
|
||||
mc: &Mutation<'gc>,
|
||||
) -> StepResult {
|
||||
) -> Step {
|
||||
let entry_point = reader.read_u32();
|
||||
let n_locals = reader.read_u32();
|
||||
let closure = Gc::new(
|
||||
@@ -39,8 +39,8 @@ impl<'gc> crate::Vm<'gc> {
|
||||
pattern: None,
|
||||
},
|
||||
);
|
||||
self.push_stack(Value::new_gc(closure));
|
||||
StepResult::Continue
|
||||
self.push(Value::new_gc(closure));
|
||||
Step::Continue
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
@@ -48,7 +48,7 @@ impl<'gc> crate::Vm<'gc> {
|
||||
&mut self,
|
||||
reader: &mut BytecodeReader<'_>,
|
||||
mc: &Mutation<'gc>,
|
||||
) -> StepResult {
|
||||
) -> Step {
|
||||
let entry_point = reader.read_u32();
|
||||
let n_locals = reader.read_u32();
|
||||
let req_count = reader.read_u16() as usize;
|
||||
@@ -89,7 +89,7 @@ impl<'gc> crate::Vm<'gc> {
|
||||
pattern: Some(pattern),
|
||||
},
|
||||
);
|
||||
self.push_stack(Value::new_gc(closure));
|
||||
StepResult::Continue
|
||||
self.push(Value::new_gc(closure));
|
||||
Step::Continue
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user