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

Side by Side Diff: src/crankshaft/typing.cc

Issue 2457393003: Thread decls-list through Declaration (Closed)
Patch Set: rebase Created 4 years, 1 month 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 | « src/crankshaft/typing.h ('k') | src/full-codegen/full-codegen.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/crankshaft/typing.h" 5 #include "src/crankshaft/typing.h"
6 6
7 #include "src/ast/compile-time-value.h" 7 #include "src/ast/compile-time-value.h"
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/ast/variables.h" 9 #include "src/ast/variables.h"
10 #include "src/frames-inl.h" 10 #include "src/frames-inl.h"
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 774
775 int AstTyper::variable_index(Variable* var) { 775 int AstTyper::variable_index(Variable* var) {
776 // Stack locals have the range [0 .. l] 776 // Stack locals have the range [0 .. l]
777 // Parameters have the range [-1 .. p] 777 // Parameters have the range [-1 .. p]
778 // We map this to [-p-2 .. -1, 0 .. l] 778 // We map this to [-p-2 .. -1, 0 .. l]
779 return var->IsStackLocal() 779 return var->IsStackLocal()
780 ? stack_local_index(var->index()) 780 ? stack_local_index(var->index())
781 : var->IsParameter() ? parameter_index(var->index()) : kNoVar; 781 : var->IsParameter() ? parameter_index(var->index()) : kNoVar;
782 } 782 }
783 783
784 void AstTyper::VisitDeclarations(ZoneList<Declaration*>* decls) { 784 void AstTyper::VisitDeclarations(Declaration::List* decls) {
785 for (int i = 0; i < decls->length(); ++i) { 785 for (Declaration* decl : *decls) {
786 Declaration* decl = decls->at(i);
787 RECURSE(Visit(decl)); 786 RECURSE(Visit(decl));
788 } 787 }
789 } 788 }
790 789
791 790
792 void AstTyper::VisitVariableDeclaration(VariableDeclaration* declaration) { 791 void AstTyper::VisitVariableDeclaration(VariableDeclaration* declaration) {
793 } 792 }
794 793
795 794
796 void AstTyper::VisitFunctionDeclaration(FunctionDeclaration* declaration) { 795 void AstTyper::VisitFunctionDeclaration(FunctionDeclaration* declaration) {
797 RECURSE(Visit(declaration->fun())); 796 RECURSE(Visit(declaration->fun()));
798 } 797 }
799 798
800 799
801 } // namespace internal 800 } // namespace internal
802 } // namespace v8 801 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/typing.h ('k') | src/full-codegen/full-codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698