Index: src/type-info.cc |
=================================================================== |
--- src/type-info.cc (revision 10217) |
+++ src/type-info.cc (working copy) |
@@ -259,6 +259,7 @@ |
case CompareIC::STRINGS: |
return TypeInfo::String(); |
case CompareIC::OBJECTS: |
+ case CompareIC::KNOWN_OBJECTS: |
// TODO(kasperl): We really need a type for JS objects here. |
return TypeInfo::NonPrimitive(); |
case CompareIC::GENERIC: |
@@ -278,6 +279,19 @@ |
} |
+Handle<Map> TypeFeedbackOracle::GetCompareMap(CompareOperation* expr) { |
+ Handle<Object> object = GetInfo(expr->id()); |
+ if (!object->IsCode()) return Handle<Map>::null(); |
+ Handle<Code> code = Handle<Code>::cast(object); |
+ if (!code->is_compare_ic_stub()) return Handle<Map>::null(); |
+ CompareIC::State state = static_cast<CompareIC::State>(code->compare_state()); |
+ if (state != CompareIC::KNOWN_OBJECTS) { |
+ return Handle<Map>::null(); |
+ } |
+ return Handle<Map>(code->FindFirstMap()); |
+} |
+ |
+ |
TypeInfo TypeFeedbackOracle::UnaryType(UnaryOperation* expr) { |
Handle<Object> object = GetInfo(expr->id()); |
TypeInfo unknown = TypeInfo::Unknown(); |
@@ -367,6 +381,7 @@ |
case CompareIC::HEAP_NUMBERS: |
return TypeInfo::Number(); |
case CompareIC::OBJECTS: |
+ case CompareIC::KNOWN_OBJECTS: |
// TODO(kasperl): We really need a type for JS objects here. |
return TypeInfo::NonPrimitive(); |
case CompareIC::GENERIC: |