mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-23 18:21:13 +08:00
refactor: 删除占位 opcode 表项与派发兜底臂
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user