| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 118   DisableOptimization(kDebuggerStatement); | 118   DisableOptimization(kDebuggerStatement); | 
| 119   node->set_base_id(ReserveIdRange(DebuggerStatement::num_ids())); | 119   node->set_base_id(ReserveIdRange(DebuggerStatement::num_ids())); | 
| 120 } | 120 } | 
| 121 | 121 | 
| 122 | 122 | 
| 123 void AstNumberingVisitor::VisitNativeFunctionLiteral( | 123 void AstNumberingVisitor::VisitNativeFunctionLiteral( | 
| 124     NativeFunctionLiteral* node) { | 124     NativeFunctionLiteral* node) { | 
| 125   IncrementNodeCount(); | 125   IncrementNodeCount(); | 
| 126   DisableOptimization(kNativeFunctionLiteral); | 126   DisableOptimization(kNativeFunctionLiteral); | 
| 127   node->set_base_id(ReserveIdRange(NativeFunctionLiteral::num_ids())); | 127   node->set_base_id(ReserveIdRange(NativeFunctionLiteral::num_ids())); | 
|  | 128   ReserveFeedbackSlots(node); | 
| 128 } | 129 } | 
| 129 | 130 | 
| 130 | 131 | 
| 131 void AstNumberingVisitor::VisitDoExpression(DoExpression* node) { | 132 void AstNumberingVisitor::VisitDoExpression(DoExpression* node) { | 
| 132   IncrementNodeCount(); | 133   IncrementNodeCount(); | 
| 133   node->set_base_id(ReserveIdRange(DoExpression::num_ids())); | 134   node->set_base_id(ReserveIdRange(DoExpression::num_ids())); | 
| 134   Visit(node->block()); | 135   Visit(node->block()); | 
| 135   Visit(node->result()); | 136   Visit(node->result()); | 
| 136 } | 137 } | 
| 137 | 138 | 
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 588     Visit(arguments->at(i)); | 589     Visit(arguments->at(i)); | 
| 589   } | 590   } | 
| 590 } | 591 } | 
| 591 | 592 | 
| 592 | 593 | 
| 593 void AstNumberingVisitor::VisitFunctionLiteral(FunctionLiteral* node) { | 594 void AstNumberingVisitor::VisitFunctionLiteral(FunctionLiteral* node) { | 
| 594   IncrementNodeCount(); | 595   IncrementNodeCount(); | 
| 595   node->set_base_id(ReserveIdRange(FunctionLiteral::num_ids())); | 596   node->set_base_id(ReserveIdRange(FunctionLiteral::num_ids())); | 
| 596   // We don't recurse into the declarations or body of the function literal: | 597   // We don't recurse into the declarations or body of the function literal: | 
| 597   // you have to separately Renumber() each FunctionLiteral that you compile. | 598   // you have to separately Renumber() each FunctionLiteral that you compile. | 
|  | 599   ReserveFeedbackSlots(node); | 
| 598 } | 600 } | 
| 599 | 601 | 
| 600 | 602 | 
| 601 void AstNumberingVisitor::VisitRewritableExpression( | 603 void AstNumberingVisitor::VisitRewritableExpression( | 
| 602     RewritableExpression* node) { | 604     RewritableExpression* node) { | 
| 603   IncrementNodeCount(); | 605   IncrementNodeCount(); | 
| 604   node->set_base_id(ReserveIdRange(RewritableExpression::num_ids())); | 606   node->set_base_id(ReserveIdRange(RewritableExpression::num_ids())); | 
| 605   Visit(node->expression()); | 607   Visit(node->expression()); | 
| 606 } | 608 } | 
| 607 | 609 | 
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 649 } | 651 } | 
| 650 | 652 | 
| 651 | 653 | 
| 652 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, | 654 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, | 
| 653                             FunctionLiteral* function) { | 655                             FunctionLiteral* function) { | 
| 654   AstNumberingVisitor visitor(isolate, zone); | 656   AstNumberingVisitor visitor(isolate, zone); | 
| 655   return visitor.Renumber(function); | 657   return visitor.Renumber(function); | 
| 656 } | 658 } | 
| 657 }  // namespace internal | 659 }  // namespace internal | 
| 658 }  // namespace v8 | 660 }  // namespace v8 | 
| OLD | NEW | 
|---|