wasm_interp: simplify CallStack for easier debugging

This commit is contained in:
Brian Carroll 2022-12-09 23:39:38 +00:00
parent 18e9051760
commit 612c258e35
No known key found for this signature in database
GPG key ID: 5C7B2EC4101703C0
3 changed files with 103 additions and 170 deletions

View file

@ -89,11 +89,6 @@ impl Error {
}
}
}
fn value_stack_type(expected: ValueType, is_float: bool, is_64: bool) -> Self {
let ty = type_from_flags_f_64(is_float, is_64);
Error::ValueStackType(expected, ty)
}
}
impl From<(ValueType, ValueType)> for Error {
@ -102,15 +97,6 @@ impl From<(ValueType, ValueType)> for Error {
}
}
pub(crate) fn type_from_flags_f_64(is_float: bool, is_64: bool) -> ValueType {
match (is_float, is_64) {
(false, false) => ValueType::I32,
(false, true) => ValueType::I64,
(true, false) => ValueType::F32,
(true, true) => ValueType::F64,
}
}
// Determine which function the program counter is in
pub(crate) fn pc_to_fn_index(program_counter: usize, module: &WasmModule<'_>) -> usize {
if module.code.function_offsets.is_empty() {