Expand description
Code compiled at run time: eval, the Function constructors,
$262.evalScript and Function.prototype.toString’s source text, through
the compile host the embedder installs.
The core has no front end. The embedder installs a CompileFn that
compiles and lowers source into a Compiler, the part of the runtime a
lowering needs (the heap, the code store, the realm), which the natives
can lend while the loop holds the code store: units compiled at run time
are published into the heap, which frees them once unreachable.
A compilation keeps what it makes alive until it ends: a unit published but not yet instantiated is pinned, and the atoms it interns (keys, names, string constants) are held. Before the program runs, its atoms are pinned for good instead.
Structs§
- Compile
Error - A failed compilation: the error to throw.
- Compile
Request - A compilation request.
- Compiler
- The runtime’s parts a compilation uses. Dropping it ends the
compilation: its pinned units and held atoms are released (a
Compiler::reborrowends nothing).
Enums§
- Compile
Kind - What to compile.
Type Aliases§
- Compile
Fn - The embedder’s compiler: the root function of the compiled code, to be
called with the global object as
this.