Index: src/types.h |
diff --git a/src/types.h b/src/types.h |
index 18b22239a2dd30cf435de75babe2cfe99ed05b6e..8caba7a52794eeca2fe97ec70456c852866a4fc2 100644 |
--- a/src/types.h |
+++ b/src/types.h |
@@ -271,7 +271,17 @@ class TypeImpl : public Config::Base { |
bool NowIs(TypeImpl* that); |
template<class TypeHandle> |
bool NowIs(TypeHandle that) { return this->NowIs(*that); } |
- bool NowContains(i::Object* val); |
+ bool NowContains(i::Object* val) { |
rossberg
2014/04/11 09:19:37
Can we move that to types-inl?
Benedikt Meurer
2014/04/11 09:23:30
Done.
|
+ DisallowHeapAllocation no_allocation; |
+ if (this->IsAny()) return true; |
+ if (val->IsHeapObject()) { |
+ i::Map* map = i::HeapObject::cast(val)->map(); |
+ for (Iterator<i::Map> it = this->Classes(); !it.Done(); it.Advance()) { |
+ if (*it.Current() == map) return true; |
+ } |
+ } |
+ return this->Contains(val); |
+ } |
bool NowContains(i::Handle<i::Object> val) { return this->NowContains(*val); } |
bool IsClass() { return Config::is_class(this); } |