mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 12:07:14 +02:00
Add a new interpreter that executes bytecode via generated assembly, written in a custom DSL (asmint.asm) that AsmIntGen compiles to native x86_64 or aarch64 code. The interpreter keeps the bytecode program counter and register file pointer in machine registers for fast access, dispatching opcodes through a jump table. Hot paths (arithmetic, comparisons, property access on simple objects) are handled entirely in assembly, with cold/complex operations calling into C++ helper functions defined in AsmInterpreter.cpp. A small build-time tool (gen_asm_offsets) uses offsetof() to emit struct field offsets as constants consumed by the DSL, ensuring the assembly stays in sync with C++ struct layouts. The interpreter is enabled by default on platforms that support it. The C++ interpreter can be selected via LIBJS_USE_CPP_INTERPRETER=1. Currently supported platforms: - Linux/x86_64 - Linux/aarch64 - macOS/x86_64 - macOS/aarch64
307 B
307 B