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
+5 -5
View File
@@ -11,7 +11,7 @@ impl<'gc> crate::Vm<'gc> {
ctx: &mut impl crate::VmContext,
reader: &mut BytecodeReader<'_>,
mc: &gc_arena::Mutation<'gc>,
) -> StepResult<'gc> {
) -> StepResult {
let env = reader.read_operand_data(ctx).resolve(mc, self);
let scope = Gc::new(
mc,
@@ -25,7 +25,7 @@ impl<'gc> crate::Vm<'gc> {
}
#[inline(always)]
pub(crate) fn op_pop_with(&mut self) -> StepResult<'gc> {
pub(crate) fn op_pop_with(&mut self) -> StepResult {
let Some(scope) = self.with_env else {
unreachable!("no with_scope to pop");
};
@@ -34,7 +34,7 @@ impl<'gc> crate::Vm<'gc> {
}
#[inline(always)]
pub(crate) fn op_prepare_with(&mut self) -> StepResult<'gc> {
pub(crate) fn op_prepare_with(&mut self) -> StepResult {
self.call_stack.push(CallFrame {
pc: usize::MAX,
stack_depth: 0,
@@ -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 name = reader.read_string_id();
let Some(&WithEnv { env, prev }) = self.with_env.as_deref() else {
@@ -65,7 +65,7 @@ impl<'gc> crate::Vm<'gc> {
)));
};
self.push_stack(env);
if let Some(step) = self.try_force_resolved(0, reader.inst_start_pc(), mc) {
if let Some(step) = self.try_force(0, reader, mc) {
return step;
}