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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 Visit(node->value()); | 482 Visit(node->value()); |
483 } | 483 } |
484 | 484 |
485 | 485 |
486 void AstNumberingVisitor::VisitArrayLiteral(ArrayLiteral* node) { | 486 void AstNumberingVisitor::VisitArrayLiteral(ArrayLiteral* node) { |
487 IncrementNodeCount(); | 487 IncrementNodeCount(); |
488 node->set_base_id(ReserveIdRange(node->num_ids())); | 488 node->set_base_id(ReserveIdRange(node->num_ids())); |
489 for (int i = 0; i < node->values()->length(); i++) { | 489 for (int i = 0; i < node->values()->length(); i++) { |
490 Visit(node->values()->at(i)); | 490 Visit(node->values()->at(i)); |
491 } | 491 } |
| 492 node->BuildConstantElements(isolate()); |
| 493 ReserveFeedbackSlots(node); |
492 } | 494 } |
493 | 495 |
494 | 496 |
495 void AstNumberingVisitor::VisitCall(Call* node) { | 497 void AstNumberingVisitor::VisitCall(Call* node) { |
496 IncrementNodeCount(); | 498 IncrementNodeCount(); |
497 ReserveFeedbackSlots(node); | 499 ReserveFeedbackSlots(node); |
498 node->set_base_id(ReserveIdRange(Call::num_ids())); | 500 node->set_base_id(ReserveIdRange(Call::num_ids())); |
499 Visit(node->expression()); | 501 Visit(node->expression()); |
500 VisitArguments(node->arguments()); | 502 VisitArguments(node->arguments()); |
501 } | 503 } |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 } | 570 } |
569 | 571 |
570 | 572 |
571 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, | 573 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, |
572 FunctionLiteral* function) { | 574 FunctionLiteral* function) { |
573 AstNumberingVisitor visitor(isolate, zone); | 575 AstNumberingVisitor visitor(isolate, zone); |
574 return visitor.Renumber(function); | 576 return visitor.Renumber(function); |
575 } | 577 } |
576 } // namespace internal | 578 } // namespace internal |
577 } // namespace v8 | 579 } // namespace v8 |
OLD | NEW |