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

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: Cleanup diff 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/compiler/ast-graph-builder.cc » ('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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 Section tables_; 544 Section tables_;
545 Section exports_; 545 Section exports_;
546 546
547 DISALLOW_COPY_AND_ASSIGN(SourceLayoutTracker); 547 DISALLOW_COPY_AND_ASSIGN(SourceLayoutTracker);
548 }; 548 };
549 } // namespace 549 } // namespace
550 550
551 AsmType* AsmTyper::ValidateModule(FunctionLiteral* fun) { 551 AsmType* AsmTyper::ValidateModule(FunctionLiteral* fun) {
552 SourceLayoutTracker source_layout; 552 SourceLayoutTracker source_layout;
553 553
554 Scope* scope = fun->scope(); 554 DeclarationScope* scope = fun->scope();
555 if (!scope->is_function_scope()) FAIL(fun, "Not at function scope."); 555 if (!scope->is_function_scope()) FAIL(fun, "Not at function scope.");
556 if (!ValidAsmIdentifier(fun->name())) 556 if (!ValidAsmIdentifier(fun->name()))
557 FAIL(fun, "Invalid asm.js identifier in module name."); 557 FAIL(fun, "Invalid asm.js identifier in module name.");
558 module_name_ = fun->name(); 558 module_name_ = fun->name();
559 559
560 // Allowed parameters: Stdlib, FFI, Mem 560 // Allowed parameters: Stdlib, FFI, Mem
561 static const uint32_t MaxModuleParameters = 3; 561 static const uint32_t MaxModuleParameters = 3;
562 if (scope->num_parameters() > MaxModuleParameters) { 562 if (scope->num_parameters() > MaxModuleParameters) {
563 FAIL(fun, "asm.js modules may not have more than three parameters."); 563 FAIL(fun, "asm.js modules may not have more than three parameters.");
564 } 564 }
(...skipping 2172 matching lines...) Expand 10 before | Expand all | Expand 10 after
2737 return true; 2737 return true;
2738 } 2738 }
2739 2739
2740 *error_message = typer.error_message(); 2740 *error_message = typer.error_message();
2741 return false; 2741 return false;
2742 } 2742 }
2743 2743
2744 } // namespace wasm 2744 } // namespace wasm
2745 } // namespace internal 2745 } // namespace internal
2746 } // namespace v8 2746 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/asmjs/asm-wasm-builder.cc » ('j') | src/compiler/ast-graph-builder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698