style: 自动格式化

This commit is contained in:
2026-10-12 19:12:11 +00:00
parent 05b9b280cf
commit 91991c3802
2 changed files with 27 additions and 12 deletions
+12 -9
View File
@@ -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={:?}",
+15 -3
View File
@@ -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,
}
}
}