removed bounded from VM, bytecode and specs

This commit is contained in:
2026-03-24 13:40:44 +00:00
parent a04f462939
commit cfdca93160
18 changed files with 894 additions and 507 deletions
@@ -27,8 +27,6 @@ pub enum Value {
Boolean(bool),
/// UTF-8 string. Strings are immutable and usually come from the Constant Pool.
String(String),
/// Bounded 16-bit-ish integer.
Bounded(u32),
/// A handle to an object on the heap (opaque reference).
HeapRef(HeapRef),
/// Represents the absence of a value (equivalent to `null` or `undefined`).
@@ -49,7 +47,6 @@ impl PartialEq for Value {
(Value::Float(a), Value::Int64(b)) => *a == *b as f64,
(Value::Boolean(a), Value::Boolean(b)) => a == b,
(Value::String(a), Value::String(b)) => a == b,
(Value::Bounded(a), Value::Bounded(b)) => a == b,
(Value::HeapRef(a), Value::HeapRef(b)) => a == b,
(Value::Null, Value::Null) => true,
_ => false,
@@ -65,7 +62,6 @@ impl PartialOrd for Value {
(Value::Int32(a), Value::Int64(b)) => (*a as i64).partial_cmp(b),
(Value::Int64(a), Value::Int32(b)) => a.partial_cmp(&(*b as i64)),
(Value::Float(a), Value::Float(b)) => a.partial_cmp(b),
(Value::Bounded(a), Value::Bounded(b)) => a.partial_cmp(b),
(Value::Int32(a), Value::Float(b)) => (*a as f64).partial_cmp(b),
(Value::Float(a), Value::Int32(b)) => a.partial_cmp(&(*b as f64)),
(Value::Int64(a), Value::Float(b)) => (*a as f64).partial_cmp(b),
@@ -83,7 +79,6 @@ impl Value {
Value::Int32(i) => Some(*i as f64),
Value::Int64(i) => Some(*i as f64),
Value::Float(f) => Some(*f),
Value::Bounded(b) => Some(*b as f64),
_ => None,
}
}
@@ -93,7 +88,6 @@ impl Value {
Value::Int32(i) => Some(*i as i64),
Value::Int64(i) => Some(*i),
Value::Float(f) => Some(*f as i64),
Value::Bounded(b) => Some(*b as i64),
_ => None,
}
}
@@ -104,7 +98,6 @@ impl Value {
Value::Int32(i) => i.to_string(),
Value::Int64(i) => i.to_string(),
Value::Float(f) => f.to_string(),
Value::Bounded(b) => format!("{}b", b),
Value::Boolean(b) => b.to_string(),
Value::String(s) => s.clone(),
Value::HeapRef(r) => format!("[HeapRef {}]", r.0),