Skip to main content

Crate javm

Crate javm 

Source
Expand description

Join-Accumulate VM (JAVM) — PVM implementation for JAM (Appendix A).

The PVM is a register-based virtual machine with:

  • 13 general-purpose 64-bit registers (φ₀..φ₁₂)
  • 32-bit pageable memory address space
  • Gas metering for bounded execution
  • Host-call interface for system interactions

Re-exports§

pub use vm::ExitReason;
pub use vm::Pvm;
pub use recompiler::RecompiledPvm;

Modules§

args
Instruction argument decoding (Appendix A.5 of the Gray Paper v0.7.2).
gas_cost
Per-basic-block gas cost model (JAR v0.8.0).
gas_sim
Single-pass pipeline gas model (JAR v0.8.0).
instruction
PVM instruction set (JAR v0.8.0 / Appendix A.5).
program
PVM program loading and initialization (JAR v0.8.0).
recompiler
PVM recompiler — compiles PVM bytecode to native x86-64 machine code.
vm
PVM execution engine (Appendix A of the Gray Paper v0.7.2).

Constants§

PVM_INIT_INPUT_SIZE
ZI = 2^24: Standard PVM program initialization input data size.
PVM_PAGE_SIZE
ZP = 2^12 = 4096: PVM memory page size.
PVM_REGISTER_COUNT
Number of registers in the PVM.
PVM_ZONE_SIZE
ZZ = 2^16 = 65536: Standard PVM program initialization zone size.

Type Aliases§

Gas
Gas type: NG = N_{2^64} (eq 4.23).