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

Side by Side Diff: src/asmjs/asm-typer.cc

Issue 2209573002: Separate Scope into DeclarationScope and Scope (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Move has_simple_parameters_ to DeclarationScope Created 4 years, 4 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/asm-wasm-builder.cc » ('j') | src/ast/scopes.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/asmjs/asm-typer.h" 5 #include "src/asmjs/asm-typer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 Section tables_; 551 Section tables_;
552 Section exports_; 552 Section exports_;
553 553
554 DISALLOW_COPY_AND_ASSIGN(SourceLayoutTracker); 554 DISALLOW_COPY_AND_ASSIGN(SourceLayoutTracker);
555 }; 555 };
556 } // namespace 556 } // namespace
557 557
558 AsmType* AsmTyper::ValidateModule(FunctionLiteral* fun) { 558 AsmType* AsmTyper::ValidateModule(FunctionLiteral* fun) {
559 SourceLayoutTracker source_layout; 559 SourceLayoutTracker source_layout;
560 560
561 Scope* scope = fun->scope(); 561 DeclarationScope* scope = fun->scope();
562 if (!scope->is_function_scope()) FAIL(fun, "Not at function scope."); 562 if (!scope->is_function_scope()) FAIL(fun, "Not at function scope.");
563 if (!ValidAsmIdentifier(fun->name())) 563 if (!ValidAsmIdentifier(fun->name()))
564 FAIL(fun, "Invalid asm.js identifier in module name."); 564 FAIL(fun, "Invalid asm.js identifier in module name.");
565 module_name_ = fun->name(); 565 module_name_ = fun->name();
566 566
567 // Allowed parameters: Stdlib, FFI, Mem 567 // Allowed parameters: Stdlib, FFI, Mem
568 static const uint32_t MaxModuleParameters = 3; 568 static const uint32_t MaxModuleParameters = 3;
569 if (scope->num_parameters() > MaxModuleParameters) { 569 if (scope->num_parameters() > MaxModuleParameters) {
570 FAIL(fun, "asm.js modules may not have more than three parameters."); 570 FAIL(fun, "asm.js modules may not have more than three parameters.");
571 } 571 }
(...skipping 2172 matching lines...) Expand 10 before | Expand all | Expand 10 after
2744 return true; 2744 return true;
2745 } 2745 }
2746 2746
2747 *error_message = typer.error_message(); 2747 *error_message = typer.error_message();
2748 return false; 2748 return false;
2749 } 2749 }
2750 2750
2751 } // namespace wasm 2751 } // namespace wasm
2752 } // namespace internal 2752 } // namespace internal
2753 } // namespace v8 2753 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/asmjs/asm-wasm-builder.cc » ('j') | src/ast/scopes.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698