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

Unified Diff: src/type-info.cc

Issue 12340112: Polymorphism support for load IC. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: src/type-info.cc
diff --git a/src/type-info.cc b/src/type-info.cc
index 1acd8c63b1f09594ae03c9bcdc866715802cfadd..12f8de69b109f5925c6444f24f6478181930780e 100644
--- a/src/type-info.cc
+++ b/src/type-info.cc
@@ -308,6 +308,7 @@ bool TypeFeedbackOracle::LoadIsStub(Property* expr, ICStub* stub) {
if (!object->IsCode()) return false;
Handle<Code> code = Handle<Code>::cast(object);
if (!code->is_load_stub()) return false;
+ if (code->ic_state() != MONOMORPHIC) return false;
return stub->Describes(*code);
}
@@ -497,6 +498,13 @@ void TypeFeedbackOracle::CollectReceiverTypes(TypeFeedbackId ast_id,
ASSERT(Handle<Code>::cast(object)->ic_state() == GENERIC);
} else if (object->IsMap()) {
types->Add(Handle<Map>::cast(object), zone());
+ } else if (Handle<Code>::cast(object)->ic_state() == POLYMORPHIC) {
+ MapHandleList maps;
+ Handle<Code>::cast(object)->FindAllMaps(&maps);
+ types->Reserve(maps.length(), zone());
+ for (int i = 0; i < maps.length(); i++) {
+ types->Add(maps.at(i), zone());
Jakob Kummerow 2013/03/01 22:21:04 Please compare this with CollectKeyedReceiverTypes
Toon Verwaest 2013/03/04 10:54:08 Done.
+ }
} else if (FLAG_collect_megamorphic_maps_from_stub_cache &&
Handle<Code>::cast(object)->ic_state() == MEGAMORPHIC) {
types->Reserve(4, zone());
« src/stub-cache.cc ('K') | « src/stub-cache.cc ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698