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 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 node->set_base_id(ReserveIdRange(node->num_ids())); | 456 node->set_base_id(ReserveIdRange(node->num_ids())); |
457 if (node->extends()) Visit(node->extends()); | 457 if (node->extends()) Visit(node->extends()); |
458 if (node->constructor()) Visit(node->constructor()); | 458 if (node->constructor()) Visit(node->constructor()); |
459 if (node->class_variable_proxy()) { | 459 if (node->class_variable_proxy()) { |
460 VisitVariableProxy(node->class_variable_proxy()); | 460 VisitVariableProxy(node->class_variable_proxy()); |
461 } | 461 } |
462 for (int i = 0; i < node->properties()->length(); i++) { | 462 for (int i = 0; i < node->properties()->length(); i++) { |
463 VisitObjectLiteralProperty(node->properties()->at(i)); | 463 VisitObjectLiteralProperty(node->properties()->at(i)); |
464 } | 464 } |
465 ReserveFeedbackSlots(node); | 465 ReserveFeedbackSlots(node); |
| 466 node->LayoutFeedbackSlots(); |
466 } | 467 } |
467 | 468 |
468 | 469 |
469 void AstNumberingVisitor::VisitObjectLiteral(ObjectLiteral* node) { | 470 void AstNumberingVisitor::VisitObjectLiteral(ObjectLiteral* node) { |
470 IncrementNodeCount(); | 471 IncrementNodeCount(); |
471 node->set_base_id(ReserveIdRange(node->num_ids())); | 472 node->set_base_id(ReserveIdRange(node->num_ids())); |
472 for (int i = 0; i < node->properties()->length(); i++) { | 473 for (int i = 0; i < node->properties()->length(); i++) { |
473 VisitObjectLiteralProperty(node->properties()->at(i)); | 474 VisitObjectLiteralProperty(node->properties()->at(i)); |
474 } | 475 } |
475 node->BuildConstantProperties(isolate()); | 476 node->BuildConstantProperties(isolate()); |
476 // Mark all computed expressions that are bound to a key that | 477 // Mark all computed expressions that are bound to a key that |
477 // is shadowed by a later occurrence of the same key. For the | 478 // is shadowed by a later occurrence of the same key. For the |
478 // marked expressions, no store code will be is emitted. | 479 // marked expressions, no store code will be is emitted. |
479 node->CalculateEmitStore(zone()); | 480 node->CalculateEmitStore(zone()); |
480 ReserveFeedbackSlots(node); | 481 ReserveFeedbackSlots(node); |
| 482 node->LayoutFeedbackSlots(); |
481 } | 483 } |
482 | 484 |
483 | 485 |
484 void AstNumberingVisitor::VisitObjectLiteralProperty( | 486 void AstNumberingVisitor::VisitObjectLiteralProperty( |
485 ObjectLiteralProperty* node) { | 487 ObjectLiteralProperty* node) { |
486 if (node->is_computed_name()) DisableCrankshaft(kComputedPropertyName); | 488 if (node->is_computed_name()) DisableCrankshaft(kComputedPropertyName); |
487 Visit(node->key()); | 489 Visit(node->key()); |
488 Visit(node->value()); | 490 Visit(node->value()); |
489 } | 491 } |
490 | 492 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 } | 576 } |
575 | 577 |
576 | 578 |
577 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, | 579 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, |
578 FunctionLiteral* function) { | 580 FunctionLiteral* function) { |
579 AstNumberingVisitor visitor(isolate, zone); | 581 AstNumberingVisitor visitor(isolate, zone); |
580 return visitor.Renumber(function); | 582 return visitor.Renumber(function); |
581 } | 583 } |
582 } // namespace internal | 584 } // namespace internal |
583 } // namespace v8 | 585 } // namespace v8 |
OLD | NEW |