Index: src/types.h |
diff --git a/src/types.h b/src/types.h |
index 2e21a9e7b8422a19213414a5934df632d38c8bf0..f929a6cde41e868eed8307057db6fc96c46f1c32 100644 |
--- a/src/types.h |
+++ b/src/types.h |
@@ -163,6 +163,15 @@ class Type : public Object { |
bool Is(Type* that) { return (this == that) ? true : SlowIs(that); } |
bool Is(Handle<Type> that) { return this->Is(*that); } |
+ bool IsCurrently(Type* that) { |
+ if (this->Is(that)) return true; |
+ if (!IsConstant()) return false; |
+ Handle<i::Object> value = AsConstant(); |
+ if (!value->IsHeapObject()) return false; |
+ if (!that->IsClass()) return false; |
+ return HeapObject::cast(*value)->map() == *that->AsClass(); |
+ } |
+ bool IsCurrently(Handle<Type> that) { return this->IsCurrently(*that); } |
bool Maybe(Type* that); |
bool Maybe(Handle<Type> that) { return this->Maybe(*that); } |