56 lines
1.5 KiB
Rust
56 lines
1.5 KiB
Rust
use gc_arena::{Gc, Mutation};
|
|
|
|
use crate::{BytecodeReader, Step, Value};
|
|
|
|
impl<'gc> crate::Vm<'gc> {
|
|
#[inline(always)]
|
|
pub(crate) fn op_push_smi(&mut self, reader: &mut BytecodeReader<'_>) -> Step {
|
|
let val = reader.read_i32();
|
|
self.push(Value::new_inline(val));
|
|
Step::Continue(())
|
|
}
|
|
|
|
#[inline(always)]
|
|
pub(crate) fn op_push_bigint(
|
|
&mut self,
|
|
reader: &mut BytecodeReader<'_>,
|
|
mc: &Mutation<'gc>,
|
|
) -> Step {
|
|
let val = reader.read_i64();
|
|
self.push(Value::new_gc(Gc::new(mc, val)));
|
|
Step::Continue(())
|
|
}
|
|
|
|
#[inline(always)]
|
|
pub(crate) fn op_push_float(&mut self, reader: &mut BytecodeReader<'_>) -> Step {
|
|
let val = reader.read_f64();
|
|
self.push(Value::new_float(val));
|
|
Step::Continue(())
|
|
}
|
|
|
|
#[inline(always)]
|
|
pub(crate) fn op_push_string(&mut self, reader: &mut BytecodeReader<'_>) -> Step {
|
|
let sid = reader.read_string_id();
|
|
self.push(Value::new_inline(sid));
|
|
Step::Continue(())
|
|
}
|
|
|
|
#[inline(always)]
|
|
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) -> Step {
|
|
self.push(Value::new_inline(true));
|
|
Step::Continue(())
|
|
}
|
|
|
|
#[inline(always)]
|
|
pub(crate) fn op_push_false(&mut self) -> Step {
|
|
self.push(Value::new_inline(false));
|
|
Step::Continue(())
|
|
}
|
|
}
|