better type assertion ergonomic
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
use gc_arena::{Gc, Mutation};
|
||||
|
||||
use crate::{BytecodeReader, StepResult, Value};
|
||||
use crate::{BytecodeReader, Step, Value};
|
||||
|
||||
impl<'gc> crate::Vm<'gc> {
|
||||
#[inline(always)]
|
||||
pub(crate) fn op_push_smi(&mut self, reader: &mut BytecodeReader<'_>) -> StepResult {
|
||||
pub(crate) fn op_push_smi(&mut self, reader: &mut BytecodeReader<'_>) -> Step {
|
||||
let val = reader.read_i32();
|
||||
self.push_stack(Value::new_inline(val));
|
||||
StepResult::Continue
|
||||
self.push(Value::new_inline(val));
|
||||
Step::Continue
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
@@ -15,41 +15,41 @@ impl<'gc> crate::Vm<'gc> {
|
||||
&mut self,
|
||||
reader: &mut BytecodeReader<'_>,
|
||||
mc: &Mutation<'gc>,
|
||||
) -> StepResult {
|
||||
) -> Step {
|
||||
let val = reader.read_i64();
|
||||
self.push_stack(Value::new_gc(Gc::new(mc, val)));
|
||||
StepResult::Continue
|
||||
self.push(Value::new_gc(Gc::new(mc, val)));
|
||||
Step::Continue
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub(crate) fn op_push_float(&mut self, reader: &mut BytecodeReader<'_>) -> StepResult {
|
||||
pub(crate) fn op_push_float(&mut self, reader: &mut BytecodeReader<'_>) -> Step {
|
||||
let val = reader.read_f64();
|
||||
self.push_stack(Value::new_float(val));
|
||||
StepResult::Continue
|
||||
self.push(Value::new_float(val));
|
||||
Step::Continue
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub(crate) fn op_push_string(&mut self, reader: &mut BytecodeReader<'_>) -> StepResult {
|
||||
pub(crate) fn op_push_string(&mut self, reader: &mut BytecodeReader<'_>) -> Step {
|
||||
let sid = reader.read_string_id();
|
||||
self.push_stack(Value::new_inline(sid));
|
||||
StepResult::Continue
|
||||
self.push(Value::new_inline(sid));
|
||||
Step::Continue
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub(crate) fn op_push_null(&mut self) -> StepResult {
|
||||
self.push_stack(Value::new_inline(crate::Null));
|
||||
StepResult::Continue
|
||||
pub(crate) fn op_push_null(&mut self) -> Step {
|
||||
self.push(Value::new_inline(crate::Null));
|
||||
Step::Continue
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub(crate) fn op_push_true(&mut self) -> StepResult {
|
||||
self.push_stack(Value::new_inline(true));
|
||||
StepResult::Continue
|
||||
pub(crate) fn op_push_true(&mut self) -> Step {
|
||||
self.push(Value::new_inline(true));
|
||||
Step::Continue
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub(crate) fn op_push_false(&mut self) -> StepResult {
|
||||
self.push_stack(Value::new_inline(false));
|
||||
StepResult::Continue
|
||||
pub(crate) fn op_push_false(&mut self) -> Step {
|
||||
self.push(Value::new_inline(false));
|
||||
Step::Continue
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user