Expand description
Lower the JavaScript AST to fusevm::Chunk.
Native fusevm ops carry arithmetic (+ - * / % **), the relational
comparisons (< <= > >=) and boolean short-circuit so the JIT can trace
them; the strict numeric hook (host) supplies JS semantics for non-numeric
operands (string concat, coercion). Everything JS-specific — name access,
member/index access, calls, object/array construction, iteration — lowers to
a CallBuiltin that lands in builtins.rs.
Conditions are normalized through the TRUTHY builtin before a native
JumpIfFalse, because JS truthiness differs from fusevm’s default numeric
truthiness. Compiler-internal name strings travel as native Value::Str
constants; JS-level strings are always heap objects built by MKSTR.
Structs§
- Compiler
- Program
- A compiled program: the top-level chunk plus the function template table and the try-block table.
Functions§
- check_
early_ errors - compile
- Compile a parsed program.
debugenables per-statement DAP line markers. - compile_
completion - Compile leaving the value of the final top-level expression statement on the
stack (the program’s completion value), for
eval/vm.runInThisContext. A non-expression final statement leaves nothing (→undefined). - compile_
completion_ strict - As
compile_completion, but with the CALLER’s strictness folded in. - rebase_
program - Rebase every func-id and try-id reference so its ids sit above those already loaded on the host (needed only for incremental loading; a no-op for a single run).