1mod alloc_policy;
2mod builtin;
3mod compiler;
4mod execute;
5pub mod opcode;
6mod profile;
7pub mod runtime;
8mod symbol;
9mod types;
10
11pub(crate) use alloc_policy::VmAllocPolicy;
12
13pub use compiler::{
14 compile_program, compile_program_with_loaded_modules, compile_program_with_modules,
15};
16pub use execute::VM;
17pub use opcode::opcode_name;
18pub use profile::{
19 VmBuiltinProfile, VmFunctionProfile, VmOpcodeProfile, VmProfileReport, VmReturnStats,
20};
21pub use types::{CallFrame, CodeStore, FnChunk, VmError};
22
23pub fn register_service_types(arena: &mut crate::nan_value::Arena) {
27 arena.register_record_type(
28 "HttpResponse",
29 vec!["status".into(), "body".into(), "headers".into()],
30 );
31 arena.register_record_type(
32 "HttpRequest",
33 vec![
34 "method".into(),
35 "path".into(),
36 "body".into(),
37 "headers".into(),
38 ],
39 );
40 arena.register_record_type(
41 "Tcp.Connection",
42 vec!["id".into(), "host".into(), "port".into()],
43 );
44 arena.register_record_type("Terminal.Size", vec!["width".into(), "height".into()]);
48 arena.register_record_type("BranchPath", vec!["dewey".into()]);
51 crate::types::effect_event::register(arena);
56 crate::types::trace::register(arena);
60}