mod alloc_policy;
mod builtin;
mod compiler;
mod execute;
pub mod opcode;
mod profile;
pub mod runtime;
mod symbol;
mod types;
pub(crate) use alloc_policy::VmAllocPolicy;
pub use compiler::{
compile_program, compile_program_with_loaded_modules, compile_program_with_modules,
};
pub use execute::VM;
pub use opcode::opcode_name;
pub use profile::{
VmBuiltinProfile, VmFunctionProfile, VmOpcodeProfile, VmProfileReport, VmReturnStats,
};
pub use types::{CallFrame, CodeStore, FnChunk, VmError};
pub fn register_service_types(arena: &mut crate::nan_value::Arena) {
arena.register_record_type(
"HttpResponse",
vec!["status".into(), "body".into(), "headers".into()],
);
arena.register_record_type(
"HttpRequest",
vec![
"method".into(),
"path".into(),
"body".into(),
"headers".into(),
],
);
arena.register_record_type(
"Tcp.Connection",
vec!["id".into(), "host".into(), "port".into()],
);
arena.register_record_type("Terminal.Size", vec!["width".into(), "height".into()]);
arena.register_record_type("BranchPath", vec!["dewey".into()]);
crate::types::effect_event::register(arena);
crate::types::trace::register(arena);
}