| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |