Commit 9a544e18 authored by bmeurer@chromium.org's avatar bmeurer@chromium.org

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
parent b61696dd
...@@ -13,6 +13,20 @@ ...@@ -13,6 +13,20 @@
namespace v8 { namespace v8 {
namespace internal { 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 // static
Type* ZoneTypeConfig::handle(Type* type) { Type* ZoneTypeConfig::handle(Type* type) {
return type; return type;
......
...@@ -371,19 +371,6 @@ bool TypeImpl<Config>::Contains(i::Object* value) { ...@@ -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> template<class Config>
bool TypeImpl<Config>::InUnion(StructHandle unioned, int current_size) { bool TypeImpl<Config>::InUnion(StructHandle unioned, int current_size) {
ASSERT(!this->IsUnion()); ASSERT(!this->IsUnion());
......
...@@ -271,7 +271,7 @@ class TypeImpl : public Config::Base { ...@@ -271,7 +271,7 @@ class TypeImpl : public Config::Base {
bool NowIs(TypeImpl* that); bool NowIs(TypeImpl* that);
template<class TypeHandle> template<class TypeHandle>
bool NowIs(TypeHandle that) { return this->NowIs(*that); } 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 NowContains(i::Handle<i::Object> val) { return this->NowContains(*val); }
bool IsClass() { return Config::is_class(this); } bool IsClass() { return Config::is_class(this); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment