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
@@ -7,12 +7,12 @@ use oxide_bytecode::opcode::OpCode;
use oxide_parser::Statement;
impl Emitter {
pub(crate) fn emit_throw_statement(&self, stmt: &Statement, ctx: &mut CompileCtx) -> Result<Option<u8>, String> {
pub(crate) fn emit_throw_statement(&self, stmt: &Statement, ctx: &mut CompileCtx) -> Result<Option<u32>, String> {
let Statement::ThrowStatement(ts) = stmt else {
return Ok(None);
};
let exc_reg = self.emit_expression(&ts.argument, ctx)?;
ctx.inst(Inst::new(OpCode::THROW, Operand::Reg(exc_reg as u32), Operand::None, Operand::None));
ctx.inst(Inst::new(OpCode::THROW, Operand::Reg(exc_reg), Operand::None, Operand::None));
Ok(None)
}
}