feat: 对小整数做额外枚举以优化性能

This commit is contained in:
爱特每羊队
2026-06-06 09:52:00 +08:00
parent 47dfb86293
commit 6502f7b5ee
5 changed files with 14 additions and 4 deletions
+1
View File
@@ -113,6 +113,7 @@ impl Vm {
.iter()
.map(|c| match c {
Constant::Number(v) => JsValue::float(*v),
Constant::Int(v) => JsValue::int(*v),
Constant::String(s) => self.intern(s),
Constant::Boolean(b) => JsValue::bool(*b),
Constant::Null => JsValue::null(),