From a8a2693fa6382e7e07feb6807d8681ecaf740cc3 Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Tue, 2 Feb 2021 02:04:30 +0900 Subject: 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. --- src/wasm/wasm-stack.cpp | 9 --------- 1 file changed, 9 deletions(-) (limited to 'src/wasm/wasm-stack.cpp') 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()); } -- cgit v1.2.3