This commit is contained in:
2026-03-24 13:40:37 +00:00
parent 790629fee7
commit 8d80685654
5 changed files with 6 additions and 61 deletions
@@ -102,7 +102,7 @@ impl From<ProgramImage> for BytecodeModule {
Value::String(v) => ConstantPoolEntry::String(v.clone()),
Value::Int32(v) => ConstantPoolEntry::Int32(*v),
Value::Bounded(v) => ConstantPoolEntry::Int32(*v as i32),
Value::Gate(_) => ConstantPoolEntry::Null,
Value::Handle(_) => ConstantPoolEntry::Null,
})
.collect();
@@ -23,7 +23,7 @@ pub enum Value {
/// Bounded 16-bit-ish integer.
Bounded(u32),
/// A pointer to an object on the heap.
Gate(usize),
Handle(usize),
/// Represents the absence of a value (equivalent to `null` or `undefined`).
Null,
}
@@ -43,7 +43,7 @@ impl PartialEq for Value {
(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::Gate(a), Value::Gate(b)) => a == b,
(Value::Handle(a), Value::Handle(b)) => a == b,
(Value::Null, Value::Null) => true,
_ => false,
}
@@ -99,7 +99,7 @@ impl Value {
Value::Bounded(b) => format!("{}b", b),
Value::Boolean(b) => b.to_string(),
Value::String(s) => s.clone(),
Value::Gate(r) => format!("[Gate {}]", r),
Value::Handle(r) => format!("[Handle {}]", r),
Value::Null => "null".to_string(),
}
}
@@ -26,7 +26,7 @@ impl<'a> HostReturn<'a> {
self.stack.push(Value::Null);
}
pub fn push_gate(&mut self, g: usize) {
self.stack.push(Value::Gate(g));
self.stack.push(Value::Handle(g));
}
pub fn push_string(&mut self, s: String) {
self.stack.push(Value::String(s));
@@ -92,7 +92,7 @@ pub struct VirtualMachine {
pub breakpoints: std::collections::HashSet<usize>,
}
// HIP/Gate runtime structures removed per PR-2.1
// HIP/Handle runtime structures removed per PR-2.1
impl Default for VirtualMachine {
fn default() -> Self {