V8 Project
v8::internal::DescriptorArray Class Reference

#include <objects.h>

+ Inheritance diagram for v8::internal::DescriptorArray:
+ Collaboration diagram for v8::internal::DescriptorArray:

Classes

class  Entry
 
class  WhitenessWitness
 

Public Member Functions

bool IsEmpty ()
 
int number_of_descriptors ()
 
int number_of_descriptors_storage ()
 
int NumberOfSlackDescriptors ()
 
void SetNumberOfDescriptors (int number_of_descriptors)
 
int number_of_entries ()
 
bool HasEnumCache ()
 
void CopyEnumCacheFrom (DescriptorArray *array)
 
FixedArrayGetEnumCache ()
 
bool HasEnumIndicesCache ()
 
FixedArrayGetEnumIndicesCache ()
 
Object ** GetEnumCacheSlot ()
 
void ClearEnumCache ()
 
void SetEnumCache (FixedArray *bridge_storage, FixedArray *new_cache, Object *new_index_cache)
 
bool CanHoldValue (int descriptor, Object *value)
 
NameGetKey (int descriptor_number)
 
Object ** GetKeySlot (int descriptor_number)
 
ObjectGetValue (int descriptor_number)
 
void SetValue (int descriptor_number, Object *value)
 
Object ** GetValueSlot (int descriptor_number)
 
Object ** GetDescriptorStartSlot (int descriptor_number)
 
Object ** GetDescriptorEndSlot (int descriptor_number)
 
PropertyDetails GetDetails (int descriptor_number)
 
PropertyType GetType (int descriptor_number)
 
int GetFieldIndex (int descriptor_number)
 
HeapTypeGetFieldType (int descriptor_number)
 
ObjectGetConstant (int descriptor_number)
 
ObjectGetCallbacksObject (int descriptor_number)
 
AccessorDescriptorGetCallbacks (int descriptor_number)
 
NameGetSortedKey (int descriptor_number)
 
int GetSortedKeyIndex (int descriptor_number)
 
void SetSortedKey (int pointer, int descriptor_number)
 
void SetRepresentation (int descriptor_number, Representation representation)
 
void Get (int descriptor_number, Descriptor *desc)
 
void Set (int descriptor_number, Descriptor *desc)
 
void Replace (int descriptor_number, Descriptor *descriptor)
 
void Append (Descriptor *desc)
 
void Sort ()
 
 INLINE (int Search(Name *name, int number_of_own_descriptors))
 
 INLINE (int SearchWithCache(Name *name, Map *map))
 
- Public Member Functions inherited from v8::internal::FixedArray
Objectget (int index)
 
void set (int index, Object *value)
 
bool is_the_hole (int index)
 
void set (int index, Smi *value)
 
void set (int index, Object *value, WriteBarrierMode mode)
 
void set_undefined (int index)
 
void set_null (int index)
 
void set_the_hole (int index)
 
Object ** GetFirstElementAddress ()
 
bool ContainsOnlySmisOrHoles ()
 
Object ** data_start ()
 
void FillWithHoles (int from, int to)
 
void Shrink (int length)
 
void CopyTo (int pos, FixedArray *dest, int dest_pos, int len)
 
Object ** RawFieldOfElementAt (int index)
 
void SwapPairs (FixedArray *numbers, int i, int j)
 
void SortPairs (FixedArray *numbers, uint32_t len)
 
- Public Member Functions inherited from v8::internal::FixedArrayBase
int length () const
 
void set_length (int value)
 
int synchronized_length () const
 
void synchronized_set_length (int value)
 
- Public Member Functions inherited from v8::internal::HeapObject
Mapmap () const
 
void set_map (Map *value)
 
void set_map_no_write_barrier (Map *value)
 
Mapsynchronized_map ()
 
MapWord synchronized_map_word () const
 
void synchronized_set_map (Map *value)
 
void synchronized_set_map_no_write_barrier (Map *value)
 
void synchronized_set_map_word (MapWord map_word)
 
MapWord map_word () const
 
void set_map_word (MapWord map_word)
 
HeapGetHeap () const
 
IsolateGetIsolate () const
 
Address address ()
 
void Iterate (ObjectVisitor *v)
 
void IterateBody (InstanceType type, int object_size, ObjectVisitor *v)
 
int Size ()
 
bool MayContainRawValues ()
 
int SizeFromMap (Map *map)
 
WriteBarrierMode GetWriteBarrierMode (const DisallowHeapAllocation &promise)
 
void HeapObjectShortPrint (OStream &os)
 
 STATIC_ASSERT (kMapOffset==Internals::kHeapObjectMapOffset)
 
- Public Member Functions inherited from v8::internal::Object
bool IsObject () const
 
 INLINE (bool IsFixedArrayBase() const)
 
 INLINE (bool IsExternal() const)
 
 INLINE (bool IsAccessorInfo() const)
 
 INLINE (bool IsStruct() const)
 
 INLINE (bool IsSpecObject()) const
 
 INLINE (bool IsSpecFunction()) const
 
 INLINE (bool IsTemplateInfo()) const
 
 INLINE (bool IsNameDictionary() const)
 
 INLINE (bool IsSeededNumberDictionary() const)
 
 INLINE (bool IsUnseededNumberDictionary() const)
 
 INLINE (bool IsOrderedHashSet() const)
 
 INLINE (bool IsOrderedHashMap() const)
 
bool IsCallable () const
 
 INLINE (bool IsUndefined() const)
 
 INLINE (bool IsNull() const)
 
 INLINE (bool IsTheHole() const)
 
 INLINE (bool IsException() const)
 
 INLINE (bool IsUninitialized() const)
 
 INLINE (bool IsTrue() const)
 
 INLINE (bool IsFalse() const)
 
 INLINE (bool IsArgumentsMarker() const)
 
 INLINE (bool IsFiller() const)
 
double Number ()
 
 INLINE (bool IsNaN() const)
 
 INLINE (bool IsMinusZero() const)
 
bool ToInt32 (int32_t *value)
 
bool ToUint32 (uint32_t *value)
 
Representation OptimalRepresentation ()
 
bool FitsRepresentation (Representation representation)
 
Handle< HeapTypeOptimalType (Isolate *isolate, Representation representation)
 
bool HasValidElements ()
 
bool HasSpecificClassOf (String *name)
 
bool BooleanValue ()
 
ObjectGetHash ()
 
bool SameValue (Object *other)
 
bool SameValueZero (Object *other)
 
bool ToArrayIndex (uint32_t *index)
 
bool IsStringObjectWithCharacterAt (uint32_t index)
 
void VerifyApiCallResultType ()
 
void ShortPrint (FILE *out=stdout)
 
void ShortPrint (StringStream *accumulator)
 

