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
+4 -4
View File
@@ -2,14 +2,14 @@ use crate::{BytecodeReader, Mutation, StepResult, Value};
impl<'gc> crate::Vm<'gc> {
#[inline(always)]
pub(crate) fn op_load_local(&mut self, reader: &mut BytecodeReader<'_>) -> StepResult<'gc> {
pub(crate) fn op_load_local(&mut self, reader: &mut BytecodeReader<'_>) -> StepResult {
let idx = reader.read_u32() as usize;
self.push_stack(self.env.borrow().locals[idx]);
StepResult::Continue
}
#[inline(always)]
pub(crate) fn op_load_outer(&mut self, reader: &mut BytecodeReader<'_>) -> StepResult<'gc> {
pub(crate) fn op_load_outer(&mut self, reader: &mut BytecodeReader<'_>) -> StepResult {
let layer = reader.read_u8();
let idx = reader.read_u32() as usize;
let mut cur = self.env;
@@ -27,7 +27,7 @@ impl<'gc> crate::Vm<'gc> {
&mut self,
reader: &mut BytecodeReader<'_>,
mc: &Mutation<'gc>,
) -> StepResult<'gc> {
) -> StepResult {
let idx = reader.read_u32() as usize;
let val = self.pop_stack();
self.env.borrow_mut(mc).locals[idx] = val;
@@ -39,7 +39,7 @@ impl<'gc> crate::Vm<'gc> {
&mut self,
reader: &mut BytecodeReader<'_>,
mc: &Mutation<'gc>,
) -> StepResult<'gc> {
) -> StepResult {
let count = reader.read_u32() as usize;
self.env
.borrow_mut(mc)