update some docs and project clean up (only runtime
This commit is contained in:
@@ -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(());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user