cranelift: Implement pinned reg in interpreter (#4375)

This commit is contained in:
Afonso Bordado
2022-08-10 22:33:45 +01:00
committed by GitHub
parent 11f0b003eb
commit 268ddf2f6c
4 changed files with 42 additions and 3 deletions

View File

@@ -201,6 +201,7 @@ pub struct InterpreterState<'a> {
pub heaps: Vec<HeapBacking>,
pub iflags: HashSet<IntCC>,
pub fflags: HashSet<FloatCC>,
pub pinned_reg: DataValue,
}
impl Default for InterpreterState<'_> {
@@ -213,6 +214,7 @@ impl Default for InterpreterState<'_> {
heaps: Vec::new(),
iflags: HashSet::new(),
fflags: HashSet::new(),
pinned_reg: DataValue::U64(0),
}
}
}
@@ -592,10 +594,18 @@ impl<'a> State<'a, DataValue> for InterpreterState<'a> {
}
}
_ => unimplemented!(),
}
};
Ok(())
}
fn get_pinned_reg(&self) -> DataValue {
self.pinned_reg.clone()
}
fn set_pinned_reg(&mut self, v: DataValue) {
self.pinned_reg = v;
}
}
#[cfg(test)]