struct GlobalMap {
var_to_bid: HashMap<String, usize>,
bid_to_var: HashMap<usize, String>,
}
Expand description
Bidirectional map between the name of a global variable and memory box id
Fields§
§var_to_bid: HashMap<String, usize>
Map the name of a global variable to the memory box id
Since IR treats global variables as Constant::GlobalVariable
, the interpreter should be
able to generate pointer values by inferring bid
from the name
of the global variable.
bid_to_var: HashMap<usize, String>
Map the memory box id to the name of a global variable
When a function call occurs, the interpreter should be able to find name
of the function
from bid
of the callee
which is a function pointer.
Implementations§
Trait Implementations§
impl StructuralPartialEq for GlobalMap
Auto Trait Implementations§
impl Freeze for GlobalMap
impl RefUnwindSafe for GlobalMap
impl Send for GlobalMap
impl Sync for GlobalMap
impl Unpin for GlobalMap
impl UnwindSafe for GlobalMap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more