update some docs and project clean up (only runtime

This commit is contained in:
2026-03-24 13:40:35 +00:00
parent 4f73f46ba9
commit 90ecd77031
94 changed files with 1161 additions and 11746 deletions
-2
View File
@@ -5,7 +5,5 @@ edition = "2024"
license.workspace = true
[dependencies]
serde = { version = "1.0.228", features = ["derive"] }
prometeu-bytecode = { path = "../../compiler/prometeu-bytecode" }
prometeu-core = { path = "../../compiler/prometeu-core" }
prometeu-hal = { path = "../prometeu-hal" }
@@ -114,6 +114,12 @@ pub struct GateEntry {
pub type_id: u32,
}
impl Default for VirtualMachine {
fn default() -> Self {
Self::new(vec![], vec![])
}
}
impl VirtualMachine {
/// Creates a new VM instance with the provided bytecode and constants.
pub fn new(rom: Vec<u8>, constant_pool: Vec<Value>) -> Self {
@@ -242,15 +248,6 @@ impl VirtualMachine {
});
}
}
impl Default for VirtualMachine {
fn default() -> Self {
Self::new(vec![], vec![])
}
}
impl VirtualMachine {
/// Executes the VM for a limited number of cycles (budget).
///
/// This is the heart of the deterministic execution model. Instead of running
@@ -359,10 +356,6 @@ impl VirtualMachine {
/// 2. Decode: Identify what operation to perform.
/// 3. Execute: Perform the operation, updating stacks, memory, or calling peripherals.
pub fn step(&mut self, native: &mut dyn NativeInterface, ctx: &mut HostContext) -> Result<(), LogicalFrameEndingReason> {
self.step_impl(native, ctx)
}
fn step_impl(&mut self, native: &mut dyn NativeInterface, ctx: &mut HostContext) -> Result<(), LogicalFrameEndingReason> {
if self.halted || self.pc >= self.program.rom.len() {
return Ok(());
}