perf: CallFrame 构造 this 判别位并入 bool 组省 8 字节

This commit is contained in:
2026-10-13 08:18:34 +00:00
parent 07d72c00de
commit e154b12126
11 changed files with 71 additions and 36 deletions
+6 -4
View File
@@ -625,10 +625,11 @@ impl Vm {
self.raise_error_kind("ReferenceError", "super() called more than once")?;
return Ok(true);
}
let Some(derived_this) = frame.constructed_this else {
if !frame.has_constructed_this {
self.raise_error_kind("ReferenceError", "super() without derived this")?;
return Ok(true);
};
}
let derived_this = frame.constructed_this;
let callee = frame.callee;
let new_target = self.regs[255];
@@ -1197,10 +1198,11 @@ impl Vm {
self.raise_error_kind("ReferenceError", "super() called more than once")?;
return Ok(true);
}
let Some(derived_this) = frame.constructed_this else {
if !frame.has_constructed_this {
self.raise_error_kind("ReferenceError", "super() without derived this")?;
return Ok(true);
};
}
let derived_this = frame.constructed_this;
let callee = frame.callee;
let new_target = self.regs[255];