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