diff options
Diffstat (limited to 'chromium/v8/src/objects/name.h')
-rw-r--r-- | chromium/v8/src/objects/name.h | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/chromium/v8/src/objects/name.h b/chromium/v8/src/objects/name.h index 8b2a8f0a01c..b13aa30fb09 100644 --- a/chromium/v8/src/objects/name.h +++ b/chromium/v8/src/objects/name.h @@ -7,7 +7,7 @@ #include "src/objects/heap-object.h" #include "src/objects/objects.h" -#include "torque-generated/field-offsets-tq.h" +#include "torque-generated/class-definitions-tq.h" // Has to be the last include (doesn't have include guards): #include "src/objects/object-macros.h" @@ -17,12 +17,8 @@ namespace internal { // The Name abstract class captures anything that can be used as a property // name, i.e., strings and symbols. All names store a hash value. -class Name : public HeapObject { +class Name : public TorqueGeneratedName<Name, HeapObject> { public: - // Get and set the hash field of the name. - inline uint32_t hash_field(); - inline void set_hash_field(uint32_t value); - // Tells whether the hash code has been computed. inline bool HasHashCode(); @@ -43,15 +39,19 @@ class Name : public HeapObject { // symbol properties are added, so we can optimize lookups on objects // that don't have the flag. inline bool IsInterestingSymbol() const; + inline bool IsInterestingSymbol(Isolate* isolate) const; // If the name is private, it can only name own properties. - inline bool IsPrivate(); + inline bool IsPrivate() const; + inline bool IsPrivate(Isolate* isolate) const; // If the name is a private name, it should behave like a private // symbol but also throw on property access miss. - inline bool IsPrivateName(); + inline bool IsPrivateName() const; + inline bool IsPrivateName(Isolate* isolate) const; inline bool IsUniqueName() const; + inline bool IsUniqueName(Isolate* isolate) const; static inline bool ContainsCachedArrayIndex(uint32_t hash); @@ -62,15 +62,10 @@ class Name : public HeapObject { V8_WARN_UNUSED_RESULT static MaybeHandle<String> ToFunctionName( Isolate* isolate, Handle<Name> name, Handle<String> prefix); - DECL_CAST(Name) - DECL_PRINTER(Name) void NameShortPrint(); int NameShortPrint(Vector<char> str); - DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize, - TORQUE_GENERATED_NAME_FIELDS) - // Mask constant for checking if a name has a computed hash code // and if it is a string that is an array index. The least significant bit // indicates whether a hash code has been computed. If the hash code has @@ -131,17 +126,12 @@ class Name : public HeapObject { protected: static inline bool IsHashFieldComputed(uint32_t field); - OBJECT_CONSTRUCTORS(Name, HeapObject); + TQ_OBJECT_CONSTRUCTORS(Name) }; // ES6 symbols. -class Symbol : public Name { +class Symbol : public TorqueGeneratedSymbol<Symbol, Name> { public: - // [name]: The print name of a symbol, or undefined if none. - DECL_ACCESSORS(name, Object) - - DECL_INT_ACCESSORS(flags) - // [is_private]: Whether this is a private symbol. Private symbols can only // be used to designate own properties of objects. DECL_BOOLEAN_ACCESSORS(is_private) @@ -169,15 +159,10 @@ class Symbol : public Name { inline bool is_private_name() const; inline void set_is_private_name(); - DECL_CAST(Symbol) - // Dispatched behavior. DECL_PRINTER(Symbol) DECL_VERIFIER(Symbol) - DEFINE_FIELD_OFFSET_CONSTANTS(Name::kHeaderSize, - TORQUE_GENERATED_SYMBOL_FIELDS) - // Flags layout. #define FLAGS_BIT_FIELDS(V, _) \ V(IsPrivateBit, bool, 1, _) \ @@ -199,7 +184,7 @@ class Symbol : public Name { // TODO(cbruni): remove once the new maptracer is in place. friend class Name; // For PrivateSymbolToName. - OBJECT_CONSTRUCTORS(Symbol, Name); + TQ_OBJECT_CONSTRUCTORS(Symbol) }; } // namespace internal |