Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: src/types.cc

Issue 1700923002: Move FieldType to separate h/cc files. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/types.h ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/types.cc
diff --git a/src/types.cc b/src/types.cc
index 1515ec51a4bbef3b2a9bb5b9eba6ec66319af297..d54826e34efc9a1c97d15a5bb3f9fbf89b74f4ae 100644
--- a/src/types.cc
+++ b/src/types.cc
@@ -1258,93 +1258,6 @@ void BitsetType::Print(bitset bits) {
}
#endif
-// static
-FieldType* FieldType::None() {
- return reinterpret_cast<FieldType*>(Smi::FromInt(0));
-}
-
-// static
-FieldType* FieldType::Any() {
- return reinterpret_cast<FieldType*>(Smi::FromInt(1));
-}
-
-// static
-Handle<FieldType> FieldType::None(Isolate* isolate) {
- return handle(None(), isolate);
-}
-
-// static
-Handle<FieldType> FieldType::Any(Isolate* isolate) {
- return handle(Any(), isolate);
-}
-
-// static
-FieldType* FieldType::Class(i::Map* map) { return FieldType::cast(map); }
-
-// static
-Handle<FieldType> FieldType::Class(i::Handle<i::Map> map, Isolate* isolate) {
- return handle(Class(*map), isolate);
-}
-
-// static
-FieldType* FieldType::cast(Object* object) {
- DCHECK(object == None() || object == Any() || object->IsMap());
- return reinterpret_cast<FieldType*>(object);
-}
-
-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);
-}
-
-bool FieldType::NowContains(Handle<Object> value) {
- return NowContains(*value);
-}
-
-bool FieldType::IsClass() { return this->IsMap(); }
-
-Handle<i::Map> FieldType::AsClass() {
- DCHECK(IsClass());
- i::Map* map = Map::cast(this);
- return handle(map, map->GetIsolate());
-}
-
-bool FieldType::NowStable() {
- return !this->IsClass() || this->AsClass()->is_stable();
-}
-
-bool FieldType::NowIs(FieldType* other) {
- if (other->IsAny()) return true;
- if (IsNone()) return true;
- if (other->IsNone()) return false;
- if (IsAny()) return false;
- DCHECK(IsClass());
- DCHECK(other->IsClass());
- return this == other;
-}
-
-bool FieldType::NowIs(Handle<FieldType> other) { return NowIs(*other); }
-
-Type* FieldType::Convert(Zone* zone) {
- if (IsAny()) return Type::Any();
- if (IsNone()) return Type::None();
- DCHECK(IsClass());
- return Type::Class(AsClass(), zone);
-}
-
-void FieldType::PrintTo(std::ostream& os) {
- if (IsAny()) {
- os << "Any";
- } else if (IsNone()) {
- os << "None";
- } else {
- DCHECK(IsClass());
- os << "Class(" << static_cast<void*>(*AsClass()) << ")";
- }
-}
-
BitsetType::bitset BitsetType::SignedSmall() {
return i::SmiValuesAre31Bits() ? kSigned31 : kSigned32;
}
« no previous file with comments | « src/types.h ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698