Function bodies compiled at first call, half-size code, and v0.0.30
A large script now compiles each function body when it is first called, instructions, heap slots and the syntax tree shrink, the interpreter runs bundled code faster, and the sandbox loader checks its options strictly.
Most of a bundled application never runs. A script of 256 functions or more, which runs in the interpreter, now leaves every body that can wait to its function's first call, compiled then in the context the main compile saved: TypeScript's compiler bundle defers 10,082 bodies and a run compiles 2,219 (dcefa81d). An instruction is 16 bytes instead of 32 (13b0af6d), a heap slot 64 instead of 80 (2664dea9), and the syntax tree after the parse takes about half the memory, 46.5 MB instead of 100.6 for TypeScript (a509ec5c). The interpreter answers a field read or written through many object layouts from the receiver's shape (007c47bd), and a minor collection roots only what was stored since the last one (0c1ba289).
Measured on the published binaries, Babel, TypeScript, Prettier and the server renderers take 0.77× to 0.95× v0.0.29's time, TypeScript's peak working set falls from 318 to 225 MiB, and the interpreter runs the 78 benchmark programs in 0.917× v0.0.29's time and 0.818× QuickJS's. The profile-guided build, trained on an application-scale program too (1a587022), is ahead of QuickJS on every bundle. The sandbox loader, 1.4.0, reads only an options object's own properties and counts seeded data against its quotas (35d0671f), and a DataView's byteLength and byteOffset read 0 out of bounds, as the newest Test262 expects (759c05fe). v0.0.30 was published on 27 October from fd6b48a5.