refactor(emit): 寄存器号 u8→u32 全链放宽,vreg 化去 checkpoint/reg_overflow(B005)

This commit is contained in:
爱特每羊队
2026-08-06 16:31:16 +08:00
parent c52bf6313e
commit 38d6c7a60e
54 changed files with 404 additions and 431 deletions
+6 -6
View File
@@ -168,30 +168,30 @@ impl Inst {
}
/// 条件寄存器为 false 时跳转。
pub fn jmp_if_false(cond_reg: u8, label: LabelId) -> Self {
pub fn jmp_if_false(cond_reg: u32, label: LabelId) -> Self {
Self::new(
OpCode::JMP_IF_FALSE,
Operand::Reg(cond_reg as u32),
Operand::Reg(cond_reg),
Operand::None,
Operand::Label(label),
)
}
/// 条件寄存器为 true 时跳转。
pub fn jmp_if_true(cond_reg: u8, label: LabelId) -> Self {
pub fn jmp_if_true(cond_reg: u32, label: LabelId) -> Self {
Self::new(
OpCode::JMP_IF_TRUE,
Operand::Reg(cond_reg as u32),
Operand::Reg(cond_reg),
Operand::None,
Operand::Label(label),
)
}
/// 条件寄存器为 null/undefined 时跳转(`??` / 可选链短路)。
pub fn jmp_if_nullish(cond_reg: u8, label: LabelId) -> Self {
pub fn jmp_if_nullish(cond_reg: u32, label: LabelId) -> Self {
Self::new(
OpCode::JMP_IF_NULLISH,
Operand::Reg(cond_reg as u32),
Operand::Reg(cond_reg),
Operand::None,
Operand::Label(label),
)