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::VisitSuperPropertyReference( | 171 void AstNumberingVisitor::VisitSuperPropertyReference( |
172 SuperPropertyReference* node) { | 172 SuperPropertyReference* node) { |
173 IncrementNodeCount(); | 173 IncrementNodeCount(); |
174 DisableOptimization(kSuperReference); | 174 DisableOptimization(kSuperReference); |
175 node->set_base_id(ReserveIdRange(SuperPropertyReference::num_ids())); | 175 node->set_base_id(ReserveIdRange(SuperPropertyReference::num_ids())); |
176 Visit(node->this_var()); | 176 Visit(node->this_var()); |
177 Visit(node->home_object_var()); | 177 Visit(node->home_object()); |
178 } | 178 } |
179 | 179 |
180 | 180 |
181 void AstNumberingVisitor::VisitSuperCallReference(SuperCallReference* node) { | 181 void AstNumberingVisitor::VisitSuperCallReference(SuperCallReference* node) { |
182 IncrementNodeCount(); | 182 IncrementNodeCount(); |
183 DisableOptimization(kSuperReference); | 183 DisableOptimization(kSuperReference); |
184 node->set_base_id(ReserveIdRange(SuperCallReference::num_ids())); | 184 node->set_base_id(ReserveIdRange(SuperCallReference::num_ids())); |
185 Visit(node->this_var()); | 185 Visit(node->this_var()); |
186 Visit(node->new_target_var()); | 186 Visit(node->new_target_var()); |
187 Visit(node->this_function_var()); | 187 Visit(node->this_function_var()); |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 if (scope->HasIllegalRedeclaration()) { | 534 if (scope->HasIllegalRedeclaration()) { |
535 scope->VisitIllegalRedeclaration(this); | 535 scope->VisitIllegalRedeclaration(this); |
536 DisableOptimization(kFunctionWithIllegalRedeclaration); | 536 DisableOptimization(kFunctionWithIllegalRedeclaration); |
537 return Finish(node); | 537 return Finish(node); |
538 } | 538 } |
539 if (scope->calls_eval()) DisableOptimization(kFunctionCallsEval); | 539 if (scope->calls_eval()) DisableOptimization(kFunctionCallsEval); |
540 if (scope->arguments() != NULL && !scope->arguments()->IsStackAllocated()) { | 540 if (scope->arguments() != NULL && !scope->arguments()->IsStackAllocated()) { |
541 DisableCrankshaft(kContextAllocatedArguments); | 541 DisableCrankshaft(kContextAllocatedArguments); |
542 } | 542 } |
543 | 543 |
544 ReserveFeedbackSlots(node); | |
545 | |
546 VisitDeclarations(scope->declarations()); | 544 VisitDeclarations(scope->declarations()); |
547 if (scope->is_function_scope() && scope->function() != NULL) { | 545 if (scope->is_function_scope() && scope->function() != NULL) { |
548 // Visit the name of the named function expression. | 546 // Visit the name of the named function expression. |
549 Visit(scope->function()); | 547 Visit(scope->function()); |
550 } | 548 } |
551 VisitStatements(node->body()); | 549 VisitStatements(node->body()); |
552 | 550 |
553 return Finish(node); | 551 return Finish(node); |
554 } | 552 } |
555 | 553 |
556 | 554 |
557 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, | 555 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, |
558 FunctionLiteral* function) { | 556 FunctionLiteral* function) { |
559 AstNumberingVisitor visitor(isolate, zone); | 557 AstNumberingVisitor visitor(isolate, zone); |
560 return visitor.Renumber(function); | 558 return visitor.Renumber(function); |
561 } | 559 } |
562 } // namespace internal | 560 } // namespace internal |
563 } // namespace v8 | 561 } // namespace v8 |
OLD | NEW |