Expand description
The bytecode interpreter.
The machine is the same shape as the reference’s: a value stack per frame, a
program counter into js_compile’s resolved bytecode, and a frame chain. Two
properties of that design are worth stating up front because they are visible
everywhere below.
Frames are explicit, not recursive. A JavaScript call pushes a frame onto
Interp::frames and the loop continues; it never recurses in Rust. Deep
JavaScript recursion therefore costs heap, not C stack, and the depth limit is
ours to enforce rather than the host’s to crash.
Exceptions live on the value stack. catch pushes a Value::CatchOffset
marker and an exception is found by walking the frame’s stack downwards looking
for the innermost one. There is no side table, which is why a try inside a
loop costs nothing until it throws.
Structs§
Enums§
- Delete
Failure - What a store does when the object refuses the write.
- Hint
- Which type
ToPrimitiveprefers when it converts an object. - Signal
- Why execution stopped.
Functions§
- debug_
display - How
printrenders a value: the reference’sJS_PrintValue. - display
- How
printrenders a value.
Type Aliases§
- JsResult
- What an execution step produced.