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
@@ -5,13 +5,13 @@ use crate::{BytecodeReader, PrimOp, StepResult, Value};
impl<'gc> crate::Vm<'gc> {
#[inline(always)]
pub(crate) fn op_load_builtins(&mut self) -> StepResult<'gc> {
pub(crate) fn op_load_builtins(&mut self) -> StepResult {
self.push_stack(self.builtins);
StepResult::Continue
}
#[inline(always)]
pub(crate) fn op_load_builtin(&mut self, reader: &mut BytecodeReader<'_>) -> StepResult<'gc> {
pub(crate) fn op_load_builtin(&mut self, reader: &mut BytecodeReader<'_>) -> StepResult {
let Ok(id) = BuiltinId::try_from_primitive(reader.read_u8())
.map_err(|err| panic!("unknown builtin id: {}", err.number));
self.push_stack(Value::new_inline(PrimOp {
@@ -22,7 +22,7 @@ impl<'gc> crate::Vm<'gc> {
}
#[inline(always)]
pub(crate) fn op_mk_pos(&mut self, reader: &mut BytecodeReader<'_>) -> StepResult<'gc> {
pub(crate) fn op_mk_pos(&mut self, reader: &mut BytecodeReader<'_>) -> StepResult {
let _span_id = reader.read_u32();
todo!("MkPos");
}
@@ -31,7 +31,7 @@ impl<'gc> crate::Vm<'gc> {
pub(crate) fn op_load_repl_binding(
&mut self,
reader: &mut BytecodeReader<'_>,
) -> StepResult<'gc> {
) -> StepResult {
let _name = reader.read_string_id();
todo!("LoadReplBinding");
}
@@ -40,7 +40,7 @@ impl<'gc> crate::Vm<'gc> {
pub(crate) fn op_load_scoped_binding(
&mut self,
reader: &mut BytecodeReader<'_>,
) -> StepResult<'gc> {
) -> StepResult {
let _name = reader.read_string_id();
todo!("LoadScopedBinding");
}
@@ -51,7 +51,7 @@ impl<'gc> crate::Vm<'gc> {
ctx: &mut impl crate::VmContext,
reader: &mut BytecodeReader<'_>,
_mc: &gc_arena::Mutation<'gc>,
) -> StepResult<'gc> {
) -> StepResult {
let _parts_count = reader.read_u16() as usize;
let _force_string = reader.read_u8() != 0;
let mut _operands: smallvec::SmallVec<[crate::OperandData; 4]> =
@@ -63,7 +63,7 @@ impl<'gc> crate::Vm<'gc> {
}
#[inline(always)]
pub(crate) fn op_resolve_path(&mut self, _ctx: &mut impl crate::VmContext) -> StepResult<'gc> {
pub(crate) fn op_resolve_path(&mut self, _ctx: &mut impl crate::VmContext) -> StepResult {
todo!("implement ResolvePath");
}
}