diff options
Diffstat (limited to 'deps/v8/src/field-type.cc')
-rw-r--r-- | deps/v8/src/field-type.cc | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/deps/v8/src/field-type.cc b/deps/v8/src/field-type.cc index 2eebebe3d61..c4d2080f782 100644 --- a/deps/v8/src/field-type.cc +++ b/deps/v8/src/field-type.cc @@ -49,14 +49,13 @@ FieldType* FieldType::cast(Object* object) { bool FieldType::IsClass() { return this->IsMap(); } -Handle<i::Map> FieldType::AsClass() { +Map* FieldType::AsClass() { DCHECK(IsClass()); - i::Map* map = Map::cast(this); - return handle(map, map->GetIsolate()); + return Map::cast(this); } bool FieldType::NowStable() { - return !this->IsClass() || this->AsClass()->is_stable(); + return !this->IsClass() || AsClass()->is_stable(); } bool FieldType::NowIs(FieldType* other) { @@ -78,10 +77,16 @@ void FieldType::PrintTo(std::ostream& os) { os << "None"; } else { DCHECK(IsClass()); - HandleScope scope(Map::cast(this)->GetIsolate()); - os << "Class(" << static_cast<void*>(*AsClass()) << ")"; + os << "Class(" << static_cast<void*>(AsClass()) << ")"; } } +bool FieldType::NowContains(Object* value) { + if (this == Any()) return true; + if (this == None()) return false; + if (!value->IsHeapObject()) return false; + return HeapObject::cast(value)->map() == Map::cast(this); +} + } // namespace internal } // namespace v8 |