Expand description
Collects top-level functions used in value position and emits closure-shaped adapter bodies for them.
Structs§
Functions§
- allocate_
closure_ globals - Allocates the globals that cache a function’s closure, so every read of a
top-level function yields the same value and
f === fholds. The closure has no environment, so one instance serves every read. Each starts null and is filled on first read. Each function this module exports gets one sharedanyrefcache; any other function read here gets a typed cache of its own, unless it imported a shared one. Returns how many globals were added. - emit_
bodies - exported_
closure_ caches - The closure caches this module exports, from the name a consumer knows the function by to the function it defines: its non-generic exported functions, under each name they are exported as, and its classes’ public static methods. A consumer that reads one as a value imports the cache instead of keeping its own, so the function is one closure across packages, as in JavaScript.
- import_
shared_ closure_ caches - Imports the closure cache of each dependency function this module reads as a value, where the function’s package exports one.