Expand description
Codegen — translates a typechecked Typed AST into a Wasm module.
Re-exports§
pub use symbol_table::SymbolTable;
Modules§
- analysis
- bigint_
pool - Compile-time pool for large bigint literals (those outside ±2^53 - 1).
Each distinct literal becomes a passive data segment of little-endian u64 limbs;
BigIntPool::lookupreturnsNonefor small literals that skip the pool. - bounds
- Bounds-checked array indexing.
- box_
types - Per-program GC box wrapper types for captured-binding storage.
- cast_
check - The structural conformance test and its consumers:
x as T, the!non-null assertion, and the read guard on a narrowed field redeclaration. - classes
- WasmGC type emission and body lowering for user
classdeclarations. - closures
- Per-program closure type collection + emission.
- dependency_
usage - dwarf
- field_
name_ strings - Per-field-name
(ref $string)Wasm globals. - field_
names - Per-module canonical-shape field-names registry.
- function_
adapters - Collects top-level functions used in value position and emits closure-shaped adapter bodies for them.
- function_
emitter FunctionEmitter— single-pass builder for the body of one Wasm function.- imported_
classes - Cross-package class reconstruction (SUB-488).
- init_
guard - Module variables read or written before their declaration has run.
- intrinsics
- Canonical intrinsic Wasm types every Submilli module hard-codes locally.
Both the prelude and consumer codegen call
declare_intrinsic_typesto guarantee identical bytes; WasmGC structural canonicalization then unifies cross-module references. - recursive_
validators - Discovery + planning for recursive alias and data-interface validators.
- string_
pool - Constant-string pool — pre-codegen sweep that collects every string literal and makes each distinct value a passive data segment in the emitted module.
- symbol_
table - Maps
MangledNameto Wasm indices for types, functions, and globals — both imported symbols and consumer-local declarations. - throw
- Shared emission for raising a catchable
Error: the native-throwtail used by every wasm throw site (userthrow, array bounds,ascast mismatch, JSON shape mismatch), plus theTypeErrorandReferenceErrorraises built on it and their messages. - user_
subtypes - Per-user-subtype Wasm subtype, vtable, and method emission for structural object shapes.
Structs§
- Codegen
Ctx - Codegen
Error - Generated
Module - Guarded
Bodies - Function indices of the depth-guarded bodies behind a vtable’s universal
equals,toJsonandhashslots.
Functions§
- codegen
- codegen_
owned_ by - Like
codegen_with_type_info, but names the module afterowning_packageinstead ofTypedAst::package_name. - codegen_
package_ with_ type_ info - codegen_
with_ type_ info