mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-24 06:14:01 +08:00
wasm32-wasi executables always compiled their program as one LLVM module, so the object step of a large program ran the whole O2 pipeline and code generation on a single thread. Native targets divide a module of more than 4 MB of LLVM text into up to 64 partitions that the helper optimizes and compiles concurrently, importing small functions across partitions for inlining. Nothing in the helper or the link plan is specific to native objects: partitions link as ordinary objects with wasm-ld. nativeProgramPartitions now applies the same size rule to every target and no longer takes the target. A WASI test emits a program whose internal callees, state and table entries land in different partitions, at release and dev optimization, and checks that the partitioned objects are deterministic and link to the same program as one object.