Skip to content

Commit 8501ed6

Browse files
committed
Update comments at the top
1 parent 96b1d29 commit 8501ed6

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/ir/module-splitting.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,12 @@
2626
// placeholder function (and eventually to the original secondary
2727
// function), allocating a new table slot for the placeholder if necessary.
2828
//
29-
// 4. Replace all references to each secondary module's functions in the
30-
// primary module's and each other secondary module's table segments with
31-
// references to imported placeholder functions.
29+
// 4. Pre-create trampolines for secondary functions referenced in global
30+
// initializers but not yet replace the function references. Replace all
31+
// other references to each secondary module's functions in the primary
32+
// module's and each other secondary module's table segments with
33+
// references to trampoline functions that call imported placeholder
34+
// functions.
3235
//
3336
// 5. Rewrite direct calls from primary functions to secondary functions to be
3437
// indirect calls to their placeholder functions (and eventually to their
@@ -48,6 +51,9 @@
4851
// import them in the secondary modules. If possible, move those module
4952
// items instead to the secondary modules.
5053
//
54+
// 9. Delete unused trampoline functions pre-created in 3, since some global
55+
// initializers end up referencing functions the same module.
56+
//
5157
// Functions can be used or referenced three ways in a WebAssembly module: they
5258
// can be exported, called, or referenced with ref.func. The above procedure
5359
// introduces a layer of indirection to each of those mechanisms that removes

0 commit comments

Comments
 (0)