diff options
Diffstat (limited to 'deps/v8/src/field-type.h')
-rw-r--r-- | deps/v8/src/field-type.h | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/deps/v8/src/field-type.h b/deps/v8/src/field-type.h index d66d12c095..5e280339e5 100644 --- a/deps/v8/src/field-type.h +++ b/deps/v8/src/field-type.h @@ -6,6 +6,7 @@ #define V8_FIELD_TYPE_H_ #include "src/objects.h" +#include "src/objects/heap-object.h" #include "src/objects/map.h" namespace v8 { @@ -16,27 +17,36 @@ class Handle; class FieldType : public Object { public: - static FieldType* None(); - static FieldType* Any(); + static FieldType None(); + static FieldType Any(); static Handle<FieldType> None(Isolate* isolate); static Handle<FieldType> Any(Isolate* isolate); - static FieldType* Class(i::Map* map); - static Handle<FieldType> Class(i::Handle<i::Map> map, Isolate* isolate); - static FieldType* cast(Object* object); + static FieldType Class(Map map); + static Handle<FieldType> Class(Handle<Map> map, Isolate* isolate); + static FieldType cast(Object object); + static FieldType unchecked_cast(Object object) { + return FieldType(object.ptr()); + } - bool NowContains(Object* value); + bool NowContains(Object value) const; - bool NowContains(Handle<Object> value) { return NowContains(*value); } + bool NowContains(Handle<Object> value) const { return NowContains(*value); } - bool IsClass(); - Map* AsClass(); - bool IsNone() { return this == None(); } - bool IsAny() { return this == Any(); } - bool NowStable(); - bool NowIs(FieldType* other); - bool NowIs(Handle<FieldType> other); + bool IsClass() const; + Map AsClass() const; + bool IsNone() const { return *this == None(); } + bool IsAny() const { return *this == Any(); } + bool NowStable() const; + bool NowIs(FieldType other) const; + bool NowIs(Handle<FieldType> other) const; - void PrintTo(std::ostream& os); + void PrintTo(std::ostream& os) const; + + FieldType* operator->() { return this; } + const FieldType* operator->() const { return this; } + + private: + explicit constexpr FieldType(Address ptr) : Object(ptr) {} }; } // namespace internal |