Skip to content

Commit 2e049f8

Browse files
committed
add comment
1 parent 546986e commit 2e049f8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/tools/wasm-ctor-eval.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,8 +1179,13 @@ EvalCtorOutcome evalCtor(EvallingModuleRunner& instance,
11791179
}
11801180
}
11811181

1182-
if ((localExprs.size() && func->getParams() != Type::none) ||
1183-
func->name != funcName ||
1182+
// If we have return-called to a different function, have precomputed values
1183+
// for the current return-called function (even if it is the same as the
1184+
// original function), or have partially computed the current function, then
1185+
// we can replace the export with a new function that does less work than
1186+
// the original.
1187+
if (func->name != funcName ||
1188+
(localExprs.size() && func->getParams() != Type::none) ||
11841189
(successes > 0 && successes < block->list.size())) {
11851190
auto originalFuncType = wasm.getFunction(funcName)->type;
11861191
auto copyName = Names::getValidFunctionName(wasm, funcName);

0 commit comments

Comments
 (0)