Static Public Member Functions

static int GetValueOffset (int descriptor_number)
 
static Handle< DescriptorArrayCopyUpTo (Handle< DescriptorArray > desc, int enumeration_index, int slack=0)
 
static Handle< DescriptorArrayCopyUpToAddAttributes (Handle< DescriptorArray > desc, int enumeration_index, PropertyAttributes attributes, int slack=0)
 
static Handle< DescriptorArrayAllocate (Isolate *isolate, int number_of_descriptors, int slack=0)
 
static int LengthFor (int number_of_descriptors)
 
- Static Public Member Functions inherited from v8::internal::FixedArray
static Handle< Objectget (Handle< FixedArray > array, int index)
 
static Handle< FixedArrayCopySize (Handle< FixedArray > array, int new_length, PretenureFlag pretenure=NOT_TENURED)
 
static MUST_USE_RESULT MaybeHandle< FixedArrayAddKeysFromArrayLike (Handle< FixedArray > content, Handle< JSObject > array)
 
static MUST_USE_RESULT MaybeHandle< FixedArrayUnionOfKeys (Handle< FixedArray > first, Handle< FixedArray > second)
 
static int SizeFor (int length)
 
static int OffsetOfElementAt (int index)
 
- Static Public Member Functions inherited from v8::internal::HeapObject
static HeapObjectFromAddress (Address address)
 
static Object ** RawField (HeapObject *obj, int offset)
 
static void UpdateMapCodeCache (Handle< HeapObject > object, Handle< Name > name, Handle< Code > code)
 
- Static Public Member Functions inherited from v8::internal::Object
static Handle< ObjectNewStorageFor (Isolate *isolate, Handle< Object > object, Representation representation)
 
static Handle< ObjectWrapForRead (Isolate *isolate, Handle< Object > object, Representation representation)
 
static MaybeHandle< JSReceiverToObject (Isolate *isolate, Handle< Object > object)
 
static MaybeHandle< JSReceiverToObject (Isolate *isolate, Handle< Object > object, Handle< Context > context)
 
static MUST_USE_RESULT MaybeHandle< SmiToSmi (Isolate *isolate, Handle< Object > object)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetProperty (LookupIterator *it)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetProperty (Handle< Object > object, Handle< Name > key, Handle< Object > value, StrictMode strict_mode, StoreFromKeyed store_mode=MAY_BE_STORE_FROM_KEYED)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetProperty (LookupIterator *it, Handle< Object > value, StrictMode strict_mode, StoreFromKeyed store_mode, StorePropertyMode data_store_mode=NORMAL_PROPERTY)
 
static MUST_USE_RESULT MaybeHandle< ObjectWriteToReadOnlyProperty (LookupIterator *it, Handle< Object > value, StrictMode strict_mode)
 
static Handle< ObjectSetDataProperty (LookupIterator *it, Handle< Object > value)
 
static MUST_USE_RESULT MaybeHandle< ObjectAddDataProperty (LookupIterator *it, Handle< Object > value, PropertyAttributes attributes, StrictMode strict_mode, StoreFromKeyed store_mode)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetPropertyOrElement (Handle< Object > object, Handle< Name > key)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetProperty (Isolate *isolate, Handle< Object > object, const char *key)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetProperty (Handle< Object > object, Handle< Name > key)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetPropertyWithAccessor (Handle< Object > receiver, Handle< Name > name, Handle< JSObject > holder, Handle< Object > structure)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetPropertyWithAccessor (Handle< Object > receiver, Handle< Name > name, Handle< Object > value, Handle< JSObject > holder, Handle< Object > structure, StrictMode strict_mode)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetPropertyWithDefinedGetter (Handle< Object > receiver, Handle< JSReceiver > getter)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetPropertyWithDefinedSetter (Handle< Object > receiver, Handle< JSReceiver > setter, Handle< Object > value)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetElement (Isolate *isolate, Handle< Object > object, uint32_t index)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetElementWithReceiver (Isolate *isolate, Handle< Object > object, Handle< Object > receiver, uint32_t index)
 
static Handle< SmiGetOrCreateHash (Isolate *isolate, Handle< Object > object)
 

Static Public Attributes

static const int kNotFound = -1
 
static const int kDescriptorLengthIndex = 0
 
static const int kEnumCacheIndex = 1
 
static const int kFirstIndex = 2
 
static const int kEnumCacheBridgeLength = 2
 
static const int kEnumCacheBridgeCacheIndex = 0
 
static const int kEnumCacheBridgeIndicesCacheIndex = 1
 
static const int kDescriptorLengthOffset = FixedArray::kHeaderSize
 
static const int kEnumCacheOffset = kDescriptorLengthOffset + kPointerSize
 
static const int kFirstOffset = kEnumCacheOffset + kPointerSize
 
static const int kEnumCacheBridgeCacheOffset = FixedArray::kHeaderSize
 
static const int kDescriptorKey = 0
 
static const int kDescriptorDetails = 1
 
static const int kDescriptorValue = 2
 
static const int kDescriptorSize = 3
 
- Static Public Attributes inherited from v8::internal::FixedArray
static const int kMaxSize = 128 * MB * kPointerSize
 
static const int kMaxLength = (kMaxSize - kHeaderSize) / kPointerSize
 
- Static Public Attributes inherited from v8::internal::FixedArrayBase
static const int kLengthOffset = HeapObject::kHeaderSize
 
static const int kHeaderSize = kLengthOffset + kPointerSize
 
- Static Public Attributes inherited from v8::internal::HeapObject
static const int kMapOffset = Object::kHeaderSize
 
static const int kHeaderSize = kMapOffset + kPointerSize
 
- Static Public Attributes inherited from v8::internal::Object
static const int kHeaderSize = 0
 

Private Member Functions

void CopyFrom (int index, DescriptorArray *src, const WhitenessWitness &)
 
void Set (int descriptor_number, Descriptor *desc, const WhitenessWitness &)
 
void SwapSortedKeys (int first, int second)
 
 DISALLOW_IMPLICIT_CONSTRUCTORS (DescriptorArray)
 

Static Private Member Functions

static int ToKeyIndex (int descriptor_number)
 
static int ToDetailsIndex (int descriptor_number)
 
static int ToValueIndex (int descriptor_number)
 

Additional Inherited Members

- Public Types inherited from v8::internal::Object
enum  StoreFromKeyed { MAY_BE_STORE_FROM_KEYED , CERTAINLY_NOT_STORE_FROM_KEYED }
 
enum  StorePropertyMode { NORMAL_PROPERTY , SUPER_PROPERTY }
 
- Protected Member Functions inherited from v8::internal::HeapObject
void IteratePointers (ObjectVisitor *v, int start, int end)
 
