Inline TypeImpl::NowContains().

R=rossberg@chromium.org

Review URL: https://codereview.chromium.org/234743003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20677 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
bmeurer@chromium.org 2014-04-11 09:24:35 +00:00
parent b61696dd95
commit 9a544e1887
3 changed files with 15 additions and 14 deletions

View File

@ -13,6 +13,20 @@
namespace v8 {
namespace internal {
template<class Config>
bool TypeImpl<Config>::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<i::Map> 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;

View File

@ -371,19 +371,6 @@ bool TypeImpl<Config>::Contains(i::Object* value) {
}
template<class Config>
bool TypeImpl<Config>::NowContains(i::Object* value) {
DisallowHeapAllocation no_allocation;
if (value->IsHeapObject()) {
i::Map* map = i::HeapObject::cast(value)->map();
for (Iterator<i::Map> it = this->Classes(); !it.Done(); it.Advance()) {
if (*it.Current() == map) return true;
}
}
return this->Contains(value);
}
template<class Config>
bool TypeImpl<Config>::InUnion(StructHandle unioned, int current_size) {
ASSERT(!this->IsUnion());

View File

@ -271,7 +271,7 @@ 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);
inline bool NowContains(i::Object* val);
bool NowContains(i::Handle<i::Object> val) { return this->NowContains(*val); }
bool IsClass() { return Config::is_class(this); }