| 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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 | 341 |
| 342 void AstNumberingVisitor::VisitProperty(Property* node) { | 342 void AstNumberingVisitor::VisitProperty(Property* node) { |
| 343 VisitPropertyReference(node); | 343 VisitPropertyReference(node); |
| 344 ReserveFeedbackSlots(node); | 344 ReserveFeedbackSlots(node); |
| 345 } | 345 } |
| 346 | 346 |
| 347 | 347 |
| 348 void AstNumberingVisitor::VisitAssignment(Assignment* node) { | 348 void AstNumberingVisitor::VisitAssignment(Assignment* node) { |
| 349 IncrementNodeCount(); | 349 IncrementNodeCount(); |
| 350 node->set_base_id(ReserveIdRange(Assignment::num_ids())); | 350 node->set_base_id(ReserveIdRange(Assignment::num_ids())); |
| 351 |
| 351 if (node->is_compound()) VisitBinaryOperation(node->binary_operation()); | 352 if (node->is_compound()) VisitBinaryOperation(node->binary_operation()); |
| 352 VisitReference(node->target()); | 353 VisitReference(node->target()); |
| 353 Visit(node->value()); | 354 Visit(node->value()); |
| 354 ReserveFeedbackSlots(node); | 355 ReserveFeedbackSlots(node); |
| 355 } | 356 } |
| 356 | 357 |
| 357 | 358 |
| 358 void AstNumberingVisitor::VisitBinaryOperation(BinaryOperation* node) { | 359 void AstNumberingVisitor::VisitBinaryOperation(BinaryOperation* node) { |
| 359 IncrementNodeCount(); | 360 IncrementNodeCount(); |
| 360 node->set_base_id(ReserveIdRange(BinaryOperation::num_ids())); | 361 node->set_base_id(ReserveIdRange(BinaryOperation::num_ids())); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 | 550 |
| 550 | 551 |
| 551 void AstNumberingVisitor::VisitFunctionLiteral(FunctionLiteral* node) { | 552 void AstNumberingVisitor::VisitFunctionLiteral(FunctionLiteral* node) { |
| 552 IncrementNodeCount(); | 553 IncrementNodeCount(); |
| 553 node->set_base_id(ReserveIdRange(FunctionLiteral::num_ids())); | 554 node->set_base_id(ReserveIdRange(FunctionLiteral::num_ids())); |
| 554 // We don't recurse into the declarations or body of the function literal: | 555 // We don't recurse into the declarations or body of the function literal: |
| 555 // you have to separately Renumber() each FunctionLiteral that you compile. | 556 // you have to separately Renumber() each FunctionLiteral that you compile. |
| 556 } | 557 } |
| 557 | 558 |
| 558 | 559 |
| 560 void AstNumberingVisitor::VisitRewritableAssignmentExpression( |
| 561 RewritableAssignmentExpression* node) { |
| 562 IncrementNodeCount(); |
| 563 node->set_base_id(ReserveIdRange(RewritableAssignmentExpression::num_ids())); |
| 564 Visit(node->expression()); |
| 565 } |
| 566 |
| 567 |
| 559 bool AstNumberingVisitor::Finish(FunctionLiteral* node) { | 568 bool AstNumberingVisitor::Finish(FunctionLiteral* node) { |
| 560 node->set_ast_properties(&properties_); | 569 node->set_ast_properties(&properties_); |
| 561 node->set_dont_optimize_reason(dont_optimize_reason()); | 570 node->set_dont_optimize_reason(dont_optimize_reason()); |
| 562 return !HasStackOverflow(); | 571 return !HasStackOverflow(); |
| 563 } | 572 } |
| 564 | 573 |
| 565 | 574 |
| 566 bool AstNumberingVisitor::Renumber(FunctionLiteral* node) { | 575 bool AstNumberingVisitor::Renumber(FunctionLiteral* node) { |
| 567 Scope* scope = node->scope(); | 576 Scope* scope = node->scope(); |
| 568 | 577 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 583 } | 592 } |
| 584 | 593 |
| 585 | 594 |
| 586 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, | 595 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, |
| 587 FunctionLiteral* function) { | 596 FunctionLiteral* function) { |
| 588 AstNumberingVisitor visitor(isolate, zone); | 597 AstNumberingVisitor visitor(isolate, zone); |
| 589 return visitor.Renumber(function); | 598 return visitor.Renumber(function); |
| 590 } | 599 } |
| 591 } // namespace internal | 600 } // namespace internal |
| 592 } // namespace v8 | 601 } // namespace v8 |
| OLD | NEW |