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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 Handle<String> name = Handle<String>::cast(lit_key->handle()); | 427 Handle<String> name = Handle<String>::cast(lit_key->handle()); |
428 oracle->LoadReceiverTypes(this, name, &receiver_types_); | 428 oracle->LoadReceiverTypes(this, name, &receiver_types_); |
429 } | 429 } |
430 } else if (oracle->LoadIsBuiltin(this, Builtins::kKeyedLoadIC_String)) { | 430 } else if (oracle->LoadIsBuiltin(this, Builtins::kKeyedLoadIC_String)) { |
431 is_string_access_ = true; | 431 is_string_access_ = true; |
432 } else if (is_monomorphic_) { | 432 } else if (is_monomorphic_) { |
433 receiver_types_.Add(oracle->LoadMonomorphicReceiverType(this), | 433 receiver_types_.Add(oracle->LoadMonomorphicReceiverType(this), |
434 zone); | 434 zone); |
435 } else if (oracle->LoadIsMegamorphicWithTypeInfo(this)) { | 435 } else if (oracle->LoadIsMegamorphicWithTypeInfo(this)) { |
436 receiver_types_.Reserve(kMaxKeyedPolymorphism, zone); | 436 receiver_types_.Reserve(kMaxKeyedPolymorphism, zone); |
437 oracle->CollectKeyedReceiverTypes(this->id(), &receiver_types_); | 437 oracle->CollectKeyedReceiverTypes(PropertyFeedbackId(), &receiver_types_); |
438 } | 438 } |
439 } | 439 } |
440 | 440 |
441 | 441 |
442 void Assignment::RecordTypeFeedback(TypeFeedbackOracle* oracle, | 442 void Assignment::RecordTypeFeedback(TypeFeedbackOracle* oracle, |
443 Zone* zone) { | 443 Zone* zone) { |
444 Property* prop = target()->AsProperty(); | 444 Property* prop = target()->AsProperty(); |
445 ASSERT(prop != NULL); | 445 ASSERT(prop != NULL); |
446 is_monomorphic_ = oracle->StoreIsMonomorphicNormal(this); | 446 TypeFeedbackId id = AssignmentFeedbackId(); |
| 447 is_monomorphic_ = oracle->StoreIsMonomorphicNormal(id); |
447 receiver_types_.Clear(); | 448 receiver_types_.Clear(); |
448 if (prop->key()->IsPropertyName()) { | 449 if (prop->key()->IsPropertyName()) { |
449 Literal* lit_key = prop->key()->AsLiteral(); | 450 Literal* lit_key = prop->key()->AsLiteral(); |
450 ASSERT(lit_key != NULL && lit_key->handle()->IsString()); | 451 ASSERT(lit_key != NULL && lit_key->handle()->IsString()); |
451 Handle<String> name = Handle<String>::cast(lit_key->handle()); | 452 Handle<String> name = Handle<String>::cast(lit_key->handle()); |
452 oracle->StoreReceiverTypes(this, name, &receiver_types_); | 453 oracle->StoreReceiverTypes(this, name, &receiver_types_); |
453 } else if (is_monomorphic_) { | 454 } else if (is_monomorphic_) { |
454 // Record receiver type for monomorphic keyed stores. | 455 // Record receiver type for monomorphic keyed stores. |
455 receiver_types_.Add(oracle->StoreMonomorphicReceiverType(this), zone); | 456 receiver_types_.Add(oracle->StoreMonomorphicReceiverType(id), zone); |
456 } else if (oracle->StoreIsMegamorphicWithTypeInfo(this)) { | 457 } else if (oracle->StoreIsMegamorphicWithTypeInfo(id)) { |
457 receiver_types_.Reserve(kMaxKeyedPolymorphism, zone); | 458 receiver_types_.Reserve(kMaxKeyedPolymorphism, zone); |
458 oracle->CollectKeyedReceiverTypes(this->id(), &receiver_types_); | 459 oracle->CollectKeyedReceiverTypes(id, &receiver_types_); |
459 } | 460 } |
460 } | 461 } |
461 | 462 |
462 | 463 |
463 void CountOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle, | 464 void CountOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle, |
464 Zone* zone) { | 465 Zone* zone) { |
465 is_monomorphic_ = oracle->StoreIsMonomorphicNormal(this); | 466 TypeFeedbackId id = CountStoreFeedbackId(); |
| 467 is_monomorphic_ = oracle->StoreIsMonomorphicNormal(id); |
466 receiver_types_.Clear(); | 468 receiver_types_.Clear(); |
467 if (is_monomorphic_) { | 469 if (is_monomorphic_) { |
468 // Record receiver type for monomorphic keyed stores. | 470 // Record receiver type for monomorphic keyed stores. |
469 receiver_types_.Add(oracle->StoreMonomorphicReceiverType(this), zone); | 471 receiver_types_.Add( |
470 } else if (oracle->StoreIsMegamorphicWithTypeInfo(this)) { | 472 oracle->StoreMonomorphicReceiverType(id), zone); |
| 473 } else if (oracle->StoreIsMegamorphicWithTypeInfo(id)) { |
471 receiver_types_.Reserve(kMaxKeyedPolymorphism, zone); | 474 receiver_types_.Reserve(kMaxKeyedPolymorphism, zone); |
472 oracle->CollectKeyedReceiverTypes(this->id(), &receiver_types_); | 475 oracle->CollectKeyedReceiverTypes(id, &receiver_types_); |
473 } | 476 } |
474 } | 477 } |
475 | 478 |
476 | 479 |
477 void CaseClause::RecordTypeFeedback(TypeFeedbackOracle* oracle) { | 480 void CaseClause::RecordTypeFeedback(TypeFeedbackOracle* oracle) { |
478 TypeInfo info = oracle->SwitchType(this); | 481 TypeInfo info = oracle->SwitchType(this); |
479 if (info.IsSmi()) { | 482 if (info.IsSmi()) { |
480 compare_type_ = SMI_ONLY; | 483 compare_type_ = SMI_ONLY; |
481 } else if (info.IsSymbol()) { | 484 } else if (info.IsSymbol()) { |
482 compare_type_ = SYMBOL_ONLY; | 485 compare_type_ = SYMBOL_ONLY; |
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1130 OS::SNPrintF(buffer, "%d", Smi::cast(*handle_)->value()); | 1133 OS::SNPrintF(buffer, "%d", Smi::cast(*handle_)->value()); |
1131 str = arr; | 1134 str = arr; |
1132 } else { | 1135 } else { |
1133 str = DoubleToCString(handle_->Number(), buffer); | 1136 str = DoubleToCString(handle_->Number(), buffer); |
1134 } | 1137 } |
1135 return FACTORY->NewStringFromAscii(CStrVector(str)); | 1138 return FACTORY->NewStringFromAscii(CStrVector(str)); |
1136 } | 1139 } |
1137 | 1140 |
1138 | 1141 |
1139 } } // namespace v8::internal | 1142 } } // namespace v8::internal |
OLD | NEW |