OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 Literal* lit_key = key()->AsLiteral(); | 600 Literal* lit_key = key()->AsLiteral(); |
601 ASSERT(lit_key != NULL && lit_key->handle()->IsString()); | 601 ASSERT(lit_key != NULL && lit_key->handle()->IsString()); |
602 Handle<String> name = Handle<String>::cast(lit_key->handle()); | 602 Handle<String> name = Handle<String>::cast(lit_key->handle()); |
603 ZoneMapList* types = oracle->LoadReceiverTypes(this, name); | 603 ZoneMapList* types = oracle->LoadReceiverTypes(this, name); |
604 receiver_types_ = types; | 604 receiver_types_ = types; |
605 } | 605 } |
606 } else if (oracle->LoadIsBuiltin(this, Builtins::kKeyedLoadIC_String)) { | 606 } else if (oracle->LoadIsBuiltin(this, Builtins::kKeyedLoadIC_String)) { |
607 is_string_access_ = true; | 607 is_string_access_ = true; |
608 } else if (is_monomorphic_) { | 608 } else if (is_monomorphic_) { |
609 monomorphic_receiver_type_ = oracle->LoadMonomorphicReceiverType(this); | 609 monomorphic_receiver_type_ = oracle->LoadMonomorphicReceiverType(this); |
| 610 } else if (oracle->LoadIsMegamorphicWithTypeInfo(this)) { |
| 611 receiver_types_ = new ZoneMapList(kMaxKeyedPolymorphism); |
| 612 oracle->CollectKeyedReceiverTypes(this->id(), receiver_types_); |
610 } | 613 } |
611 } | 614 } |
612 | 615 |
613 | 616 |
614 void Assignment::RecordTypeFeedback(TypeFeedbackOracle* oracle) { | 617 void Assignment::RecordTypeFeedback(TypeFeedbackOracle* oracle) { |
615 Property* prop = target()->AsProperty(); | 618 Property* prop = target()->AsProperty(); |
616 ASSERT(prop != NULL); | 619 ASSERT(prop != NULL); |
617 is_monomorphic_ = oracle->StoreIsMonomorphicNormal(this); | 620 is_monomorphic_ = oracle->StoreIsMonomorphicNormal(this); |
618 if (prop->key()->IsPropertyName()) { | 621 if (prop->key()->IsPropertyName()) { |
619 Literal* lit_key = prop->key()->AsLiteral(); | 622 Literal* lit_key = prop->key()->AsLiteral(); |
620 ASSERT(lit_key != NULL && lit_key->handle()->IsString()); | 623 ASSERT(lit_key != NULL && lit_key->handle()->IsString()); |
621 Handle<String> name = Handle<String>::cast(lit_key->handle()); | 624 Handle<String> name = Handle<String>::cast(lit_key->handle()); |
622 ZoneMapList* types = oracle->StoreReceiverTypes(this, name); | 625 ZoneMapList* types = oracle->StoreReceiverTypes(this, name); |
623 receiver_types_ = types; | 626 receiver_types_ = types; |
624 } else if (is_monomorphic_) { | 627 } else if (is_monomorphic_) { |
625 // Record receiver type for monomorphic keyed loads. | 628 // Record receiver type for monomorphic keyed stores. |
626 monomorphic_receiver_type_ = oracle->StoreMonomorphicReceiverType(this); | 629 monomorphic_receiver_type_ = oracle->StoreMonomorphicReceiverType(this); |
| 630 } else if (oracle->StoreIsMegamorphicWithTypeInfo(this)) { |
| 631 receiver_types_ = new ZoneMapList(kMaxKeyedPolymorphism); |
| 632 oracle->CollectKeyedReceiverTypes(this->id(), receiver_types_); |
627 } | 633 } |
628 } | 634 } |
629 | 635 |
630 | 636 |
631 void CountOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) { | 637 void CountOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) { |
632 is_monomorphic_ = oracle->StoreIsMonomorphicNormal(this); | 638 is_monomorphic_ = oracle->StoreIsMonomorphicNormal(this); |
633 if (is_monomorphic_) { | 639 if (is_monomorphic_) { |
634 // Record receiver type for monomorphic keyed loads. | 640 // Record receiver type for monomorphic keyed stores. |
635 monomorphic_receiver_type_ = oracle->StoreMonomorphicReceiverType(this); | 641 monomorphic_receiver_type_ = oracle->StoreMonomorphicReceiverType(this); |
| 642 } else if (oracle->StoreIsMegamorphicWithTypeInfo(this)) { |
| 643 receiver_types_ = new ZoneMapList(kMaxKeyedPolymorphism); |
| 644 oracle->CollectKeyedReceiverTypes(this->id(), receiver_types_); |
636 } | 645 } |
637 } | 646 } |
638 | 647 |
639 | 648 |
640 void CaseClause::RecordTypeFeedback(TypeFeedbackOracle* oracle) { | 649 void CaseClause::RecordTypeFeedback(TypeFeedbackOracle* oracle) { |
641 TypeInfo info = oracle->SwitchType(this); | 650 TypeInfo info = oracle->SwitchType(this); |
642 if (info.IsSmi()) { | 651 if (info.IsSmi()) { |
643 compare_type_ = SMI_ONLY; | 652 compare_type_ = SMI_ONLY; |
644 } else if (info.IsNonPrimitive()) { | 653 } else if (info.IsNonPrimitive()) { |
645 compare_type_ = OBJECT_ONLY; | 654 compare_type_ = OBJECT_ONLY; |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1133 int pos) | 1142 int pos) |
1134 : label_(label), | 1143 : label_(label), |
1135 statements_(statements), | 1144 statements_(statements), |
1136 position_(pos), | 1145 position_(pos), |
1137 compare_type_(NONE), | 1146 compare_type_(NONE), |
1138 compare_id_(AstNode::GetNextId()), | 1147 compare_id_(AstNode::GetNextId()), |
1139 entry_id_(AstNode::GetNextId()) { | 1148 entry_id_(AstNode::GetNextId()) { |
1140 } | 1149 } |
1141 | 1150 |
1142 } } // namespace v8::internal | 1151 } } // namespace v8::internal |
OLD | NEW |