diff options
author | Heejin Ahn <aheejin@gmail.com> | 2021-02-02 02:04:30 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-02 02:04:30 +0900 |
commit | a8a2693fa6382e7e07feb6807d8681ecaf740cc3 (patch) | |
tree | 0fa335da63bf86090e338d1efec02e46eab4853f /src/wasm/wasm-stack.cpp | |
parent | 89b811699b2db0c0e2ad744a1240f6283f8eed86 (diff) | |
download | binaryen-a8a2693fa6382e7e07feb6807d8681ecaf740cc3.tar.gz binaryen-a8a2693fa6382e7e07feb6807d8681ecaf740cc3.tar.bz2 binaryen-a8a2693fa6382e7e07feb6807d8681ecaf740cc3.zip |
Remove unnecessary breakStack pushes for if/try (NFC) (#3533)
This break stack is maintained to compute branch depths, but it seems we
don't need to push and pop for each of if and else block or every single
catch/catch_all block; it would be sufficient to have just one stack
entry for the whole try-catch or if-else.
Diffstat (limited to 'src/wasm/wasm-stack.cpp')
-rw-r--r-- | src/wasm/wasm-stack.cpp | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/src/wasm/wasm-stack.cpp b/src/wasm/wasm-stack.cpp index 9ac3013b5..003d2b7af 100644 --- a/src/wasm/wasm-stack.cpp +++ b/src/wasm/wasm-stack.cpp @@ -48,9 +48,6 @@ void BinaryInstWriter::visitIf(If* curr) { } void BinaryInstWriter::emitIfElse(If* curr) { - assert(!breakStack.empty()); - breakStack.pop_back(); - breakStack.emplace_back(IMPOSSIBLE_CONTINUE); // TODO same as If if (func && !sourceMap) { parent.writeExtraDebugLocation(curr, func, BinaryLocations::Else); } @@ -1899,9 +1896,6 @@ void BinaryInstWriter::visitTry(Try* curr) { } void BinaryInstWriter::emitCatch(Try* curr, Index i) { - assert(!breakStack.empty()); - breakStack.pop_back(); - breakStack.emplace_back(IMPOSSIBLE_CONTINUE); if (func && !sourceMap) { parent.writeExtraDebugLocation(curr, func, i); } @@ -1910,9 +1904,6 @@ void BinaryInstWriter::emitCatch(Try* curr, Index i) { } void BinaryInstWriter::emitCatchAll(Try* curr) { - assert(!breakStack.empty()); - breakStack.pop_back(); - breakStack.emplace_back(IMPOSSIBLE_CONTINUE); if (func && !sourceMap) { parent.writeExtraDebugLocation(curr, func, curr->catchBodies.size()); } |