refactor: 扁平化对象属性存储并优化常量池与 IC 热路径

This commit is contained in:
2026-06-13 23:59:47 +08:00
parent 7b13bbbd7d
commit 551695bfad
26 changed files with 307 additions and 87 deletions
+2 -2
View File
@@ -118,12 +118,12 @@ pub fn error_to_string(vm: &mut Vm, args: &[u8]) -> NativeResult {
let name_val = obj
.hash_props_vec()
.and_then(|v| v.first())
.map(|b| **b)
.copied()
.unwrap_or(JsValue::undefined());
let msg_val = obj
.hash_props_vec()
.and_then(|v| v.get(1))
.map(|b| **b)
.copied()
.unwrap_or(JsValue::undefined());
(
vm.lookup_str(name_val).unwrap_or_else(|| "Error".to_string()),