You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SPLIT_MODULE] Support multi-split loading (#25571)
Currently, if the primary module name is `test.wasm` and when a
placeholder function is called, the emscripten JS runtime loads
`test.deferred.wasm`, which is hardcoded. But as we want emscripten to
support multi-split, the runtime has to know which secondary module to
load.
Binaryen's WebAssembly/binaryen#7975 changes the
placeholder import module naming scheme. Currently placeholder's import
modules are all `placeholder`:
https://github.com/WebAssembly/binaryen/blob/dcc704ce20e4723ae42012039bdb3b84ec2035f9/test/lit/wasm-split/multi-split.wast#L291-L295
But the Binaryen's companion PR will change this to the format of
`placeholder.[secondaryName]`. Then Emscripten runtime will parse this
module name to learn which secondary file to load. For example, if the
import module is `placeholder.2` and the import base is `3` and the
primary wasm file is `test.wasm`,
```wast
(import "placeholder.2" "3" (func $placeholder_3 (result i32)))
```
when `placeholder_3` function is loaded, the runtime will parse
`placeholder.2` and correctly figure out that it should load
`test.2.wasm`.
This PR still supports the old `placeholder` namespace, because this PR
has to land first for the Binaryen companion PR to land. After it lands,
we can remove the `placeholder` handling part.
Companion PR: WebAssembly/binaryen#7975
0 commit comments