Reorganize the global value kinds. (#490)
* Reorganize the global value kinds. This: - renames "deref" global values to "load" and gives it a offset that works like the "load" instructions' does - adds an explicit "iadd_imm" global value kind, which replaces the builtin iadd in "vmctx" and "deref" global values. - also renames "globalsym" to "symbol"
This commit is contained in:
@@ -214,6 +214,16 @@ impl Offset32 {
|
||||
pub fn new(x: i32) -> Self {
|
||||
Offset32(x)
|
||||
}
|
||||
|
||||
/// Create a new `Offset32` representing the signed numver `x` if possible.
|
||||
pub fn try_from_i64(x: i64) -> Option<Self> {
|
||||
let casted = x as i32;
|
||||
if casted as i64 == x {
|
||||
Some(Self::new(casted))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<i32> for Offset32 {
|
||||
|
||||
Reference in New Issue
Block a user