void IteratePointer (ObjectVisitor *v, int offset)
 
void IterateNextCodeLink (ObjectVisitor *v, int offset)
 
- Static Protected Member Functions inherited from v8::internal::FixedArray
static void NoWriteBarrierSet (FixedArray *array, int index, Object *value)
 
static void NoIncrementalWriteBarrierSet (FixedArray *array, int index, Object *value)
 

Detailed Description

Definition at line 2883 of file objects.h.

Member Function Documentation

◆ Allocate()

Handle< DescriptorArray > v8::internal::DescriptorArray::Allocate ( Isolate isolate,
int  number_of_descriptors,
int  slack = 0 
)
static

Definition at line 7790 of file objects.cc.

7792  {
7794  Factory* factory = isolate->factory();
7795  // Do not use DescriptorArray::cast on incomplete object.
7796  int size = number_of_descriptors + slack;
7797  if (size == 0) return factory->empty_descriptor_array();
7798  // Allocate the array of keys.
7799  Handle<FixedArray> result = factory->NewFixedArray(LengthFor(size));
7800 
7802  result->set(kEnumCacheIndex, Smi::FromInt(0));
7803  return Handle<DescriptorArray>::cast(result);
7804 }
static int LengthFor(int number_of_descriptors)
Definition: objects.h:3058
static const int kEnumCacheIndex
Definition: objects.h:3018
static const int kDescriptorLengthIndex
Definition: objects.h:3017
static Handle< T > cast(Handle< S > that)
Definition: handles.h:116
static Smi * FromInt(int value)
Definition: objects-inl.h:1321
enable harmony numeric enable harmony object literal extensions Optimize object size
#define DCHECK(condition)
Definition: logging.h:205

References v8::internal::Handle< T >::cast(), DCHECK, v8::internal::Isolate::factory(), v8::internal::Smi::FromInt(), and size.

Referenced by CopyUpToAddAttributes(), v8::internal::Map::GeneralizeRepresentation(), v8::internal::JSObject::MigrateSlowToFast(), and v8::internal::Map::ShareDescriptor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Append()

void v8::internal::DescriptorArray::Append ( Descriptor desc)
inline

Definition at line 3058 of file objects-inl.h.

3058  {
3059  DisallowHeapAllocation no_gc;
3060  int descriptor_number = number_of_descriptors();
3061  SetNumberOfDescriptors(descriptor_number + 1);
3062  Set(descriptor_number, desc);
3063 
3064  uint32_t hash = desc->GetKey()->Hash();
3065 
3066  int insertion;
3067 
3068  for (insertion = descriptor_number; insertion > 0; --insertion) {
3069  Name* key = GetSortedKey(insertion - 1);
3070  if (key->Hash() <= hash) break;
3071  SetSortedKey(insertion, GetSortedKeyIndex(insertion - 1));
3072  }
3073 
3074  SetSortedKey(insertion, descriptor_number);
3075 }
int GetSortedKeyIndex(int descriptor_number)
Definition: objects-inl.h:2934
void SetSortedKey(int pointer, int descriptor_number)
Definition: objects-inl.h:2944
void SetNumberOfDescriptors(int number_of_descriptors)
Definition: objects-inl.h:2752
void Set(int descriptor_number, Descriptor *desc)
Definition: objects-inl.h:3048
Name * GetSortedKey(int descriptor_number)
Definition: objects-inl.h:2939
PerThreadAssertScopeDebugOnly< HEAP_ALLOCATION_ASSERT, false > DisallowHeapAllocation
Definition: assert-scope.h:110

References GetSortedKey(), GetSortedKeyIndex(), v8::internal::Name::Hash(), number_of_descriptors(), Set(), SetNumberOfDescriptors(), and SetSortedKey().

Referenced by v8::internal::Map::AppendDescriptor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CanHoldValue()

bool v8::internal::DescriptorArray::CanHoldValue ( int  descriptor,
Object value 
)

Definition at line 6713 of file objects.cc.

6713  {
6714  PropertyDetails details = GetDetails(descriptor);
6715  switch (details.type()) {
6716  case FIELD:
6717  return value->FitsRepresentation(details.representation()) &&
6718  GetFieldType(descriptor)->NowContains(value);
6719 
6720  case CONSTANT:
6721  DCHECK(GetConstant(descriptor) != value ||
6722  value->FitsRepresentation(details.representation()));
6723  return GetConstant(descriptor) == value;
6724 
6725  case CALLBACKS:
6726  return false;
6727 
6728  case NORMAL:
6729  UNREACHABLE();
6730  break;
6731  }
6732 
6733  UNREACHABLE();
6734  return false;
6735 }
PropertyDetails GetDetails(int descriptor_number)
Definition: objects-inl.h:2981
Object * GetConstant(int descriptor_number)
Definition: objects-inl.h:3005
HeapType * GetFieldType(int descriptor_number)
Definition: objects-inl.h:2999
bool FitsRepresentation(Representation representation)
Definition: objects.h:1068
bool NowContains(i::Object *val)
Definition: types-inl.h:41
#define UNREACHABLE()
Definition: logging.h:30

References v8::internal::CALLBACKS, v8::internal::CONSTANT, DCHECK, v8::internal::FIELD, v8::internal::Object::FitsRepresentation(), v8::internal::NORMAL, and UNREACHABLE.

+ Here is the call graph for this function:

◆ ClearEnumCache()

void v8::internal::DescriptorArray::ClearEnumCache ( )

Definition at line 7807 of file objects.cc.

7807  {
7809 }
void set(int index, Object *value)
Definition: objects-inl.h:2190

References v8::internal::Smi::FromInt().

Referenced by v8::internal::MarkCompactCollector::TrimEnumCache().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CopyEnumCacheFrom()

void v8::internal::DescriptorArray::CopyEnumCacheFrom ( DescriptorArray array)
inline

Definition at line 2913 of file objects.h.

2913  {
2914  set(kEnumCacheIndex, array->get(kEnumCacheIndex));
2915  }

References v8::internal::FixedArray::get().

+ Here is the call graph for this function:

◆ CopyFrom()

void v8::internal::DescriptorArray::CopyFrom ( int  index,
DescriptorArray src,
const WhitenessWitness witness 
)
private

Definition at line 7833 of file objects.cc.

7835  {
7836  Object* value = src->GetValue(index);
7837  PropertyDetails details = src->GetDetails(index);
7838  Descriptor desc(handle(src->GetKey(index)),
7839  handle(value, src->GetIsolate()),
7840  details);
7841  Set(index, &desc, witness);
7842 }
kSerializedDataOffset Object
Definition: objects-inl.h:5322
Handle< T > handle(T *t, Isolate *isolate)
Definition: handles.h:146

References GetDetails(), v8::internal::HeapObject::GetIsolate(), GetKey(), GetValue(), and v8::internal::handle().

+ Here is the call graph for this function:

◆ CopyUpTo()

Handle< DescriptorArray > v8::internal::DescriptorArray::CopyUpTo ( Handle< DescriptorArray desc,
int  enumeration_index,
int  slack = 0 
)
static

Definition at line 6951 of file objects.cc.

6954  {
6956  desc, enumeration_index, NONE, slack);
6957 }
static Handle< DescriptorArray > CopyUpToAddAttributes(Handle< DescriptorArray > desc, int enumeration_index, PropertyAttributes attributes, int slack=0)
Definition: objects.cc:6960
@ NONE

References CopyUpToAddAttributes(), and NONE.

Referenced by v8::internal::Map::Copy(), v8::internal::Map::CopyAddDescriptor(), v8::internal::Map::CopyReplaceDescriptor(), and v8::internal::Map::EnsureDescriptorSlack().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CopyUpToAddAttributes()

Handle< DescriptorArray > v8::internal::DescriptorArray::CopyUpToAddAttributes ( Handle< DescriptorArray desc,
int  enumeration_index,
PropertyAttributes  attributes,
int  slack = 0 
)
static

Definition at line 6960 of file objects.cc.

6964  {
6965  if (enumeration_index + slack == 0) {
6966  return desc->GetIsolate()->factory()->empty_descriptor_array();
6967  }
6968 
6969  int size = enumeration_index;
6970 
6971  Handle<DescriptorArray> descriptors =
6972  DescriptorArray::Allocate(desc->GetIsolate(), size, slack);
6973  DescriptorArray::WhitenessWitness witness(*descriptors);
6974 
6975  if (attributes != NONE) {
6976  for (int i = 0; i < size; ++i) {
6977  Object* value = desc->GetValue(i);
6978  Name* key = desc->GetKey(i);
6979  PropertyDetails details = desc->GetDetails(i);
6980  // Bulk attribute changes never affect private properties.
6981  if (!key->IsSymbol() || !Symbol::cast(key)->is_private()) {
6982  int mask = DONT_DELETE | DONT_ENUM;
6983  // READ_ONLY is an invalid attribute for JS setters/getters.
6984  if (details.type() != CALLBACKS || !value->IsAccessorPair()) {
6985  mask |= READ_ONLY;
6986  }
6987  details = details.CopyAddAttributes(
6988  static_cast<PropertyAttributes>(attributes & mask));
6989  }
6990  Descriptor inner_desc(
6991  handle(key), handle(value, desc->GetIsolate()), details);
6992  descriptors->Set(i, &inner_desc, witness);
6993  }
6994  } else {
6995  for (int i = 0; i < size; ++i) {
6996  descriptors->CopyFrom(i, *desc, witness);
6997  }
6998  }
6999 
7000  if (desc->number_of_descriptors() != enumeration_index) descriptors->Sort();
7001 
7002  return descriptors;
7003 }
static Handle< DescriptorArray > Allocate(Isolate *isolate, int number_of_descriptors, int slack=0)
Definition: objects.cc:7790
PropertyAttributes
@ DONT_ENUM
@ DONT_DELETE
@ READ_ONLY

References Allocate(), v8::internal::CALLBACKS, DONT_DELETE, DONT_ENUM, v8::internal::handle(), NONE, READ_ONLY, and size.

Referenced by v8::internal::Map::CopyForFreeze(), and CopyUpTo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DISALLOW_IMPLICIT_CONSTRUCTORS()

v8::internal::DescriptorArray::DISALLOW_IMPLICIT_CONSTRUCTORS ( DescriptorArray  )
private

◆ Get()

void v8::internal::DescriptorArray::Get ( int  descriptor_number,
Descriptor desc 
)
inline

Definition at line 3023 of file objects-inl.h.

3023  {
3024  desc->Init(handle(GetKey(descriptor_number), GetIsolate()),
3025  handle(GetValue(descriptor_number), GetIsolate()),
3026  GetDetails(descriptor_number));
3027 }
Name * GetKey(int descriptor_number)
Definition: objects-inl.h:2928
Object * GetValue(int descriptor_number)
Definition: objects-inl.h:2970
Isolate * GetIsolate() const
Definition: objects-inl.h:1387

References GetDetails(), v8::internal::HeapObject::GetIsolate(), GetKey(), GetValue(), and v8::internal::handle().

+ Here is the call graph for this function:

◆ GetCallbacks()

AccessorDescriptor * v8::internal::DescriptorArray::GetCallbacks ( int  descriptor_number)
inline

Definition at line 3016 of file objects-inl.h.

3016  {
3017  DCHECK(GetType(descriptor_number) == CALLBACKS);
3018  Foreign* p = Foreign::cast(GetCallbacksObject(descriptor_number));
3019  return reinterpret_cast<AccessorDescriptor*>(p->foreign_address());
3020 }
PropertyType GetType(int descriptor_number)
Definition: objects-inl.h:2988
Object * GetCallbacksObject(int descriptor_number)
Definition: objects-inl.h:3010

References v8::internal::CALLBACKS, DCHECK, v8::internal::Foreign::foreign_address(), GetCallbacksObject(), and GetType().

+ Here is the call graph for this function:

◆ GetCallbacksObject()

Object * v8::internal::DescriptorArray::GetCallbacksObject ( int  descriptor_number)
inline

Definition at line 3010 of file objects-inl.h.

3010  {
3011  DCHECK(GetType(descriptor_number) == CALLBACKS);
3012  return GetValue(descriptor_number);
3013 }

References v8::internal::CALLBACKS, DCHECK, GetType(), and GetValue().

Referenced by GetCallbacks().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetConstant()

Object * v8::internal::DescriptorArray::GetConstant ( int  descriptor_number)
inline

Definition at line 3005 of file objects-inl.h.

3005  {
3006  return GetValue(descriptor_number);
3007 }

References GetValue().

Referenced by v8::internal::V8HeapExplorer::ExtractPropertyReferences(), and v8::internal::JSObject::SlowReverseLookup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetDescriptorEndSlot()

Object ** v8::internal::DescriptorArray::GetDescriptorEndSlot ( int  descriptor_number)
inline

Definition at line 2923 of file objects-inl.h.

2923  {
2924  return GetValueSlot(descriptor_number - 1) + 1;
2925 }
Object ** GetValueSlot(int descriptor_number)
Definition: objects-inl.h:2959

References GetValueSlot().

Referenced by v8::internal::StaticMarkingVisitor< StaticVisitor >::MarkMapContents().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetDescriptorStartSlot()

Object ** v8::internal::DescriptorArray::GetDescriptorStartSlot ( int  descriptor_number)
inline

Definition at line 2918 of file objects-inl.h.

2918  {
2919  return GetKeySlot(descriptor_number);
2920 }
Object ** GetKeySlot(int descriptor_number)
Definition: objects-inl.h:2912

References GetKeySlot().

Referenced by v8::internal::StaticMarkingVisitor< StaticVisitor >::MarkMapContents().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetDetails()

PropertyDetails v8::internal::DescriptorArray::GetDetails ( int  descriptor_number)
inline

Definition at line 2981 of file objects-inl.h.

2981  {
2982  DCHECK(descriptor_number < number_of_descriptors());
2983  Object* details = get(ToDetailsIndex(descriptor_number));
2984  return PropertyDetails(Smi::cast(details));
2985 }
static int ToDetailsIndex(int descriptor_number)
Definition: objects.h:3101
Object * get(int index)
Definition: objects-inl.h:2165

References DCHECK, v8::internal::FixedArray::get(), number_of_descriptors(), and ToDetailsIndex().

Referenced by CopyFrom(), v8::internal::Map::CopyGeneralizeAllRepresentations(), v8::internal::V8HeapExplorer::ExtractPropertyReferences(), v8::internal::Map::FindLastMatchMap(), Get(), GetFieldIndex(), GetFieldType(), v8::internal::JSObject::GetHiddenPropertiesHashTable(), v8::internal::JSObject::GetOwnPropertyNames(), GetSortedKeyIndex(), GetType(), v8::internal::Map::LookupDescriptor(), v8::internal::Map::NumberOfDescribedProperties(), v8::internal::Map::NumberOfFields(), v8::internal::JSObject::PrintInstanceMigration(), SetRepresentation(), SetSortedKey(), v8::internal::JSObject::SlowReverseLookup(), v8::internal::Map::TransitionToAccessorProperty(), v8::internal::Map::TransitionToDataProperty(), v8::internal::Map::TryUpdateInternal(), and v8::internal::JSObject::WriteToField().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetEnumCache()

FixedArray* v8::internal::DescriptorArray::GetEnumCache ( )
inline

Definition at line 2917 of file objects.h.

2917  {
2918  DCHECK(HasEnumCache());
2919  FixedArray* bridge = FixedArray::cast(get(kEnumCacheIndex));
2920  return FixedArray::cast(bridge->get(kEnumCacheBridgeCacheIndex));
2921  }
static const int kEnumCacheBridgeCacheIndex
Definition: objects.h:3023

References DCHECK, and v8::internal::FixedArray::get().

Referenced by v8::internal::GetEnumPropertyKeys(), and v8::internal::MarkCompactCollector::TrimEnumCache().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetEnumCacheSlot()

Object** v8::internal::DescriptorArray::GetEnumCacheSlot ( )
inline

Definition at line 2937 of file objects.h.

2937  {
2938  DCHECK(HasEnumCache());
2939  return HeapObject::RawField(reinterpret_cast<HeapObject*>(this),
2941  }
static const int kEnumCacheOffset
Definition: objects.h:3028
static Object ** RawField(HeapObject *obj, int offset)
Definition: objects-inl.h:1311

References DCHECK, and v8::internal::HeapObject::RawField().

+ Here is the call graph for this function:

◆ GetEnumIndicesCache()

FixedArray* v8::internal::DescriptorArray::GetEnumIndicesCache ( )
inline

Definition at line 2931 of file objects.h.

2931  {
2933  FixedArray* bridge = FixedArray::cast(get(kEnumCacheIndex));
2934  return FixedArray::cast(bridge->get(kEnumCacheBridgeIndicesCacheIndex));
2935  }
static const int kEnumCacheBridgeIndicesCacheIndex
Definition: objects.h:3024

References DCHECK, and v8::internal::FixedArray::get().

Referenced by v8::internal::MarkCompactCollector::TrimEnumCache().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetFieldIndex()

int v8::internal::DescriptorArray::GetFieldIndex ( int  descriptor_number)
inline

Definition at line 2993 of file objects-inl.h.

2993  {
2994  DCHECK(GetDetails(descriptor_number).type() == FIELD);
2995  return GetDetails(descriptor_number).field_index();
2996 }

References DCHECK, v8::internal::FIELD, and GetDetails().

Referenced by v8::internal::V8HeapExplorer::ExtractPropertyReferences(), and v8::internal::Map::NextFreePropertyIndex().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetFieldType()

HeapType * v8::internal::DescriptorArray::GetFieldType ( int  descriptor_number)
inline

Definition at line 2999 of file objects-inl.h.

2999  {
3000  DCHECK(GetDetails(descriptor_number).type() == FIELD);
3001  return HeapType::cast(GetValue(descriptor_number));
3002 }
static TypeImpl * cast(typename Config::Base *object)
Definition: types-inl.h:20

References v8::internal::TypeImpl< Config >::cast(), DCHECK, v8::internal::FIELD, GetDetails(), and GetValue().

Referenced by v8::internal::Map::FindLastMatchMap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetKey()

Name * v8::internal::DescriptorArray::GetKey ( int  descriptor_number)
inline

Definition at line 2928 of file objects-inl.h.

2928  {
2929  DCHECK(descriptor_number < number_of_descriptors());
2930  return Name::cast(get(ToKeyIndex(descriptor_number)));
2931 }
static int ToKeyIndex(int descriptor_number)
Definition: objects.h:3095

References DCHECK, v8::internal::FixedArray::get(), number_of_descriptors(), and ToKeyIndex().

Referenced by CopyFrom(), v8::internal::Map::CopyGeneralizeAllRepresentations(), v8::internal::V8HeapExplorer::ExtractPropertyReferences(), v8::internal::Map::FindLastMatchMap(), Get(), v8::internal::JSObject::GetHiddenPropertiesHashTable(), v8::internal::JSObject::GetOwnPropertyNames(), GetSortedKey(), v8::internal::Map::NumberOfDescribedProperties(), v8::internal::JSObject::PrintInstanceMigration(), v8::internal::JSObject::SlowReverseLookup(), v8::internal::Map::TransitionToAccessorProperty(), and v8::internal::Map::TryUpdateInternal().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetKeySlot()

Object ** v8::internal::DescriptorArray::GetKeySlot ( int  descriptor_number)
inline

Definition at line 2912 of file objects-inl.h.

2912  {
2913  DCHECK(descriptor_number < number_of_descriptors());
2914  return RawFieldOfElementAt(ToKeyIndex(descriptor_number));
2915 }
Object ** RawFieldOfElementAt(int index)
Definition: objects.h:2458

References DCHECK, number_of_descriptors(), v8::internal::FixedArray::RawFieldOfElementAt(), and ToKeyIndex().

Referenced by GetDescriptorStartSlot().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetSortedKey()

Name * v8::internal::DescriptorArray::GetSortedKey ( int  descriptor_number)
inline

Definition at line 2939 of file objects-inl.h.

2939  {
2940  return GetKey(GetSortedKeyIndex(descriptor_number));
2941 }

References GetKey(), and GetSortedKeyIndex().

Referenced by Append().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetSortedKeyIndex()

int v8::internal::DescriptorArray::GetSortedKeyIndex ( int  descriptor_number)
inline

Definition at line 2934 of file objects-inl.h.

2934  {
2935  return GetDetails(descriptor_number).pointer();
2936 }

References GetDetails().

Referenced by Append(), v8::internal::JSObject::GetHiddenPropertiesHashTable(), GetSortedKey(), and SwapSortedKeys().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetType()

PropertyType v8::internal::DescriptorArray::GetType ( int  descriptor_number)
inline

Definition at line 2988 of file objects-inl.h.

2988  {
2989  return GetDetails(descriptor_number).type();
2990 }

References GetDetails().

Referenced by v8::internal::V8HeapExplorer::ExtractPropertyReferences(), GetCallbacks(), GetCallbacksObject(), v8::internal::JSObject::GetHiddenPropertiesHashTable(), v8::internal::Map::NextFreePropertyIndex(), and v8::internal::JSObject::SlowReverseLookup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetValue()

Object * v8::internal::DescriptorArray::GetValue ( int  descriptor_number)
inline

Definition at line 2970 of file objects-inl.h.

2970  {
2971  DCHECK(descriptor_number < number_of_descriptors());
2972  return get(ToValueIndex(descriptor_number));
2973 }
static int ToValueIndex(int descriptor_number)
Definition: objects.h:3107

References DCHECK, v8::internal::FixedArray::get(), number_of_descriptors(), and ToValueIndex().

Referenced by CopyFrom(), v8::internal::V8HeapExplorer::ExtractPropertyReferences(), v8::internal::Map::FindLastMatchMap(), Get(), GetCallbacksObject(), GetConstant(), GetFieldType(), v8::internal::SetAccessors(), v8::internal::Map::TransitionToAccessorProperty(), and v8::internal::Map::TryUpdateInternal().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetValueOffset()

int v8::internal::DescriptorArray::GetValueOffset ( int  descriptor_number)
inlinestatic

Definition at line 2965 of file objects-inl.h.

2965  {
2966  return OffsetOfElementAt(ToValueIndex(descriptor_number));
2967 }
static int OffsetOfElementAt(int index)
Definition: objects.h:2455

References v8::internal::FixedArray::OffsetOfElementAt(), and ToValueIndex().

Referenced by v8::internal::CodeStubGraphBuilder< Stub >::BuildCodeStub().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetValueSlot()

Object ** v8::internal::DescriptorArray::GetValueSlot ( int  descriptor_number)
inline

Definition at line 2959 of file objects-inl.h.

2959  {
2960  DCHECK(descriptor_number < number_of_descriptors());
2961  return RawFieldOfElementAt(ToValueIndex(descriptor_number));
2962 }

References DCHECK, number_of_descriptors(), v8::internal::FixedArray::RawFieldOfElementAt(), and ToValueIndex().

Referenced by GetDescriptorEndSlot().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HasEnumCache()

bool v8::internal::DescriptorArray::HasEnumCache ( )
inline

Definition at line 2909 of file objects.h.

2909  {
2910  return !IsEmpty() && !get(kEnumCacheIndex)->IsSmi();
2911  }

Referenced by v8::internal::MarkCompactCollector::TrimDescriptorArray().

+ Here is the caller graph for this function:

◆ HasEnumIndicesCache()

bool v8::internal::DescriptorArray::HasEnumIndicesCache ( )
inline

Definition at line 2923 of file objects.h.

2923  {
2924  if (IsEmpty()) return false;
2925  Object* object = get(kEnumCacheIndex);
2926  if (object->IsSmi()) return false;
2927  FixedArray* bridge = FixedArray::cast(object);
2928  return !bridge->get(kEnumCacheBridgeIndicesCacheIndex)->IsSmi();
2929  }

References v8::internal::FixedArray::get().

Referenced by v8::internal::MarkCompactCollector::TrimEnumCache().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ INLINE() [1/2]

v8::internal::DescriptorArray::INLINE ( int   SearchName *name, int number_of_own_descriptors)

◆ INLINE() [2/2]

v8::internal::DescriptorArray::INLINE ( int   SearchWithCacheName *name, Map *map)

◆ IsEmpty()

bool v8::internal::DescriptorArray::IsEmpty ( )
inline

Definition at line 2745 of file objects-inl.h.

2745  {
2746  DCHECK(length() >= kFirstIndex ||
2747  this == GetHeap()->empty_descriptor_array());
2748  return length() < kFirstIndex;
2749 }
static const int kFirstIndex
Definition: objects.h:3019
Heap * GetHeap() const
Definition: objects-inl.h:1379

References DCHECK, v8::internal::HeapObject::GetHeap(), kFirstIndex, and v8::internal::FixedArrayBase::length().

+ Here is the call graph for this function:

◆ LengthFor()

static int v8::internal::DescriptorArray::LengthFor ( int  number_of_descriptors)
inlinestatic

Definition at line 3058 of file objects.h.

3058  {
3060  }

◆ number_of_descriptors()

int v8::internal::DescriptorArray::number_of_descriptors ( )
inline

Definition at line 2891 of file objects.h.

2891  {
2892  DCHECK(length() >= kFirstIndex || IsEmpty());
2893  int len = length();
2894  return len == 0 ? 0 : Smi::cast(get(kDescriptorLengthIndex))->value();
2895  }

References DCHECK.

Referenced by Append(), v8::internal::Map::AppendDescriptor(), v8::internal::MarkCompactCollector::ClearMapTransitions(), v8::internal::Map::CopyGeneralizeAllRepresentations(), GetDetails(), v8::internal::JSObject::GetHiddenPropertiesHashTable(), GetKey(), GetKeySlot(), GetValue(), GetValueSlot(), v8::internal::Map::InitializeDescriptors(), v8::internal::Map::NumberOfDescribedProperties(), Set(), and SetNumberOfDescriptors().

+ Here is the caller graph for this function:

◆ number_of_descriptors_storage()

int v8::internal::DescriptorArray::number_of_descriptors_storage ( )
inline

Definition at line 2897 of file objects.h.

2897  {
2898  int len = length();
2899  return len == 0 ? 0 : (len - kFirstIndex) / kDescriptorSize;
2900  }
static const int kDescriptorSize
Definition: objects.h:3038

Referenced by v8::internal::MarkCompactCollector::TrimDescriptorArray().

+ Here is the caller graph for this function:

◆ number_of_entries()

int v8::internal::DescriptorArray::number_of_entries ( )
inline

Definition at line 2907 of file objects.h.

2907 { return number_of_descriptors(); }

◆ NumberOfSlackDescriptors()

int v8::internal::DescriptorArray::NumberOfSlackDescriptors ( )
inline

Definition at line 2902 of file objects.h.

2902  {
2904  }

◆ Replace()

void v8::internal::DescriptorArray::Replace ( int  descriptor_number,
Descriptor descriptor 
)

Definition at line 7812 of file objects.cc.

7812  {
7813  descriptor->SetSortedKeyIndex(GetSortedKeyIndex(index));
7814  Set(index, descriptor);
7815 }

Referenced by v8::internal::Map::CopyGeneralizeAllRepresentations(), and v8::internal::ReplaceAccessors().

+ Here is the caller graph for this function:

◆ Set() [1/2]

void v8::internal::DescriptorArray::Set ( int  descriptor_number,
Descriptor desc 
)
inline

Definition at line 3048 of file objects-inl.h.

3048  {
3049  // Range check.
3050  DCHECK(descriptor_number < number_of_descriptors());
3051 
3052  set(ToKeyIndex(descriptor_number), *desc->GetKey());
3053  set(ToValueIndex(descriptor_number), *desc->GetValue());
3054  set(ToDetailsIndex(descriptor_number), desc->GetDetails().AsSmi());
3055 }

References DCHECK, number_of_descriptors(), v8::internal::FixedArray::set(), ToDetailsIndex(), ToKeyIndex(), and ToValueIndex().

Referenced by Append().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Set() [2/2]

void v8::internal::DescriptorArray::Set ( int  descriptor_number,
Descriptor desc,
const WhitenessWitness  
)
inlineprivate

Definition at line 3030 of file objects-inl.h.

3032  {
3033  // Range check.
3034  DCHECK(descriptor_number < number_of_descriptors());
3035 
3037  ToKeyIndex(descriptor_number),
3038  *desc->GetKey());
3040  ToValueIndex(descriptor_number),
3041  *desc->GetValue());
3043  ToDetailsIndex(descriptor_number),
3044  desc->GetDetails().AsSmi());
3045 }
static void NoIncrementalWriteBarrierSet(FixedArray *array, int index, Object *value)
Definition: objects-inl.h:2680

References DCHECK, v8::internal::FixedArray::NoIncrementalWriteBarrierSet(), number_of_descriptors(), ToDetailsIndex(), ToKeyIndex(), and ToValueIndex().

+ Here is the call graph for this function:

◆ SetEnumCache()

void v8::internal::DescriptorArray::SetEnumCache ( FixedArray bridge_storage,
FixedArray new_cache,
Object new_index_cache 
)

Definition at line 7818 of file objects.cc.

7820  {
7821  DCHECK(bridge_storage->length() >= kEnumCacheBridgeLength);
7822  DCHECK(new_index_cache->IsSmi() || new_index_cache->IsFixedArray());
7823  DCHECK(!IsEmpty());
7824  DCHECK(!HasEnumCache() || new_cache->length() > GetEnumCache()->length());
7825  FixedArray::cast(bridge_storage)->
7826  set(kEnumCacheBridgeCacheIndex, new_cache);
7827  FixedArray::cast(bridge_storage)->
7828  set(kEnumCacheBridgeIndicesCacheIndex, new_index_cache);
7829  set(kEnumCacheIndex, bridge_storage);
7830 }
FixedArray * GetEnumCache()
Definition: objects.h:2917
static const int kEnumCacheBridgeLength
Definition: objects.h:3022

References DCHECK, and v8::internal::FixedArrayBase::length().

Referenced by v8::internal::GetEnumPropertyKeys().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetNumberOfDescriptors()

void v8::internal::DescriptorArray::SetNumberOfDescriptors ( int  number_of_descriptors)
inline

Definition at line 2752 of file objects-inl.h.

