diff --git a/crates/oxide_vm/src/vm/call.rs b/crates/oxide_vm/src/vm/call.rs index b33f74b0..b7000ebe 100644 --- a/crates/oxide_vm/src/vm/call.rs +++ b/crates/oxide_vm/src/vm/call.rs @@ -26,12 +26,20 @@ pub(crate) struct ConstructArgs { impl ConstructArgs { /// 非构造调用:无结果寄存器、无构造 this,new.target 为 undefined。 pub(crate) fn none() -> Self { - Self { result_reg: None, constructed_this: None, new_target: JsValue::undefined() } + Self { + result_reg: None, + constructed_this: None, + new_target: JsValue::undefined(), + } } /// 构造调用:携带结果寄存器、构造 this 与 new.target。 pub(crate) fn new(result_reg: u8, constructed_this: JsValue, new_target: JsValue) -> Self { - Self { result_reg: Some(result_reg), constructed_this: Some(constructed_this), new_target } + Self { + result_reg: Some(result_reg), + constructed_this: Some(constructed_this), + new_target, + } } } @@ -243,13 +251,8 @@ impl Vm { /// - 压入调用帧与各类保存栈,改写 pc / bytecode / 活动寄存器上限与镜像槽; /// `continuation` 决定返回后的续行方式。 pub(crate) fn push_bytecode_frame( - &mut self, - callee: JsValue, - this_value: JsValue, - args: FrameArgs, - construct: ConstructArgs, - continuation: FrameContinuation, - call_window: u8, + &mut self, callee: JsValue, this_value: JsValue, args: FrameArgs, construct: ConstructArgs, + continuation: FrameContinuation, call_window: u8, ) -> Result<(), String> { vm_trace!( "push_bytecode_frame: depth={}, args={}, continuation={:?}", diff --git a/crates/oxide_vm/src/vm_props.rs b/crates/oxide_vm/src/vm_props.rs index 59cde92b..407e2f85 100644 --- a/crates/oxide_vm/src/vm_props.rs +++ b/crates/oxide_vm/src/vm_props.rs @@ -22,17 +22,29 @@ pub(crate) struct SetContract { impl SetContract { /// 字节码入口(ordinary_set / member 写):不帧化、非 builtin,严格性由调用点给。 pub(crate) const fn bytecode(strict: bool) -> Self { - Self { use_frame_push: false, strict, builtin: false } + Self { + use_frame_push: false, + strict, + builtin: false, + } } /// builtin 入口(ordinary_set_builtin):不帧化、builtin,严格性由调用点给。 pub(crate) const fn builtin(strict: bool) -> Self { - Self { use_frame_push: false, strict, builtin: true } + Self { + use_frame_push: false, + strict, + builtin: true, + } } /// 分发入口(ordinary_set_dispatch / IC 写):帧化、非 builtin,严格性由调用点给。 pub(crate) const fn dispatch(strict: bool) -> Self { - Self { use_frame_push: true, strict, builtin: false } + Self { + use_frame_push: true, + strict, + builtin: false, + } } }