Index: src/types.cc |
diff --git a/src/types.cc b/src/types.cc |
index 7c54d4fb27e7db94b06c1726a9e07678bc8ead80..485ba885187364ed2b99098865eec3197b2c47dc 100644 |
--- a/src/types.cc |
+++ b/src/types.cc |
@@ -244,7 +244,7 @@ int Type::GlbBitset() { |
// Most precise _current_ type of a value (usually its class). |
-Type* Type::CurrentOf(Handle<i::Object> value) { |
+Type* Type::OfCurrently(Handle<i::Object> value) { |
if (value->IsSmi()) return Smi(); |
i::Map* map = i::HeapObject::cast(*value)->map(); |
if (map->instance_type() == HEAP_NUMBER_TYPE || |
@@ -297,6 +297,14 @@ bool Type::SlowIs(Type* that) { |
} |
+bool Type::IsCurrently(Type* that) { |
+ return this->Is(that) || |
+ (this->is_constant() && that->is_class() && |
+ this->as_constant()->IsHeapObject() && |
+ i::HeapObject::cast(*this->as_constant())->map() == *that->as_class()); |
+} |
+ |
+ |
// Check this overlaps that. |
bool Type::Maybe(Type* that) { |
// Fast path for bitsets. |