OLD | NEW |
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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 node->set_base_id(ReserveIdRange(ThisFunction::num_ids())); | 167 node->set_base_id(ReserveIdRange(ThisFunction::num_ids())); |
168 } | 168 } |
169 | 169 |
170 | 170 |
171 void AstNumberingVisitor::VisitSuperReference(SuperReference* node) { | 171 void AstNumberingVisitor::VisitSuperReference(SuperReference* node) { |
172 IncrementNodeCount(); | 172 IncrementNodeCount(); |
173 DisableOptimization(kSuperReference); | 173 DisableOptimization(kSuperReference); |
174 ReserveFeedbackSlots(node); | 174 ReserveFeedbackSlots(node); |
175 node->set_base_id(ReserveIdRange(SuperReference::num_ids())); | 175 node->set_base_id(ReserveIdRange(SuperReference::num_ids())); |
176 Visit(node->this_var()); | 176 Visit(node->this_var()); |
| 177 Visit(node->home_object_var()); |
177 } | 178 } |
178 | 179 |
179 | 180 |
180 void AstNumberingVisitor::VisitImportDeclaration(ImportDeclaration* node) { | 181 void AstNumberingVisitor::VisitImportDeclaration(ImportDeclaration* node) { |
181 IncrementNodeCount(); | 182 IncrementNodeCount(); |
182 DisableOptimization(kImportDeclaration); | 183 DisableOptimization(kImportDeclaration); |
183 VisitVariableProxy(node->proxy()); | 184 VisitVariableProxy(node->proxy()); |
184 } | 185 } |
185 | 186 |
186 | 187 |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 if (scope->HasIllegalRedeclaration()) { | 519 if (scope->HasIllegalRedeclaration()) { |
519 scope->VisitIllegalRedeclaration(this); | 520 scope->VisitIllegalRedeclaration(this); |
520 DisableOptimization(kFunctionWithIllegalRedeclaration); | 521 DisableOptimization(kFunctionWithIllegalRedeclaration); |
521 return Finish(node); | 522 return Finish(node); |
522 } | 523 } |
523 if (scope->calls_eval()) DisableOptimization(kFunctionCallsEval); | 524 if (scope->calls_eval()) DisableOptimization(kFunctionCallsEval); |
524 if (scope->arguments() != NULL && !scope->arguments()->IsStackAllocated()) { | 525 if (scope->arguments() != NULL && !scope->arguments()->IsStackAllocated()) { |
525 DisableCrankshaft(kContextAllocatedArguments); | 526 DisableCrankshaft(kContextAllocatedArguments); |
526 } | 527 } |
527 | 528 |
| 529 ReserveFeedbackSlots(node); |
| 530 |
528 VisitDeclarations(scope->declarations()); | 531 VisitDeclarations(scope->declarations()); |
529 if (scope->is_function_scope() && scope->function() != NULL) { | 532 if (scope->is_function_scope() && scope->function() != NULL) { |
530 // Visit the name of the named function expression. | 533 // Visit the name of the named function expression. |
531 Visit(scope->function()); | 534 Visit(scope->function()); |
532 } | 535 } |
533 VisitStatements(node->body()); | 536 VisitStatements(node->body()); |
534 | 537 |
535 return Finish(node); | 538 return Finish(node); |
536 } | 539 } |
537 | 540 |
538 | 541 |
539 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, | 542 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, |
540 FunctionLiteral* function) { | 543 FunctionLiteral* function) { |
541 AstNumberingVisitor visitor(isolate, zone); | 544 AstNumberingVisitor visitor(isolate, zone); |
542 return visitor.Renumber(function); | 545 return visitor.Renumber(function); |
543 } | 546 } |
544 } | 547 } |
545 } // namespace v8::internal | 548 } // namespace v8::internal |
OLD | NEW |