Skip to content

executeBytecode

function executeBytecode(
bytecode,
vm,
pipeline?,
expression?,
context?,
symbolicTolerant?): EvalResult;

Defined in: packages/engine/src/vm/VM.ts:1475

Execute bytecode with optional diagnostic pipeline integration.

Performance notes:

  • Uses a switch(op) statement for dispatch. V8 compiles dense integer switches (OpCode values 0–200) into a jump table with O(1) dispatch. All handler code is inlined directly in the switch cases, allowing TurboFan to optimize across opcode boundaries.
  • ADD/SUB/MUL have an inlined numeric fast path that skips the binaryOp() function call + closure allocation when both operands are plain numbers (>90% of arithmetic ops).
  • Tracing uses a boolean guard (shouldTrace) that the JIT eliminates entirely when diagnostics are disabled. No function call overhead.
  • Value.toNumber() caches its result, computed once, read thereafter.
ParameterType
bytecodeBytecode
vmVM
pipeline?DiagnosticPipeline
expression?string
context?LineExecutionContext
symbolicTolerant?boolean

EvalResult