| 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/ast-numbering.h" | 5 #include "src/ast-numbering.h" |
| 6 | 6 |
| 7 #include "src/ast.h" | 7 #include "src/ast.h" |
| 8 #include "src/scopes.h" | 8 #include "src/scopes.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 node->set_ast_properties(&properties_); | 551 node->set_ast_properties(&properties_); |
| 552 node->set_dont_optimize_reason(dont_optimize_reason()); | 552 node->set_dont_optimize_reason(dont_optimize_reason()); |
| 553 return !HasStackOverflow(); | 553 return !HasStackOverflow(); |
| 554 } | 554 } |
| 555 | 555 |
| 556 | 556 |
| 557 bool AstNumberingVisitor::Renumber(FunctionLiteral* node) { | 557 bool AstNumberingVisitor::Renumber(FunctionLiteral* node) { |
| 558 Scope* scope = node->scope(); | 558 Scope* scope = node->scope(); |
| 559 | 559 |
| 560 if (scope->HasIllegalRedeclaration()) { | 560 if (scope->HasIllegalRedeclaration()) { |
| 561 scope->VisitIllegalRedeclaration(this); | 561 Visit(scope->GetIllegalRedeclaration()); |
| 562 DisableOptimization(kFunctionWithIllegalRedeclaration); | 562 DisableOptimization(kFunctionWithIllegalRedeclaration); |
| 563 return Finish(node); | 563 return Finish(node); |
| 564 } | 564 } |
| 565 if (scope->calls_eval()) DisableOptimization(kFunctionCallsEval); | 565 if (scope->calls_eval()) DisableOptimization(kFunctionCallsEval); |
| 566 if (scope->arguments() != NULL && !scope->arguments()->IsStackAllocated()) { | 566 if (scope->arguments() != NULL && !scope->arguments()->IsStackAllocated()) { |
| 567 DisableCrankshaft(kContextAllocatedArguments); | 567 DisableCrankshaft(kContextAllocatedArguments); |
| 568 } | 568 } |
| 569 | 569 |
| 570 VisitDeclarations(scope->declarations()); | 570 VisitDeclarations(scope->declarations()); |
| 571 VisitStatements(node->body()); | 571 VisitStatements(node->body()); |
| 572 | 572 |
| 573 return Finish(node); | 573 return Finish(node); |
| 574 } | 574 } |
| 575 | 575 |
| 576 | 576 |
| 577 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, | 577 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, |
| 578 FunctionLiteral* function) { | 578 FunctionLiteral* function) { |
| 579 AstNumberingVisitor visitor(isolate, zone); | 579 AstNumberingVisitor visitor(isolate, zone); |
| 580 return visitor.Renumber(function); | 580 return visitor.Renumber(function); |
| 581 } | 581 } |
| 582 } // namespace internal | 582 } // namespace internal |
| 583 } // namespace v8 | 583 } // namespace v8 |
| OLD | NEW |