Skip to content

Commit 32041d6

Browse files
committed
use unreachable_unreached in op_code_to_handler
This significantly boosts performance if `extra-checks` is disabled and `compact` is enabled. As soon as all execution handlers are implemented we can remove this fallback entirely.
1 parent 530bca3 commit 32041d6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/wasmi/src/engine/executor/handler/dispatch.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,8 @@ pub fn op_code_to_handler(code: OpCode) -> Handler {
834834
OpCode::I64Store16Mem0Offset16_Si => exec::i64_store16_mem0_offset16_si,
835835
OpCode::I64Store32Mem0Offset16_Ss => exec::i64_store32_mem0_offset16_ss,
836836
OpCode::I64Store32Mem0Offset16_Si => exec::i64_store32_mem0_offset16_si,
837-
_ => unreachable!(),
837+
unsupported => unsafe {
838+
crate::engine::utils::unreachable_unchecked!("unsupported op-code: {unsupported:?}")
839+
}
838840
}
839841
}

0 commit comments

Comments
 (0)