| 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 // TODO(jkummerow): use constant instead of "4". |
| 612 receiver_types_ = new ZoneMapList(4); |
| 613 oracle->CollectKeyedReceiverTypes(this->id(), receiver_types_); |
| 610 } | 614 } |
| 611 } | 615 } |
| 612 | 616 |
| 613 | 617 |
| 614 void Assignment::RecordTypeFeedback(TypeFeedbackOracle* oracle) { | 618 void Assignment::RecordTypeFeedback(TypeFeedbackOracle* oracle) { |
| 615 Property* prop = target()->AsProperty(); | 619 Property* prop = target()->AsProperty(); |
| 616 ASSERT(prop != NULL); | 620 ASSERT(prop != NULL); |
| 617 is_monomorphic_ = oracle->StoreIsMonomorphicNormal(this); | 621 is_monomorphic_ = oracle->StoreIsMonomorphicNormal(this); |
| 618 if (prop->key()->IsPropertyName()) { | 622 if (prop->key()->IsPropertyName()) { |
| 619 Literal* lit_key = prop->key()->AsLiteral(); | 623 Literal* lit_key = prop->key()->AsLiteral(); |
| 620 ASSERT(lit_key != NULL && lit_key->handle()->IsString()); | 624 ASSERT(lit_key != NULL && lit_key->handle()->IsString()); |
| 621 Handle<String> name = Handle<String>::cast(lit_key->handle()); | 625 Handle<String> name = Handle<String>::cast(lit_key->handle()); |
| 622 ZoneMapList* types = oracle->StoreReceiverTypes(this, name); | 626 ZoneMapList* types = oracle->StoreReceiverTypes(this, name); |
| 623 receiver_types_ = types; | 627 receiver_types_ = types; |
| 624 } else if (is_monomorphic_) { | 628 } else if (is_monomorphic_) { |
| 625 // Record receiver type for monomorphic keyed loads. | 629 // Record receiver type for monomorphic keyed stores. |
| 626 monomorphic_receiver_type_ = oracle->StoreMonomorphicReceiverType(this); | 630 monomorphic_receiver_type_ = oracle->StoreMonomorphicReceiverType(this); |
| 631 } else if (oracle->StoreIsMegamorphicWithTypeInfo(this)) { |
| 632 // TODO(jkummerow): use constant instead of "4". |
| 633 receiver_types_ = new ZoneMapList(4); |
| 634 oracle->CollectKeyedReceiverTypes(this->id(), receiver_types_); |
| 627 } | 635 } |
| 628 } | 636 } |
| 629 | 637 |
| 630 | 638 |
| 631 void CountOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) { | 639 void CountOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) { |
| 632 is_monomorphic_ = oracle->StoreIsMonomorphicNormal(this); | 640 is_monomorphic_ = oracle->StoreIsMonomorphicNormal(this); |
| 633 if (is_monomorphic_) { | 641 if (is_monomorphic_) { |
| 634 // Record receiver type for monomorphic keyed loads. | 642 // Record receiver type for monomorphic keyed stores. |
| 635 monomorphic_receiver_type_ = oracle->StoreMonomorphicReceiverType(this); | 643 monomorphic_receiver_type_ = oracle->StoreMonomorphicReceiverType(this); |
| 644 } else if (oracle->StoreIsMegamorphicWithTypeInfo(this)) { |
| 645 // TODO(jkummerow): use constant instead of "4". |
| 646 receiver_types_ = new ZoneMapList(4); |
| 647 oracle->CollectKeyedReceiverTypes(this->id(), receiver_types_); |
| 636 } | 648 } |
| 637 } | 649 } |
| 638 | 650 |
| 639 | 651 |
| 640 void CaseClause::RecordTypeFeedback(TypeFeedbackOracle* oracle) { | 652 void CaseClause::RecordTypeFeedback(TypeFeedbackOracle* oracle) { |
| 641 TypeInfo info = oracle->SwitchType(this); | 653 TypeInfo info = oracle->SwitchType(this); |
| 642 if (info.IsSmi()) { | 654 if (info.IsSmi()) { |
| 643 compare_type_ = SMI_ONLY; | 655 compare_type_ = SMI_ONLY; |
| 644 } else if (info.IsNonPrimitive()) { | 656 } else if (info.IsNonPrimitive()) { |
| 645 compare_type_ = OBJECT_ONLY; | 657 compare_type_ = OBJECT_ONLY; |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1133 int pos) | 1145 int pos) |
| 1134 : label_(label), | 1146 : label_(label), |
| 1135 statements_(statements), | 1147 statements_(statements), |
| 1136 position_(pos), | 1148 position_(pos), |
| 1137 compare_type_(NONE), | 1149 compare_type_(NONE), |
| 1138 compare_id_(AstNode::GetNextId()), | 1150 compare_id_(AstNode::GetNextId()), |
| 1139 entry_id_(AstNode::GetNextId()) { | 1151 entry_id_(AstNode::GetNextId()) { |
| 1140 } | 1152 } |
| 1141 | 1153 |
| 1142 } } // namespace v8::internal | 1154 } } // namespace v8::internal |
| OLD | NEW |