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

Side by Side Diff: src/ast-numbering.cc

Issue 1135243004: [es6] Support super.property in eval and arrow functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: cleanup Created 5 years, 6 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 #include "src/ast.h" 7 #include "src/ast.h"
8 #include "src/ast-numbering.h" 8 #include "src/ast-numbering.h"
9 #include "src/scopes.h" 9 #include "src/scopes.h"
10 10
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 node->set_base_id(ReserveIdRange(ThisFunction::num_ids())); 160 node->set_base_id(ReserveIdRange(ThisFunction::num_ids()));
161 } 161 }
162 162
163 163
164 void AstNumberingVisitor::VisitSuperReference(SuperReference* node) { 164 void AstNumberingVisitor::VisitSuperReference(SuperReference* node) {
165 IncrementNodeCount(); 165 IncrementNodeCount();
166 DisableOptimization(kSuperReference); 166 DisableOptimization(kSuperReference);
167 ReserveFeedbackSlots(node); 167 ReserveFeedbackSlots(node);
168 node->set_base_id(ReserveIdRange(SuperReference::num_ids())); 168 node->set_base_id(ReserveIdRange(SuperReference::num_ids()));
169 Visit(node->this_var()); 169 Visit(node->this_var());
170 Visit(node->home_object_var());
170 } 171 }
171 172
172 173
173 void AstNumberingVisitor::VisitImportDeclaration(ImportDeclaration* node) { 174 void AstNumberingVisitor::VisitImportDeclaration(ImportDeclaration* node) {
174 IncrementNodeCount(); 175 IncrementNodeCount();
175 DisableOptimization(kImportDeclaration); 176 DisableOptimization(kImportDeclaration);
176 VisitVariableProxy(node->proxy()); 177 VisitVariableProxy(node->proxy());
177 } 178 }
178 179
179 180
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 if (scope->HasIllegalRedeclaration()) { 504 if (scope->HasIllegalRedeclaration()) {
504 scope->VisitIllegalRedeclaration(this); 505 scope->VisitIllegalRedeclaration(this);
505 DisableOptimization(kFunctionWithIllegalRedeclaration); 506 DisableOptimization(kFunctionWithIllegalRedeclaration);
506 return Finish(node); 507 return Finish(node);
507 } 508 }
508 if (scope->calls_eval()) DisableOptimization(kFunctionCallsEval); 509 if (scope->calls_eval()) DisableOptimization(kFunctionCallsEval);
509 if (scope->arguments() != NULL && !scope->arguments()->IsStackAllocated()) { 510 if (scope->arguments() != NULL && !scope->arguments()->IsStackAllocated()) {
510 DisableOptimization(kContextAllocatedArguments); 511 DisableOptimization(kContextAllocatedArguments);
511 } 512 }
512 513
514 ReserveFeedbackSlots(node);
515
513 VisitDeclarations(scope->declarations()); 516 VisitDeclarations(scope->declarations());
514 if (scope->is_function_scope() && scope->function() != NULL) { 517 if (scope->is_function_scope() && scope->function() != NULL) {
515 // Visit the name of the named function expression. 518 // Visit the name of the named function expression.
516 Visit(scope->function()); 519 Visit(scope->function());
517 } 520 }
518 VisitStatements(node->body()); 521 VisitStatements(node->body());
519 522
520 return Finish(node); 523 return Finish(node);
521 } 524 }
522 525
523 526
524 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, 527 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone,
525 FunctionLiteral* function) { 528 FunctionLiteral* function) {
526 AstNumberingVisitor visitor(isolate, zone); 529 AstNumberingVisitor visitor(isolate, zone);
527 return visitor.Renumber(function); 530 return visitor.Renumber(function);
528 } 531 }
529 } 532 }
530 } // namespace v8::internal 533 } // namespace v8::internal
OLDNEW
« src/ast.h ('K') | « src/ast.cc ('k') | src/ast-value-factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698