| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 oracle->StoreMonomorphicReceiverType(id), zone); | 469 oracle->StoreMonomorphicReceiverType(id), zone); |
| 470 } else if (oracle->StoreIsMegamorphicWithTypeInfo(id)) { | 470 } else if (oracle->StoreIsMegamorphicWithTypeInfo(id)) { |
| 471 receiver_types_.Reserve(kMaxKeyedPolymorphism, zone); | 471 receiver_types_.Reserve(kMaxKeyedPolymorphism, zone); |
| 472 oracle->CollectKeyedReceiverTypes(id, &receiver_types_); | 472 oracle->CollectKeyedReceiverTypes(id, &receiver_types_); |
| 473 } | 473 } |
| 474 } | 474 } |
| 475 | 475 |
| 476 | 476 |
| 477 void CaseClause::RecordTypeFeedback(TypeFeedbackOracle* oracle) { | 477 void CaseClause::RecordTypeFeedback(TypeFeedbackOracle* oracle) { |
| 478 TypeInfo info = oracle->SwitchType(this); | 478 TypeInfo info = oracle->SwitchType(this); |
| 479 if (info.IsUninitialized()) info = TypeInfo::Unknown(); |
| 479 if (info.IsSmi()) { | 480 if (info.IsSmi()) { |
| 480 compare_type_ = SMI_ONLY; | 481 compare_type_ = SMI_ONLY; |
| 481 } else if (info.IsSymbol()) { | 482 } else if (info.IsSymbol()) { |
| 482 compare_type_ = SYMBOL_ONLY; | 483 compare_type_ = SYMBOL_ONLY; |
| 483 } else if (info.IsNonSymbol()) { | 484 } else if (info.IsNonSymbol()) { |
| 484 compare_type_ = STRING_ONLY; | 485 compare_type_ = STRING_ONLY; |
| 485 } else if (info.IsNonPrimitive()) { | 486 } else if (info.IsNonPrimitive()) { |
| 486 compare_type_ = OBJECT_ONLY; | 487 compare_type_ = OBJECT_ONLY; |
| 487 } else { | 488 } else { |
| 488 ASSERT(compare_type_ == NONE); | 489 ASSERT(compare_type_ == NONE); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 | 598 |
| 598 | 599 |
| 599 void CallNew::RecordTypeFeedback(TypeFeedbackOracle* oracle) { | 600 void CallNew::RecordTypeFeedback(TypeFeedbackOracle* oracle) { |
| 600 is_monomorphic_ = oracle->CallNewIsMonomorphic(this); | 601 is_monomorphic_ = oracle->CallNewIsMonomorphic(this); |
| 601 if (is_monomorphic_) { | 602 if (is_monomorphic_) { |
| 602 target_ = oracle->GetCallNewTarget(this); | 603 target_ = oracle->GetCallNewTarget(this); |
| 603 } | 604 } |
| 604 } | 605 } |
| 605 | 606 |
| 606 | 607 |
| 607 void CompareOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) { | |
| 608 TypeInfo info = oracle->CompareType(this); | |
| 609 if (info.IsSmi()) { | |
| 610 compare_type_ = SMI_ONLY; | |
| 611 } else if (info.IsNonPrimitive()) { | |
| 612 compare_type_ = OBJECT_ONLY; | |
| 613 } else { | |
| 614 ASSERT(compare_type_ == NONE); | |
| 615 } | |
| 616 } | |
| 617 | |
| 618 | |
| 619 void ObjectLiteral::Property::RecordTypeFeedback(TypeFeedbackOracle* oracle) { | 608 void ObjectLiteral::Property::RecordTypeFeedback(TypeFeedbackOracle* oracle) { |
| 620 receiver_type_ = oracle->ObjectLiteralStoreIsMonomorphic(this) | 609 receiver_type_ = oracle->ObjectLiteralStoreIsMonomorphic(this) |
| 621 ? oracle->GetObjectLiteralStoreMap(this) | 610 ? oracle->GetObjectLiteralStoreMap(this) |
| 622 : Handle<Map>::null(); | 611 : Handle<Map>::null(); |
| 623 } | 612 } |
| 624 | 613 |
| 625 | 614 |
| 626 // ---------------------------------------------------------------------------- | 615 // ---------------------------------------------------------------------------- |
| 627 // Implementation of AstVisitor | 616 // Implementation of AstVisitor |
| 628 | 617 |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1130 OS::SNPrintF(buffer, "%d", Smi::cast(*handle_)->value()); | 1119 OS::SNPrintF(buffer, "%d", Smi::cast(*handle_)->value()); |
| 1131 str = arr; | 1120 str = arr; |
| 1132 } else { | 1121 } else { |
| 1133 str = DoubleToCString(handle_->Number(), buffer); | 1122 str = DoubleToCString(handle_->Number(), buffer); |
| 1134 } | 1123 } |
| 1135 return FACTORY->NewStringFromAscii(CStrVector(str)); | 1124 return FACTORY->NewStringFromAscii(CStrVector(str)); |
| 1136 } | 1125 } |
| 1137 | 1126 |
| 1138 | 1127 |
| 1139 } } // namespace v8::internal | 1128 } } // namespace v8::internal |
| OLD | NEW |