Index: src/type-info.cc |
diff --git a/src/type-info.cc b/src/type-info.cc |
index 39a01f59e8d826c41f027133af064d8289a4ca55..3bc509a6189a93068ee2f50b6f0a90d9aeffef67 100644 |
--- a/src/type-info.cc |
+++ b/src/type-info.cc |
@@ -218,6 +218,17 @@ Handle<Map> TypeFeedbackOracle::StoreMonomorphicReceiverType( |
} |
+Handle<Map> TypeFeedbackOracle::CompareNilMonomorphicReceiverType( |
+ TypeFeedbackId id) { |
+ Handle<Object> maybe_code = GetInfo(id); |
+ if (maybe_code->IsCode()) { |
+ Map* first_map = Handle<Code>::cast(maybe_code)->FindFirstMap(); |
+ if (first_map != NULL) return Handle<Map>(first_map); |
+ } |
+ return Handle<Map>(); |
+} |
+ |
+ |
KeyedAccessStoreMode TypeFeedbackOracle::GetStoreMode( |
TypeFeedbackId ast_id) { |
Handle<Object> map_or_code = GetInfo(ast_id); |
@@ -625,12 +636,23 @@ void TypeFeedbackOracle::CollectKeyedReceiverTypes(TypeFeedbackId ast_id, |
} |
-byte TypeFeedbackOracle::ToBooleanTypes(TypeFeedbackId ast_id) { |
- Handle<Object> object = GetInfo(ast_id); |
+byte TypeFeedbackOracle::ToBooleanTypes(TypeFeedbackId id) { |
+ Handle<Object> object = GetInfo(id); |
return object->IsCode() ? Handle<Code>::cast(object)->to_boolean_state() : 0; |
} |
+byte TypeFeedbackOracle::CompareNilTypes(TypeFeedbackId id) { |
+ Handle<Object> object = GetInfo(id); |
+ if (object->IsCode() && |
+ Handle<Code>::cast(object)->is_compare_nil_ic_stub()) { |
+ return Handle<Code>::cast(object)->compare_nil_state(); |
+ } else { |
+ return CompareNilICStub::kFullCompare; |
+ } |
+} |
+ |
+ |
// Things are a bit tricky here: The iterator for the RelocInfos and the infos |
// themselves are not GC-safe, so we first get all infos, then we create the |
// dictionary (possibly triggering GC), and finally we relocate the collected |
@@ -724,6 +746,7 @@ void TypeFeedbackOracle::ProcessRelocInfos(ZoneList<RelocInfo>* infos) { |
case Code::BINARY_OP_IC: |
case Code::COMPARE_IC: |
case Code::TO_BOOLEAN_IC: |
+ case Code::COMPARE_NIL_IC: |
SetInfo(ast_id, target); |
break; |