perf: 字节码调用压帧窗口按调用点存活上界拷贝减少整窗搬移

RegAlloc 改写后补第三次 liveness,为每条 CALL/NEW/SUPER_CALL 计算调用点
存活上界(最大存活物理槽号 + 1,254/255 由帧单独保存不计入),编码进
ext 高 8 位(nargs 低 8 位不变)。三处手写压帧窗口 = min(调用方活动寄存
器, 存活上界),restore_frame 按窗口回拷;CallFrame 新增
caller_active_reg_limit 保存调用方真实活动上限,恢复时不随截断窗口缩水。
生成器/异步函数体调用点保持全量窗口。spread 调用与运行时发起压帧
(accessor/内联)走全量路径不受影响。
This commit is contained in:
2026-08-15 09:56:22 +08:00
parent 5e14817eaa
commit d9acda7417
13 changed files with 448 additions and 11 deletions
+3
View File
@@ -25,6 +25,8 @@ impl Vm {
let ext = self.bytecode[self.pc];
self.pc += 1;
let arg_count = (ext & 0xFF) as usize;
// ext 高 8 位 = 调用点存活上界(0 = 未编码/全量),压帧窗口按此截断。
let call_window = (ext >> 8) as u8;
crate::vm_debug!("CALL rd={} this={} args={} depth={}", rd, this_reg, arg_count, self.frames.len());
if obj.native_fn().is_some() {
@@ -65,6 +67,7 @@ impl Vm {
None,
JsValue::undefined(),
FrameContinuation::None,
call_window,
)?;
return Ok(true);
}