refactor: 删除占位 opcode 表项与派发兜底臂

This commit is contained in:
2026-09-26 08:44:36 +00:00
parent 811e9e928a
commit d0a95309ba
4 changed files with 2 additions and 46 deletions
-16
View File
@@ -337,8 +337,6 @@ fn impure_ops_are_not_deletable() {
// RegAlloc 辅助:SPILL/UNSPILL 有副作用(删 SPILL 后 UNSPILL 读陈旧值)
assert!(!Inst::inst_spill(Operand::Reg(5), 42).is_pure(&f));
assert!(!Inst::inst_unspill(Operand::Reg(9), 42).is_pure(&f));
// 占位 opcode 防御性有副作用
assert!(!Inst::new(OpCode::SWITCH_TABLE, Operand::None, Operand::None, Operand::None).is_pure(&f));
}
#[test]
@@ -549,20 +547,6 @@ fn opcode_semantics_golden_table() {
&[1],
false,
);
// 占位 opcode:def=rd 保守,不可删
assert_group(
&[
OpCode::SWITCH_TABLE,
OpCode::PROFILE_SHAPE,
OpCode::PROFILE_BRANCH,
OpCode::PROFILE_CALL,
OpCode::FORK,
OpCode::JOIN,
],
Some(1),
&[],
false,
);
// 异常 / 返回 / 停机
assert_contract(OpCode::THROW, None, &[1], false);
assert_contract(OpCode::RETURN, None, &[1], false);