Tidy up lowlevel calls and implement a few more

This commit is contained in:
Brian Carroll 2021-11-08 18:52:30 +00:00
parent 5bfc0093ec
commit 1b5740cd5d
3 changed files with 131 additions and 98 deletions

View file

@ -51,7 +51,16 @@ pub enum StoredValue {
size: u32,
alignment_bytes: u32,
},
// TODO: const data storage (fixed address)
}
impl StoredValue {
pub fn value_type(&self) -> ValueType {
match self {
Self::VirtualMachineStack { value_type, .. } => *value_type,
Self::Local { value_type, .. } => *value_type,
Self::StackMemory { .. } => ValueType::I32,
}
}
}
/// Helper structure for WasmBackend, to keep track of how values are stored,