Index: src/type-info.cc |
diff --git a/src/type-info.cc b/src/type-info.cc |
index 59850c7fc53ca751f755c6524b0ffe496f7bc417..02b1a1b54e211e18c4b4e2175433c3c5a56ccd84 100644 |
--- a/src/type-info.cc |
+++ b/src/type-info.cc |
@@ -99,8 +99,8 @@ Handle<Cell> TypeFeedbackOracle::GetInfoCell( |
} |
-bool TypeFeedbackOracle::LoadIsUninitialized(Property* expr) { |
- Handle<Object> map_or_code = GetInfo(expr->PropertyFeedbackId()); |
+bool TypeFeedbackOracle::LoadIsUninitialized(TypeFeedbackId id) { |
+ Handle<Object> map_or_code = GetInfo(id); |
if (map_or_code->IsMap()) return false; |
if (map_or_code->IsCode()) { |
Handle<Code> code = Handle<Code>::cast(map_or_code); |
@@ -110,8 +110,8 @@ bool TypeFeedbackOracle::LoadIsUninitialized(Property* expr) { |
} |
-bool TypeFeedbackOracle::LoadIsMonomorphicNormal(Property* expr) { |
- Handle<Object> map_or_code = GetInfo(expr->PropertyFeedbackId()); |
+bool TypeFeedbackOracle::LoadIsMonomorphicNormal(TypeFeedbackId id) { |
+ Handle<Object> map_or_code = GetInfo(id); |
if (map_or_code->IsMap()) return true; |
if (map_or_code->IsCode()) { |
Handle<Code> code = Handle<Code>::cast(map_or_code); |
@@ -128,8 +128,8 @@ bool TypeFeedbackOracle::LoadIsMonomorphicNormal(Property* expr) { |
} |
-bool TypeFeedbackOracle::LoadIsPreMonomorphic(Property* expr) { |
- Handle<Object> map_or_code = GetInfo(expr->PropertyFeedbackId()); |
+bool TypeFeedbackOracle::LoadIsPreMonomorphic(TypeFeedbackId id) { |
+ Handle<Object> map_or_code = GetInfo(id); |
if (map_or_code->IsCode()) { |
Handle<Code> code = Handle<Code>::cast(map_or_code); |
return code->is_inline_cache_stub() && code->ic_state() == PREMONOMORPHIC; |
@@ -138,8 +138,8 @@ bool TypeFeedbackOracle::LoadIsPreMonomorphic(Property* expr) { |
} |
-bool TypeFeedbackOracle::LoadIsPolymorphic(Property* expr) { |
- Handle<Object> map_or_code = GetInfo(expr->PropertyFeedbackId()); |
+bool TypeFeedbackOracle::LoadIsPolymorphic(TypeFeedbackId id) { |
+ Handle<Object> map_or_code = GetInfo(id); |
if (map_or_code->IsCode()) { |
Handle<Code> code = Handle<Code>::cast(map_or_code); |
return code->is_keyed_load_stub() && code->ic_state() == POLYMORPHIC; |
@@ -233,9 +233,9 @@ byte TypeFeedbackOracle::ForInType(TypeFeedbackId id) { |
} |
-Handle<Map> TypeFeedbackOracle::LoadMonomorphicReceiverType(Property* expr) { |
- ASSERT(LoadIsMonomorphicNormal(expr)); |
- Handle<Object> map_or_code = GetInfo(expr->PropertyFeedbackId()); |
+Handle<Map> TypeFeedbackOracle::LoadMonomorphicReceiverType(TypeFeedbackId id) { |
+ ASSERT(LoadIsMonomorphicNormal(id)); |
+ Handle<Object> map_or_code = GetInfo(id); |
if (map_or_code->IsCode()) { |
Handle<Code> code = Handle<Code>::cast(map_or_code); |
Map* map = code->FindFirstMap()->CurrentMapForDeprecated(); |
@@ -275,13 +275,13 @@ KeyedAccessStoreMode TypeFeedbackOracle::GetStoreMode( |
} |
-void TypeFeedbackOracle::LoadReceiverTypes(Property* expr, |
+void TypeFeedbackOracle::LoadReceiverTypes(TypeFeedbackId id, |
Handle<String> name, |
SmallMapList* types) { |
Code::Flags flags = Code::ComputeFlags( |
Code::HANDLER, MONOMORPHIC, Code::kNoExtraICState, |
Code::NORMAL, Code::LOAD_IC); |
- CollectReceiverTypes(expr->PropertyFeedbackId(), name, flags, types); |
+ CollectReceiverTypes(id, name, flags, types); |
} |
@@ -353,14 +353,14 @@ Handle<Map> TypeFeedbackOracle::GetObjectLiteralStoreMap( |
} |
-bool TypeFeedbackOracle::LoadIsBuiltin(Property* expr, Builtins::Name id) { |
- return *GetInfo(expr->PropertyFeedbackId()) == |
- isolate_->builtins()->builtin(id); |
+bool TypeFeedbackOracle::LoadIsBuiltin( |
+ TypeFeedbackId id, Builtins::Name builtin) { |
+ return *GetInfo(id) == isolate_->builtins()->builtin(builtin); |
} |
-bool TypeFeedbackOracle::LoadIsStub(Property* expr, ICStub* stub) { |
- Handle<Object> object = GetInfo(expr->PropertyFeedbackId()); |
+bool TypeFeedbackOracle::LoadIsStub(TypeFeedbackId id, ICStub* stub) { |
+ Handle<Object> object = GetInfo(id); |
if (!object->IsCode()) return false; |
Handle<Code> code = Handle<Code>::cast(object); |
if (!code->is_load_stub()) return false; |
@@ -456,6 +456,33 @@ Handle<Type> TypeFeedbackOracle::CountType(TypeFeedbackId id) { |
} |
+void TypeFeedbackOracle::PropertyReceiverTypes( |
+ TypeFeedbackId id, Handle<String> name, |
+ SmallMapList* receiver_types, bool* is_prototype) { |
+ receiver_types->Clear(); |
+ FunctionPrototypeStub proto_stub(Code::LOAD_IC); |
+ *is_prototype = LoadIsStub(id, &proto_stub); |
+ if (!*is_prototype) { |
+ LoadReceiverTypes(id, name, receiver_types); |
+ } |
+} |
+ |
+ |
+void TypeFeedbackOracle::KeyedPropertyReceiverTypes( |
+ TypeFeedbackId id, SmallMapList* receiver_types, bool* is_string) { |
+ receiver_types->Clear(); |
+ *is_string = false; |
+ if (LoadIsBuiltin(id, Builtins::kKeyedLoadIC_String)) { |
+ *is_string = true; |
+ } else if (LoadIsMonomorphicNormal(id)) { |
+ receiver_types->Add(LoadMonomorphicReceiverType(id), zone()); |
+ } else if (LoadIsPolymorphic(id)) { |
+ receiver_types->Reserve(kMaxKeyedPolymorphism, zone()); |
+ CollectKeyedReceiverTypes(id, receiver_types); |
+ } |
+} |
+ |
+ |
void TypeFeedbackOracle::CountReceiverTypes( |
TypeFeedbackId id, SmallMapList* receiver_types) { |
receiver_types->Clear(); |