summaryrefslogtreecommitdiff
path: root/src/ir
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir')
-rw-r--r--src/ir/module-splitting.cpp2
-rw-r--r--src/ir/module-splitting.h6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/ir/module-splitting.cpp b/src/ir/module-splitting.cpp
index 777818689..caa996b30 100644
--- a/src/ir/module-splitting.cpp
+++ b/src/ir/module-splitting.cpp
@@ -442,7 +442,7 @@ ModuleSplitter::classifyFunctions(Module& primary, const Config& config) {
// module since that would make them async when they may not have the JSPI
// wrapper. Exported JSPI functions can still benefit from splitting though
// since only the JSPI wrapper stub will remain in the primary module.
- if (func->imported() || config.primaryFuncs.count(func->name) ||
+ if (func->imported() || !config.secondaryFuncs.count(func->name) ||
(config.jspi && ExportUtils::isExported(primary, *func)) ||
segmentReferrers.count(func->name)) {
primaryFuncs.insert(func->name);
diff --git a/src/ir/module-splitting.h b/src/ir/module-splitting.h
index 620993d2d..89e4dd2bb 100644
--- a/src/ir/module-splitting.h
+++ b/src/ir/module-splitting.h
@@ -47,11 +47,11 @@ namespace wasm::ModuleSplitting {
static const Name LOAD_SECONDARY_MODULE("__load_secondary_module");
struct Config {
- // The set of functions to keep in the primary module. All others are split
- // out into the new secondary module. Must include the start function if it
+ // The set of functions to split into the secondary module. All others are
+ // kept in the primary module. Must not include the start function if it
// exists. May or may not include imported functions, which are always kept in
// the primary module regardless.
- std::set<Name> primaryFuncs;
+ std::set<Name> secondaryFuncs;
// Whether to import placeholder functions into the primary module that will
// be called when a secondary function is called before the secondary module
// has been loaded.