Skip to content

Commit 711a22c

Browse files
authored
wasm2js: get rid of some non-flat code assumptions (#2036)
We run flatten there, which lets us simplify things a lot. Turns out that for assertions we didn't run it, which is why we still needed the old non-flat code paths. This adds flatten there and removes that old code and assumptions.
1 parent ff710e6 commit 711a22c

16 files changed

Lines changed: 274 additions & 827 deletions

src/tools/wasm2js.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class AssertionEmitter {
5757
SExpressionWasmBuilder& sexpBuilder;
5858
Output& out;
5959
Wasm2JSBuilder::Flags flags;
60+
Module tempAllocationModule;
6061

6162
Ref emitAssertReturnFunc(Builder& wasmBuilder,
6263
Element& e,
@@ -75,7 +76,7 @@ class AssertionEmitter {
7576

7677
Ref processFunction(Function* func) {
7778
Wasm2JSBuilder sub(flags);
78-
return sub.processFunction(nullptr, func);
79+
return sub.processStandaloneFunction(&tempAllocationModule, func);
7980
}
8081

8182
void emitFunction(Ref func) {

0 commit comments

Comments
 (0)