Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(354)

Unified Diff: src/wasm/asm-wasm-builder.cc

Issue 1697423003: Support blocks in asm->wasm global section. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: merge Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/wasm/asm-wasm.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/asm-wasm-builder.cc
diff --git a/src/wasm/asm-wasm-builder.cc b/src/wasm/asm-wasm-builder.cc
index ba1f800c34afb28b7acdc6f9bed122daf30c7ed8..00f459316f6a4d69581f1ca6039ccb9b3222b386 100644
--- a/src/wasm/asm-wasm-builder.cc
+++ b/src/wasm/asm-wasm-builder.cc
@@ -110,11 +110,15 @@ class AsmWasmBuilderImpl : public AstVisitor {
}
}
}
- DCHECK(in_function_);
- BlockVisitor visitor(this, stmt->AsBreakableStatement(), kExprBlock, false,
- static_cast<byte>(stmt->statements()->length()));
- RECURSE(VisitStatements(stmt->statements()));
- DCHECK(block_size_ >= 0);
+ if (in_function_) {
+ BlockVisitor visitor(this, stmt->AsBreakableStatement(), kExprBlock,
+ false,
+ static_cast<byte>(stmt->statements()->length()));
+ RECURSE(VisitStatements(stmt->statements()));
+ DCHECK(block_size_ >= 0);
+ } else {
+ RECURSE(VisitStatements(stmt->statements()));
+ }
}
class BlockVisitor {
« no previous file with comments | « no previous file | test/mjsunit/wasm/asm-wasm.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698