mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
wasm_interp: simplify CallStack for easier debugging
This commit is contained in:
parent
18e9051760
commit
612c258e35
3 changed files with 103 additions and 170 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue