remove system mode and request memoization

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
Cyrill Leutwiler
2024-10-11 15:18:47 +02:00
parent 705d1d7866
commit e131eebf50
20 changed files with 20 additions and 218 deletions
@@ -8,28 +8,12 @@ use num::Zero;
/// Describes some data that is only relevant to Yul.
#[derive(Debug, Default)]
pub struct YulData {
/// The system mode flag.
/// The call simulations only work if this mode is enabled.
is_system_mode: bool,
/// The list of constant arrays in the code section.
/// It is a temporary storage used until the finalization method is called.
const_arrays: BTreeMap<u8, Vec<num::BigUint>>,
}
impl YulData {
/// A shortcut constructor.
pub fn new(is_system_mode: bool) -> Self {
Self {
is_system_mode,
const_arrays: BTreeMap::new(),
}
}
/// Whether the system mode is enabled.
pub fn is_system_mode(&self) -> bool {
self.is_system_mode
}
/// Declares a temporary constant array representation.
pub fn const_array_declare(&mut self, index: u8, size: u16) -> anyhow::Result<()> {
if self.const_arrays.contains_key(&index) {