Skip to main content

javm_exec/
lib.rs

1#![cfg_attr(not(feature = "std"), no_std)]
2
3//! JAR v3 execution engine.
4//!
5//! Pure PVM execution: interpreter, recompiler (JIT), memory pages,
6//! gas metering, registers, ExitReason, and an `EcallHandler` trait
7//! that abstracts the ecall ABI from the engine.
8//!
9//! No knowledge of capabilities or caps. The execution engine knows
10//! it has registers, memory pages, gas budget, and an opaque ecall
11//! number; the caller (the `javm` integration crate) supplies the
12//! `EcallHandler` that interprets ecall numbers as MGMT operations,
13//! host-call selectors, etc.
14//!
15//! Cherry-picked from v2 `javm/src/{interpreter,recompiler,memory,
16//! gas}` with cap-aware code stripped. See
17//! `~/docs/minimum-v3/implementation/architecture.md` for the
18//! layering.
19
20#[macro_use]
21extern crate alloc;
22
23pub mod args;
24pub mod decode;
25pub mod ecall;
26pub mod error;
27pub mod exit;
28pub mod gas;
29pub mod gas_cost;
30pub mod gas_sim;
31pub mod instruction;
32pub mod interp;
33pub mod mem;
34pub mod predecoded;
35pub mod program;
36pub mod regs;
37
38pub use decode::{DecodedInst, Predecoded, predecode};
39pub use ecall::{EcallHandler, EcallKind, EcallResult, PanickingHandler};
40pub use error::ProgramError;
41pub use exit::ExitReason;
42pub use gas::{Gas, GasCounter, OutOfGas};
43pub use instruction::{InstructionCategory, Opcode, decode_opcode_fast};
44pub use interp::Interpreter;
45pub use mem::{Access, CopyingMemory, MapError, Mem, MemAccess, Memory, PAGE_SIZE, perm};
46pub use program::{PvmProgram, compute_mem_cycles, unpack_bitmask};
47pub use regs::{REG_COUNT, Regs};