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/ast-numbering.h" | 5 #include "src/ast/ast-numbering.h" |
6 | 6 |
7 #include "src/ast/ast.h" | 7 #include "src/ast/ast.h" |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 if (scope->HasIllegalRedeclaration()) { | 578 if (scope->HasIllegalRedeclaration()) { |
579 Visit(scope->GetIllegalRedeclaration()); | 579 Visit(scope->GetIllegalRedeclaration()); |
580 DisableOptimization(kFunctionWithIllegalRedeclaration); | 580 DisableOptimization(kFunctionWithIllegalRedeclaration); |
581 return Finish(node); | 581 return Finish(node); |
582 } | 582 } |
583 if (scope->calls_eval()) DisableOptimization(kFunctionCallsEval); | 583 if (scope->calls_eval()) DisableOptimization(kFunctionCallsEval); |
584 if (scope->arguments() != NULL && !scope->arguments()->IsStackAllocated()) { | 584 if (scope->arguments() != NULL && !scope->arguments()->IsStackAllocated()) { |
585 DisableCrankshaft(kContextAllocatedArguments); | 585 DisableCrankshaft(kContextAllocatedArguments); |
586 } | 586 } |
587 | 587 |
| 588 int rest_index; |
| 589 if (scope->rest_parameter(&rest_index)) { |
| 590 DisableCrankshaft(kRestParameter); |
| 591 } |
| 592 |
588 VisitDeclarations(scope->declarations()); | 593 VisitDeclarations(scope->declarations()); |
589 VisitStatements(node->body()); | 594 VisitStatements(node->body()); |
590 | 595 |
591 return Finish(node); | 596 return Finish(node); |
592 } | 597 } |
593 | 598 |
594 | 599 |
595 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, | 600 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, |
596 FunctionLiteral* function) { | 601 FunctionLiteral* function) { |
597 AstNumberingVisitor visitor(isolate, zone); | 602 AstNumberingVisitor visitor(isolate, zone); |
598 return visitor.Renumber(function); | 603 return visitor.Renumber(function); |
599 } | 604 } |
600 } // namespace internal | 605 } // namespace internal |
601 } // namespace v8 | 606 } // namespace v8 |
OLD | NEW |