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

Side by Side Diff: src/asmjs/asm-wasm-builder.cc

Issue 2108193003: [modules] AST and parser rework. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@anonymous-declarations
Patch Set: . Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/asmjs/typing-asm.cc » ('j') | src/ast/modules.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 // Required to get M_E etc. in MSVC. 7 // Required to get M_E etc. in MSVC.
8 #if defined(_WIN32) 8 #if defined(_WIN32)
9 #define _USE_MATH_DEFINES 9 #define _USE_MATH_DEFINES
10 #endif 10 #endif
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 DCHECK_NULL(current_function_builder_); 128 DCHECK_NULL(current_function_builder_);
129 uint32_t index = LookupOrInsertFunction(decl->proxy()->var()); 129 uint32_t index = LookupOrInsertFunction(decl->proxy()->var());
130 current_function_builder_ = builder_->FunctionAt(index); 130 current_function_builder_ = builder_->FunctionAt(index);
131 scope_ = kFuncScope; 131 scope_ = kFuncScope;
132 RECURSE(Visit(decl->fun())); 132 RECURSE(Visit(decl->fun()));
133 scope_ = kModuleScope; 133 scope_ = kModuleScope;
134 current_function_builder_ = nullptr; 134 current_function_builder_ = nullptr;
135 local_variables_.Clear(); 135 local_variables_.Clear();
136 } 136 }
137 137
138 void VisitImportDeclaration(ImportDeclaration* decl) override {}
139
140 void VisitStatements(ZoneList<Statement*>* stmts) override { 138 void VisitStatements(ZoneList<Statement*>* stmts) override {
141 for (int i = 0; i < stmts->length(); ++i) { 139 for (int i = 0; i < stmts->length(); ++i) {
142 Statement* stmt = stmts->at(i); 140 Statement* stmt = stmts->at(i);
143 ExpressionStatement* e = stmt->AsExpressionStatement(); 141 ExpressionStatement* e = stmt->AsExpressionStatement();
144 if (e != nullptr && e->expression()->IsUndefinedLiteral()) { 142 if (e != nullptr && e->expression()->IsUndefinedLiteral()) {
145 continue; 143 continue;
146 } 144 }
147 RECURSE(Visit(stmt)); 145 RECURSE(Visit(stmt));
148 if (stmt->IsJump()) break; 146 if (stmt->IsJump()) break;
149 } 147 }
(...skipping 1626 matching lines...) Expand 10 before | Expand all | Expand 10 after
1776 AsmWasmBuilderImpl impl(isolate_, zone_, literal_, typer_); 1774 AsmWasmBuilderImpl impl(isolate_, zone_, literal_, typer_);
1777 impl.Build(); 1775 impl.Build();
1778 *foreign_args = impl.GetForeignArgs(); 1776 *foreign_args = impl.GetForeignArgs();
1779 ZoneBuffer* buffer = new (zone_) ZoneBuffer(zone_); 1777 ZoneBuffer* buffer = new (zone_) ZoneBuffer(zone_);
1780 impl.builder_->WriteTo(*buffer); 1778 impl.builder_->WriteTo(*buffer);
1781 return buffer; 1779 return buffer;
1782 } 1780 }
1783 } // namespace wasm 1781 } // namespace wasm
1784 } // namespace internal 1782 } // namespace internal
1785 } // namespace v8 1783 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/asmjs/typing-asm.cc » ('j') | src/ast/modules.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698