diff options
Diffstat (limited to 'deps/v8/src/objects/descriptor-array.h')
-rw-r--r-- | deps/v8/src/objects/descriptor-array.h | 57 |
1 files changed, 32 insertions, 25 deletions
diff --git a/deps/v8/src/objects/descriptor-array.h b/deps/v8/src/objects/descriptor-array.h index 0f17cd22ea..73b94b7cfa 100644 --- a/deps/v8/src/objects/descriptor-array.h +++ b/deps/v8/src/objects/descriptor-array.h @@ -6,6 +6,8 @@ #define V8_OBJECTS_DESCRIPTOR_ARRAY_H_ #include "src/objects/fixed-array.h" +// TODO(jkummerow): Consider forward-declaring instead. +#include "src/objects/internal-index.h" #include "src/objects/objects.h" #include "src/objects/struct.h" #include "src/utils/utils.h" @@ -62,27 +64,29 @@ class DescriptorArray : public HeapObject { Handle<FixedArray> indices); // Accessors for fetching instance descriptor at descriptor number. - inline Name GetKey(int descriptor_number) const; - inline Name GetKey(Isolate* isolate, int descriptor_number) const; - inline Object GetStrongValue(int descriptor_number); - inline Object GetStrongValue(Isolate* isolate, int descriptor_number); - inline MaybeObject GetValue(int descriptor_number); - inline MaybeObject GetValue(Isolate* isolate, int descriptor_number); - inline PropertyDetails GetDetails(int descriptor_number); - inline int GetFieldIndex(int descriptor_number); - inline FieldType GetFieldType(int descriptor_number); - inline FieldType GetFieldType(Isolate* isolate, int descriptor_number); + inline Name GetKey(InternalIndex descriptor_number) const; + inline Name GetKey(Isolate* isolate, InternalIndex descriptor_number) const; + inline Object GetStrongValue(InternalIndex descriptor_number); + inline Object GetStrongValue(Isolate* isolate, + InternalIndex descriptor_number); + inline MaybeObject GetValue(InternalIndex descriptor_number); + inline MaybeObject GetValue(Isolate* isolate, + InternalIndex descriptor_number); + inline PropertyDetails GetDetails(InternalIndex descriptor_number); + inline int GetFieldIndex(InternalIndex descriptor_number); + inline FieldType GetFieldType(InternalIndex descriptor_number); + inline FieldType GetFieldType(Isolate* isolate, + InternalIndex descriptor_number); inline Name GetSortedKey(int descriptor_number); inline Name GetSortedKey(Isolate* isolate, int descriptor_number); inline int GetSortedKeyIndex(int descriptor_number); - inline void SetSortedKey(int pointer, int descriptor_number); // Accessor for complete descriptor. - inline void Set(int descriptor_number, Descriptor* desc); - inline void Set(int descriptor_number, Name key, MaybeObject value, + inline void Set(InternalIndex descriptor_number, Descriptor* desc); + inline void Set(InternalIndex descriptor_number, Name key, MaybeObject value, PropertyDetails details); - void Replace(int descriptor_number, Descriptor* descriptor); + void Replace(InternalIndex descriptor_number, Descriptor* descriptor); // Generalizes constness, representation and field type of all field // descriptors. @@ -109,20 +113,20 @@ class DescriptorArray : public HeapObject { void Sort(); // Search the instance descriptors for given name. - V8_INLINE int Search(Name name, int number_of_own_descriptors); - V8_INLINE int Search(Name name, Map map); + V8_INLINE InternalIndex Search(Name name, int number_of_own_descriptors); + V8_INLINE InternalIndex Search(Name name, Map map); // As the above, but uses DescriptorLookupCache and updates it when // necessary. - V8_INLINE int SearchWithCache(Isolate* isolate, Name name, Map map); + V8_INLINE InternalIndex SearchWithCache(Isolate* isolate, Name name, Map map); bool IsEqualUpTo(DescriptorArray desc, int nof_descriptors); // Allocates a DescriptorArray, but returns the singleton // empty descriptor array object if number_of_descriptors is 0. - V8_EXPORT_PRIVATE static Handle<DescriptorArray> Allocate( - Isolate* isolate, int nof_descriptors, int slack, - AllocationType allocation = AllocationType::kYoung); + V8_EXPORT_PRIVATE static Handle<DescriptorArray> Allocate(Isolate* isolate, + int nof_descriptors, + int slack); void Initialize(EnumCache enum_cache, HeapObject undefined_value, int nof_descriptors, int slack); @@ -176,7 +180,7 @@ class DescriptorArray : public HeapObject { // Print all the descriptors. void PrintDescriptors(std::ostream& os); - void PrintDescriptorDetails(std::ostream& os, int descriptor, + void PrintDescriptorDetails(std::ostream& os, InternalIndex descriptor, PropertyDetails::PrintMode mode); DECL_PRINTER(DescriptorArray) @@ -210,13 +214,16 @@ class DescriptorArray : public HeapObject { private: DECL_INT16_ACCESSORS(filler16bits) - inline void SetKey(int descriptor_number, Name key); - inline void SetValue(int descriptor_number, MaybeObject value); - inline void SetDetails(int descriptor_number, PropertyDetails details); + inline void SetKey(InternalIndex descriptor_number, Name key); + inline void SetValue(InternalIndex descriptor_number, MaybeObject value); + inline void SetDetails(InternalIndex descriptor_number, + PropertyDetails details); // Transfer a complete descriptor from the src descriptor array to this // descriptor array. - void CopyFrom(int index, DescriptorArray src); + void CopyFrom(InternalIndex index, DescriptorArray src); + + inline void SetSortedKey(int pointer, int descriptor_number); // Swap first and second descriptor. inline void SwapSortedKeys(int first, int second); |