2752  {
2753  WRITE_FIELD(
2755 }
static const int kDescriptorLengthOffset
Definition: objects.h:3027
#define WRITE_FIELD(p, offset, value)
Definition: objects-inl.h:1190

References v8::internal::Smi::FromInt(), kDescriptorLengthOffset, number_of_descriptors(), and WRITE_FIELD.

Referenced by Append(), and v8::internal::MarkCompactCollector::TrimDescriptorArray().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetRepresentation()

void v8::internal::DescriptorArray::SetRepresentation ( int  descriptor_number,
Representation  representation 
)
inline

Definition at line 2950 of file objects-inl.h.

2951  {
2952  DCHECK(!representation.IsNone());
2953  PropertyDetails details = GetDetails(descriptor_index);
2954  set(ToDetailsIndex(descriptor_index),
2955  details.CopyWithRepresentation(representation).AsSmi());
2956 }

References DCHECK, GetDetails(), v8::internal::Representation::IsNone(), v8::internal::FixedArray::set(), and ToDetailsIndex().

Referenced by v8::internal::Map::CopyGeneralizeAllRepresentations().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetSortedKey()

void v8::internal::DescriptorArray::SetSortedKey ( int  pointer,
int  descriptor_number 
)
inline

Definition at line 2944 of file objects-inl.h.

2944  {
2945  PropertyDetails details = GetDetails(descriptor_index);
2946  set(ToDetailsIndex(descriptor_index), details.set_pointer(pointer).AsSmi());
2947 }

References GetDetails(), v8::internal::FixedArray::set(), and ToDetailsIndex().

Referenced by Append(), and SwapSortedKeys().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetValue()

void v8::internal::DescriptorArray::SetValue ( int  descriptor_number,
Object value 
)
inline

Definition at line 2976 of file objects-inl.h.

2976  {
2977  set(ToValueIndex(descriptor_index), value);
2978 }

References v8::internal::FixedArray::set(), and ToValueIndex().

Referenced by v8::internal::Map::CopyGeneralizeAllRepresentations().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Sort()

void v8::internal::DescriptorArray::Sort ( )

Definition at line 7849 of file objects.cc.

7849  {
7850  // In-place heap sort.
7851  int len = number_of_descriptors();
7852  // Reset sorting since the descriptor array might contain invalid pointers.
7853  for (int i = 0; i < len; ++i) SetSortedKey(i, i);
7854  // Bottom-up max-heap construction.
7855  // Index of the last node with children
7856  const int max_parent_index = (len / 2) - 1;
7857  for (int i = max_parent_index; i >= 0; --i) {
7858  int parent_index = i;
7859  const uint32_t parent_hash = GetSortedKey(i)->Hash();
7860  while (parent_index <= max_parent_index) {
7861  int child_index = 2 * parent_index + 1;
7862  uint32_t child_hash = GetSortedKey(child_index)->Hash();
7863  if (child_index + 1 < len) {
7864  uint32_t right_child_hash = GetSortedKey(child_index + 1)->Hash();
7865  if (right_child_hash > child_hash) {
7866  child_index++;
7867  child_hash = right_child_hash;
7868  }
7869  }
7870  if (child_hash <= parent_hash) break;
7871  SwapSortedKeys(parent_index, child_index);
7872  // Now element at child_index could be < its children.
7873  parent_index = child_index; // parent_hash remains correct.
7874  }
7875  }
7876 
7877  // Extract elements and create sorted array.
7878  for (int i = len - 1; i > 0; --i) {
7879  // Put max element at the back of the array.
7880  SwapSortedKeys(0, i);
7881  // Shift down the new top element.
7882  int parent_index = 0;
7883  const uint32_t parent_hash = GetSortedKey(parent_index)->Hash();
7884  const int max_parent_index = (i / 2) - 1;
7885  while (parent_index <= max_parent_index) {
7886  int child_index = parent_index * 2 + 1;
7887  uint32_t child_hash = GetSortedKey(child_index)->Hash();
7888  if (child_index + 1 < i) {
7889  uint32_t right_child_hash = GetSortedKey(child_index + 1)->Hash();
7890  if (right_child_hash > child_hash) {
7891  child_index++;
7892  child_hash = right_child_hash;
7893  }
7894  }
7895  if (child_hash <= parent_hash) break;
7896  SwapSortedKeys(parent_index, child_index);
7897  parent_index = child_index;
7898  }
7899  }
7900  DCHECK(IsSortedNoDuplicates());
7901 }
void SwapSortedKeys(int first, int second)
Definition: objects-inl.h:3078

References DCHECK.

Referenced by v8::internal::MarkCompactCollector::TrimDescriptorArray().

+ Here is the caller graph for this function:

◆ SwapSortedKeys()

void v8::internal::DescriptorArray::SwapSortedKeys ( int  first,
int  second 
)
inlineprivate

Definition at line 3078 of file objects-inl.h.

3078  {
3079  int first_key = GetSortedKeyIndex(first);
3080  SetSortedKey(first, GetSortedKeyIndex(second));
3081  SetSortedKey(second, first_key);
3082 }

References GetSortedKeyIndex(), and SetSortedKey().

+ Here is the call graph for this function:

◆ ToDetailsIndex()

static int v8::internal::DescriptorArray::ToDetailsIndex ( int  descriptor_number)
inlinestaticprivate

Definition at line 3101 of file objects.h.

3101  {
3102  return kFirstIndex +
3103  (descriptor_number * kDescriptorSize) +
3105  }
static const int kDescriptorDetails
Definition: objects.h:3036

Referenced by GetDetails(), Set(), SetRepresentation(), and SetSortedKey().

+ Here is the caller graph for this function:

◆ ToKeyIndex()

static int v8::internal::DescriptorArray::ToKeyIndex ( int  descriptor_number)
inlinestaticprivate

Definition at line 3095 of file objects.h.

3095  {
3096  return kFirstIndex +
3097  (descriptor_number * kDescriptorSize) +
3099  }
static const int kDescriptorKey
Definition: objects.h:3035

Referenced by GetKey(), GetKeySlot(), and Set().

+ Here is the caller graph for this function:

◆ ToValueIndex()

static int v8::internal::DescriptorArray::ToValueIndex ( int  descriptor_number)
inlinestaticprivate

Definition at line 3107 of file objects.h.

3107  {
3108  return kFirstIndex +
3109  (descriptor_number * kDescriptorSize) +
3111  }
static const int kDescriptorValue
Definition: objects.h:3037

Referenced by GetValue(), GetValueOffset(), GetValueSlot(), Set(), and SetValue().

+ Here is the caller graph for this function:

Member Data Documentation

◆ kDescriptorDetails

const int v8::internal::DescriptorArray::kDescriptorDetails = 1
static

Definition at line 3036 of file objects.h.

◆ kDescriptorKey

const int v8::internal::DescriptorArray::kDescriptorKey = 0
static

Definition at line 3035 of file objects.h.

◆ kDescriptorLengthIndex

const int v8::internal::DescriptorArray::kDescriptorLengthIndex = 0
static

Definition at line 3017 of file objects.h.

◆ kDescriptorLengthOffset

const int v8::internal::DescriptorArray::kDescriptorLengthOffset = FixedArray::kHeaderSize
static

Definition at line 3027 of file objects.h.

Referenced by SetNumberOfDescriptors().

◆ kDescriptorSize

const int v8::internal::DescriptorArray::kDescriptorSize = 3
static

Definition at line 3038 of file objects.h.

Referenced by v8::internal::MarkCompactCollector::TrimDescriptorArray().

◆ kDescriptorValue

const int v8::internal::DescriptorArray::kDescriptorValue = 2
static

Definition at line 3037 of file objects.h.

◆ kEnumCacheBridgeCacheIndex

const int v8::internal::DescriptorArray::kEnumCacheBridgeCacheIndex = 0
static

Definition at line 3023 of file objects.h.

◆ kEnumCacheBridgeCacheOffset

const int v8::internal::DescriptorArray::kEnumCacheBridgeCacheOffset = FixedArray::kHeaderSize
static

Definition at line 3032 of file objects.h.

◆ kEnumCacheBridgeIndicesCacheIndex

const int v8::internal::DescriptorArray::kEnumCacheBridgeIndicesCacheIndex = 1
static

Definition at line 3024 of file objects.h.

◆ kEnumCacheBridgeLength

const int v8::internal::DescriptorArray::kEnumCacheBridgeLength = 2
static

Definition at line 3022 of file objects.h.

Referenced by v8::internal::GetEnumPropertyKeys().

◆ kEnumCacheIndex

const int v8::internal::DescriptorArray::kEnumCacheIndex = 1
static

Definition at line 3018 of file objects.h.

◆ kEnumCacheOffset

const int v8::internal::DescriptorArray::kEnumCacheOffset = kDescriptorLengthOffset + kPointerSize
static

Definition at line 3028 of file objects.h.

◆ kFirstIndex

const int v8::internal::DescriptorArray::kFirstIndex = 2
static

Definition at line 3019 of file objects.h.

Referenced by IsEmpty().

◆ kFirstOffset

const int v8::internal::DescriptorArray::kFirstOffset = kEnumCacheOffset + kPointerSize
static

◆ kNotFound


The documentation for this class was generated from the following files: