OLD | NEW |
1 // Copyright 2010 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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 ASSERT(lit_key != NULL && lit_key->handle()->IsString()); | 539 ASSERT(lit_key != NULL && lit_key->handle()->IsString()); |
540 Handle<String> name = Handle<String>::cast(lit_key->handle()); | 540 Handle<String> name = Handle<String>::cast(lit_key->handle()); |
541 ZoneMapList* types = oracle->LoadReceiverTypes(this, name); | 541 ZoneMapList* types = oracle->LoadReceiverTypes(this, name); |
542 receiver_types_ = types; | 542 receiver_types_ = types; |
543 } | 543 } |
544 } else if (oracle->LoadIsBuiltin(this, Builtins::kKeyedLoadIC_String)) { | 544 } else if (oracle->LoadIsBuiltin(this, Builtins::kKeyedLoadIC_String)) { |
545 is_string_access_ = true; | 545 is_string_access_ = true; |
546 } else if (is_monomorphic_) { | 546 } else if (is_monomorphic_) { |
547 monomorphic_receiver_type_ = oracle->LoadMonomorphicReceiverType(this); | 547 monomorphic_receiver_type_ = oracle->LoadMonomorphicReceiverType(this); |
548 if (monomorphic_receiver_type_->has_external_array_elements()) { | 548 if (monomorphic_receiver_type_->has_external_array_elements()) { |
549 SetExternalArrayType(oracle->GetKeyedLoadExternalArrayType(this)); | 549 set_external_array_type(oracle->GetKeyedLoadExternalArrayType(this)); |
550 } | 550 } |
551 } | 551 } |
552 } | 552 } |
553 | 553 |
554 | 554 |
555 void Assignment::RecordTypeFeedback(TypeFeedbackOracle* oracle) { | 555 void Assignment::RecordTypeFeedback(TypeFeedbackOracle* oracle) { |
556 Property* prop = target()->AsProperty(); | 556 Property* prop = target()->AsProperty(); |
557 ASSERT(prop != NULL); | 557 ASSERT(prop != NULL); |
558 is_monomorphic_ = oracle->StoreIsMonomorphic(this); | 558 is_monomorphic_ = oracle->StoreIsMonomorphic(this); |
559 if (prop->key()->IsPropertyName()) { | 559 if (prop->key()->IsPropertyName()) { |
560 Literal* lit_key = prop->key()->AsLiteral(); | 560 Literal* lit_key = prop->key()->AsLiteral(); |
561 ASSERT(lit_key != NULL && lit_key->handle()->IsString()); | 561 ASSERT(lit_key != NULL && lit_key->handle()->IsString()); |
562 Handle<String> name = Handle<String>::cast(lit_key->handle()); | 562 Handle<String> name = Handle<String>::cast(lit_key->handle()); |
563 ZoneMapList* types = oracle->StoreReceiverTypes(this, name); | 563 ZoneMapList* types = oracle->StoreReceiverTypes(this, name); |
564 receiver_types_ = types; | 564 receiver_types_ = types; |
565 } else if (is_monomorphic_) { | 565 } else if (is_monomorphic_) { |
566 // Record receiver type for monomorphic keyed loads. | 566 // Record receiver type for monomorphic keyed loads. |
567 monomorphic_receiver_type_ = oracle->StoreMonomorphicReceiverType(this); | 567 monomorphic_receiver_type_ = oracle->StoreMonomorphicReceiverType(this); |
568 if (monomorphic_receiver_type_->has_external_array_elements()) { | 568 if (monomorphic_receiver_type_->has_external_array_elements()) { |
569 SetExternalArrayType(oracle->GetKeyedStoreExternalArrayType(this)); | 569 set_external_array_type(oracle->GetKeyedStoreExternalArrayType(this)); |
570 } | 570 } |
571 } | 571 } |
572 } | 572 } |
| 573 |
| 574 |
| 575 void CountOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) { |
| 576 is_monomorphic_ = oracle->StoreIsMonomorphic(this); |
| 577 if (is_monomorphic_) { |
| 578 // Record receiver type for monomorphic keyed loads. |
| 579 monomorphic_receiver_type_ = oracle->StoreMonomorphicReceiverType(this); |
| 580 if (monomorphic_receiver_type_->has_external_array_elements()) { |
| 581 set_external_array_type(oracle->GetKeyedStoreExternalArrayType(this)); |
| 582 } |
| 583 } |
| 584 } |
573 | 585 |
574 | 586 |
575 void CaseClause::RecordTypeFeedback(TypeFeedbackOracle* oracle) { | 587 void CaseClause::RecordTypeFeedback(TypeFeedbackOracle* oracle) { |
576 TypeInfo info = oracle->SwitchType(this); | 588 TypeInfo info = oracle->SwitchType(this); |
577 if (info.IsSmi()) { | 589 if (info.IsSmi()) { |
578 compare_type_ = SMI_ONLY; | 590 compare_type_ = SMI_ONLY; |
579 } else if (info.IsNonPrimitive()) { | 591 } else if (info.IsNonPrimitive()) { |
580 compare_type_ = OBJECT_ONLY; | 592 compare_type_ = OBJECT_ONLY; |
581 } else { | 593 } else { |
582 ASSERT(compare_type_ == NONE); | 594 ASSERT(compare_type_ == NONE); |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 ZoneList<Statement*>* statements, | 1081 ZoneList<Statement*>* statements, |
1070 int pos) | 1082 int pos) |
1071 : label_(label), | 1083 : label_(label), |
1072 statements_(statements), | 1084 statements_(statements), |
1073 position_(pos), | 1085 position_(pos), |
1074 compare_type_(NONE), | 1086 compare_type_(NONE), |
1075 entry_id_(AstNode::GetNextId()) { | 1087 entry_id_(AstNode::GetNextId()) { |
1076 } | 1088 } |
1077 | 1089 |
1078 } } // namespace v8::internal | 1090 } } // namespace v8::internal |
OLD | NEW |