Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: src/ast.cc

Issue 14142005: Implement Polymorphic Store ICs (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 receiver_types_.Clear(); 496 receiver_types_.Clear();
497 if (prop->key()->IsPropertyName()) { 497 if (prop->key()->IsPropertyName()) {
498 Literal* lit_key = prop->key()->AsLiteral(); 498 Literal* lit_key = prop->key()->AsLiteral();
499 ASSERT(lit_key != NULL && lit_key->value()->IsString()); 499 ASSERT(lit_key != NULL && lit_key->value()->IsString());
500 Handle<String> name = Handle<String>::cast(lit_key->value()); 500 Handle<String> name = Handle<String>::cast(lit_key->value());
501 oracle->StoreReceiverTypes(this, name, &receiver_types_); 501 oracle->StoreReceiverTypes(this, name, &receiver_types_);
502 } else if (is_monomorphic_) { 502 } else if (is_monomorphic_) {
503 // Record receiver type for monomorphic keyed stores. 503 // Record receiver type for monomorphic keyed stores.
504 receiver_types_.Add(oracle->StoreMonomorphicReceiverType(id), zone); 504 receiver_types_.Add(oracle->StoreMonomorphicReceiverType(id), zone);
505 store_mode_ = oracle->GetStoreMode(id); 505 store_mode_ = oracle->GetStoreMode(id);
506 } else if (oracle->StoreIsPolymorphic(id)) { 506 } else if (oracle->StoreIsKeyedPolymorphic(id)) {
507 receiver_types_.Reserve(kMaxKeyedPolymorphism, zone); 507 receiver_types_.Reserve(kMaxKeyedPolymorphism, zone);
508 oracle->CollectKeyedReceiverTypes(id, &receiver_types_); 508 oracle->CollectKeyedReceiverTypes(id, &receiver_types_);
509 store_mode_ = oracle->GetStoreMode(id); 509 store_mode_ = oracle->GetStoreMode(id);
510 } 510 }
511 } 511 }
512 512
513 513
514 void CountOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle, 514 void CountOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle,
515 Zone* zone) { 515 Zone* zone) {
516 TypeFeedbackId id = CountStoreFeedbackId(); 516 TypeFeedbackId id = CountStoreFeedbackId();
517 is_monomorphic_ = oracle->StoreIsMonomorphicNormal(id); 517 is_monomorphic_ = oracle->StoreIsMonomorphicNormal(id);
518 receiver_types_.Clear(); 518 receiver_types_.Clear();
519 if (is_monomorphic_) { 519 if (is_monomorphic_) {
520 // Record receiver type for monomorphic keyed stores. 520 // Record receiver type for monomorphic keyed stores.
521 receiver_types_.Add( 521 receiver_types_.Add(
522 oracle->StoreMonomorphicReceiverType(id), zone); 522 oracle->StoreMonomorphicReceiverType(id), zone);
523 } else if (oracle->StoreIsPolymorphic(id)) { 523 } else if (oracle->StoreIsKeyedPolymorphic(id)) {
524 receiver_types_.Reserve(kMaxKeyedPolymorphism, zone); 524 receiver_types_.Reserve(kMaxKeyedPolymorphism, zone);
525 oracle->CollectKeyedReceiverTypes(id, &receiver_types_); 525 oracle->CollectKeyedReceiverTypes(id, &receiver_types_);
526 } else {
527 oracle->CollectPolymorphicStoreReceiverTypes(id, &receiver_types_);
526 } 528 }
527 store_mode_ = oracle->GetStoreMode(id); 529 store_mode_ = oracle->GetStoreMode(id);
528 type_ = oracle->IncrementType(this); 530 type_ = oracle->IncrementType(this);
529 } 531 }
530 532
531 533
532 void CaseClause::RecordTypeFeedback(TypeFeedbackOracle* oracle) { 534 void CaseClause::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
533 compare_type_ = oracle->ClauseType(CompareId()); 535 compare_type_ = oracle->ClauseType(CompareId());
534 } 536 }
535 537
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
1185 OS::SNPrintF(buffer, "%d", Smi::cast(*value_)->value()); 1187 OS::SNPrintF(buffer, "%d", Smi::cast(*value_)->value());
1186 str = arr; 1188 str = arr;
1187 } else { 1189 } else {
1188 str = DoubleToCString(value_->Number(), buffer); 1190 str = DoubleToCString(value_->Number(), buffer);
1189 } 1191 }
1190 return factory->NewStringFromAscii(CStrVector(str)); 1192 return factory->NewStringFromAscii(CStrVector(str));
1191 } 1193 }
1192 1194
1193 1195
1194 } } // namespace v8::internal 1196 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698