diff --git a/src/types-inl.h b/src/types-inl.h index 2c80503290..ad1107b68c 100644 --- a/src/types-inl.h +++ b/src/types-inl.h @@ -13,6 +13,20 @@ namespace v8 { namespace internal { +template +bool TypeImpl::NowContains(i::Object* value) { + DisallowHeapAllocation no_allocation; + if (this->IsAny()) return true; + if (value->IsHeapObject()) { + i::Map* map = i::HeapObject::cast(value)->map(); + for (Iterator it = this->Classes(); !it.Done(); it.Advance()) { + if (*it.Current() == map) return true; + } + } + return this->Contains(value); +} + + // static Type* ZoneTypeConfig::handle(Type* type) { return type; diff --git a/src/types.cc b/src/types.cc index 3abc08dd9c..4526b6fe44 100644 --- a/src/types.cc +++ b/src/types.cc @@ -371,19 +371,6 @@ bool TypeImpl::Contains(i::Object* value) { } -template -bool TypeImpl::NowContains(i::Object* value) { - DisallowHeapAllocation no_allocation; - if (value->IsHeapObject()) { - i::Map* map = i::HeapObject::cast(value)->map(); - for (Iterator it = this->Classes(); !it.Done(); it.Advance()) { - if (*it.Current() == map) return true; - } - } - return this->Contains(value); -} - - template bool TypeImpl::InUnion(StructHandle unioned, int current_size) { ASSERT(!this->IsUnion()); diff --git a/src/types.h b/src/types.h index 18b22239a2..da63e5fd56 100644 --- a/src/types.h +++ b/src/types.h @@ -271,7 +271,7 @@ class TypeImpl : public Config::Base { bool NowIs(TypeImpl* that); template bool NowIs(TypeHandle that) { return this->NowIs(*that); } - bool NowContains(i::Object* val); + inline bool NowContains(i::Object* val); bool NowContains(i::Handle val) { return this->NowContains(*val); } bool IsClass() { return Config::is_class(this); }