Skip to content

Commit

Permalink
VM refactor phase 2
Browse files Browse the repository at this point in the history
Re-flatten "VmHost", there will be one vm host that gets shared for multiple different runtimes.

Separate world_state & session from the "exec params", and make that immutable during VM::exec runs.
  • Loading branch information
rdaum committed Jan 6, 2024
1 parent 1c543e0 commit 946e10a
Show file tree
Hide file tree
Showing 6 changed files with 351 additions and 445 deletions.
9 changes: 2 additions & 7 deletions crates/kernel/src/tasks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ pub mod command_parse;
pub mod scheduler;
pub mod sessions;

mod moo_vm_host;
mod task;
pub mod task_messages;
pub mod vm_host;
Expand Down Expand Up @@ -52,9 +51,8 @@ pub struct TaskDescription {
}

pub mod vm_test_utils {
use crate::tasks::moo_vm_host::MooVmHost;
use crate::tasks::sessions::Session;
use crate::tasks::vm_host::{VMHost, VMHostResponse};
use crate::tasks::vm_host::{VMHostResponse, VmHost};
use crate::tasks::VerbCall;
use crate::vm::VmExecParams;
use moor_values::model::world_state::WorldState;
Expand All @@ -70,13 +68,10 @@ pub mod vm_test_utils {
args: Vec<Var>,
) -> Var {
let (scs_tx, _scs_rx) = tokio::sync::mpsc::unbounded_channel();
let mut vm_host =
MooVmHost::new(20, 90_000, Duration::from_secs(5), session.clone(), scs_tx);
let mut vm_host = VmHost::new(20, 90_000, Duration::from_secs(5), session.clone(), scs_tx);

let (sched_send, _) = tokio::sync::mpsc::unbounded_channel();
let _vm_exec_params = VmExecParams {
world_state,
session: session.clone(),
scheduler_sender: sched_send.clone(),
max_stack_depth: 50,
ticks_left: 90_000,
Expand Down
358 changes: 0 additions & 358 deletions crates/kernel/src/tasks/moo_vm_host.rs

This file was deleted.

Loading

0 comments on commit 946e10a

Please sign in to comment.