Skip to main content

Crate bamts_runtime

Crate bamts_runtime 

Source
Expand description

Deterministic register interpreter for verified production BamTS bytecode.

Persisted constants never carry runtime identity. This interpreter therefore owns a slot heap for strings, bigints, objects, arrays, closures, private names, regular expressions, and iterators, and exposes only bamts_native::Value words at host boundaries. Bytecode heap slots use segment 1; other segments remain host-owned.

The 36-op dynamic-computation ISA is executed locally: register-keyed property access (with data properties, accessor descriptors, and private-name identity), prototype chains, closures with explicit capture environments, arguments arrays, this/arguments/new.target, globals, arrays with spread, object spread, iterators (sync/async/keys) with the two-write IteratorNext, and generator/async Suspend-resume. The Host trait owns only external module and builtin operations (foreign calls/constructs, foreign property access, import, export, and the suspension driver); internal objects, arrays, functions, closures, prototypes, and private names never leave the interpreter.

Structs§

CallbackException
An exception reported by a microtask or timer callback.
Execution
A terminated execution and the entry activation’s observable state.
ExecutionOutcome
The observable result of a terminated execution.
Limits
Deterministic execution and allocation ceilings.
Machine
The production bytecode interpreter.
MicrotaskDrain
The result of one explicit microtask checkpoint.
NativeEngine
The native semantic engine over a verified program.
RuntimeError
RuntimeSource
Source metadata attached to every machine failure.
ScriptSource
The exact source of one classic script. Source and resource name preserve UTF-16 code units verbatim, including unpaired surrogates.
TimerError
An owned failure message produced by a TimerProvider.
TimerRun
The result of one explicit timer checkpoint. At most one callback runs.
TimerWakeup
A single expired timer reported by a TimerProvider.

Enums§

NativeError
A native-execution failure: a runtime error, an AOT/entry linkage error, or an unrecoverable native trap whose completion value carries a trap id.
RuntimeErrorKind
ScriptCompileError
Why a host compiler refused a classic script.
ThrowOrigin

Traits§

CompileProvider
A host capability for compiling a classic script without observing machine state.
Host
External capabilities available to the JavaScript runtime.
TimerProvider
A host capability that schedules real time without observing machine state.

Functions§

constant_value
Converts constants that need no runtime identity to ABI values. Strings and bigints are materialized by LoadConst in the machine’s slot heap.
run
run_linked_program
Runs a linked program’s entry through the native engine and returns its observable outcome. This is the runtime side of the AOT main: entries is a compiled NativeEntryTable (an AOT LinkedProgram or a JIT program), and the returned ExecutionOutcome carries buffered stdout and the exit code. It is always available and never feature-gated, so a downstream host crate can link against it without enabling the runtime’s aot-main feature.