perf: 寄存器保存改用共享 save_stack,消除 Box<[JsValue]> 堆分配

This commit is contained in:
爱特每羊队
2026-06-24 22:20:34 +08:00
parent fe2d4929f5
commit 33c0596c81
6 changed files with 37 additions and 19 deletions
+3
View File
@@ -42,6 +42,7 @@ impl Vm {
sub_module_constants: Vec::new(),
saved_bytecode_stack: Vec::new(),
saved_constants_stack: Vec::new(),
save_stack: Vec::new(),
try_stack: Vec::new(),
exception_value: None,
pending_exception: None,
@@ -88,6 +89,7 @@ impl Vm {
sub_module_constants: Vec::new(),
saved_bytecode_stack: Vec::new(),
saved_constants_stack: Vec::new(),
save_stack: Vec::new(),
try_stack: Vec::new(),
exception_value: None,
pending_exception: None,
@@ -174,6 +176,7 @@ impl Vm {
self.last_for_of_result = JsValue::undefined();
self.saved_bytecode_stack.clear();
self.saved_constants_stack.clear();
self.save_stack.clear();
self.try_stack.clear();
self.exception_value = None;
self.pending_exception = None;