mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-24 02:31:13 +08:00
feat: 新增 DEFINE_ACCESSOR_DYNAMIC opcode 支持计算键对象访问器
This commit is contained in:
@@ -79,6 +79,13 @@ pub(super) fn collect_real_vregs(f: &IRFunction) -> BTreeSet<u32> {
|
||||
}
|
||||
}
|
||||
}
|
||||
// 计算键访问器:ext[0] 是 key 寄存器(高位标记 `0x8000_0000 | vreg`)。
|
||||
if inst.op == OpCode::DEFINE_ACCESSOR_DYNAMIC {
|
||||
let r = inst.ext.first().copied().unwrap_or(0) & 0x7FFF_FFFF;
|
||||
if r != 0 {
|
||||
real.insert(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
real
|
||||
}
|
||||
|
||||
@@ -236,6 +236,16 @@ fn rewrite_inst(
|
||||
}
|
||||
ext
|
||||
}
|
||||
// DEFINE_ACCESSOR_DYNAMIC:ext[0] 是 key 寄存器(高位标记 `0x8000_0000 | vreg`),
|
||||
// 低 31 位重映射后保留高位标记。
|
||||
OpCode::DEFINE_ACCESSOR_DYNAMIC => {
|
||||
let mut ext = inst.ext.clone();
|
||||
if let Some(word) = ext.first_mut() {
|
||||
let nr = remap_ext_reg(*word & 0x7FFF_FFFF, slot_color, map);
|
||||
*word = 0x8000_0000 | nr;
|
||||
}
|
||||
ext
|
||||
}
|
||||
_ => inst.ext.clone(),
|
||||
};
|
||||
// 调用点首参槽改指 arg_window_base(桥接后)
|
||||
|
||||
Reference in New Issue
Block a user