optimize: remove {StepResult,TailResult}::ForceThunk

This commit is contained in:
2026-04-20 15:10:55 +08:00
parent 98b07f00e4
commit 520bb7d75e
12 changed files with 132 additions and 188 deletions
+7 -7
View File
@@ -4,7 +4,7 @@ use crate::{BytecodeReader, StepResult, Value};
impl<'gc> crate::Vm<'gc> {
#[inline(always)]
pub(crate) fn op_push_smi(&mut self, reader: &mut BytecodeReader<'_>) -> StepResult<'gc> {
pub(crate) fn op_push_smi(&mut self, reader: &mut BytecodeReader<'_>) -> StepResult {
let val = reader.read_i32();
self.push_stack(Value::new_inline(val));
StepResult::Continue
@@ -15,40 +15,40 @@ impl<'gc> crate::Vm<'gc> {
&mut self,
reader: &mut BytecodeReader<'_>,
mc: &Mutation<'gc>,
) -> StepResult<'gc> {
) -> StepResult {
let val = reader.read_i64();
self.push_stack(Value::new_gc(Gc::new(mc, val)));
StepResult::Continue
}
#[inline(always)]
pub(crate) fn op_push_float(&mut self, reader: &mut BytecodeReader<'_>) -> StepResult<'gc> {
pub(crate) fn op_push_float(&mut self, reader: &mut BytecodeReader<'_>) -> StepResult {
let val = reader.read_f64();
self.push_stack(Value::new_float(val));
StepResult::Continue
}
#[inline(always)]
pub(crate) fn op_push_string(&mut self, reader: &mut BytecodeReader<'_>) -> StepResult<'gc> {
pub(crate) fn op_push_string(&mut self, reader: &mut BytecodeReader<'_>) -> StepResult {
let sid = reader.read_string_id();
self.push_stack(Value::new_inline(sid));
StepResult::Continue
}
#[inline(always)]
pub(crate) fn op_push_null(&mut self) -> StepResult<'gc> {
pub(crate) fn op_push_null(&mut self) -> StepResult {
self.push_stack(Value::new_inline(crate::Null));
StepResult::Continue
}
#[inline(always)]
pub(crate) fn op_push_true(&mut self) -> StepResult<'gc> {
pub(crate) fn op_push_true(&mut self) -> StepResult {
self.push_stack(Value::new_inline(true));
StepResult::Continue
}
#[inline(always)]
pub(crate) fn op_push_false(&mut self) -> StepResult<'gc> {
pub(crate) fn op_push_false(&mut self) -> StepResult {
self.push_stack(Value::new_inline(false));
StepResult::Continue
}