V8 Project
v8::internal::SeededNumberDictionary Class Reference

#include <objects.h>

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

Public Member Functions

void UpdateMaxNumberKey (uint32_t key)
 
bool requires_slow_elements ()
 
void set_requires_slow_elements ()
 
uint32_t max_number_key ()
 
- Public Member Functions inherited from v8::internal::Dictionary< SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t >
ObjectValueAt (int entry)
 
void ValueAtPut (int entry, Object *value)
 
PropertyDetails DetailsAt (int entry)
 
void DetailsAtPut (int entry, PropertyDetails value)
 
void CopyValuesTo (FixedArray *elements)
 
int NumberOfElementsFilterAttributes (PropertyAttributes filter)
 
int NumberOfEnumElements ()
 
void CopyKeysTo (FixedArray *storage, PropertyAttributes filter, SortMode sort_mode)
 
void CopyKeysTo (FixedArray *storage, int index, PropertyAttributes filter, SortMode sort_mode)
 
void SetNextEnumerationIndex (int index)
 
int NextEnumerationIndex ()
 
ObjectSlowReverseLookup (Object *value)
 
void SetEntry (int entry, Handle< Object > key, Handle< Object > value)
 
void SetEntry (int entry, Handle< Object > key, Handle< Object > value, PropertyDetails details)
 
- Public Member Functions inherited from v8::internal::HashTable< Derived, Shape, Key >
uint32_t Hash (Key key)
 
uint32_t HashForObject (Key key, Object *object)
 
int NumberOfElements ()
 
int NumberOfDeletedElements ()
 
int Capacity ()
 
void ElementAdded ()
 
void ElementRemoved ()
 
void ElementsRemoved (int n)
 
ObjectKeyAt (int entry)
 
bool IsKey (Object *k)
 
void IteratePrefix (ObjectVisitor *visitor)
 
void IterateElements (ObjectVisitor *visitor)
 
 INLINE (static uint32_t GetProbeOffset(uint32_t n))
 
int FindEntry (Key key)
 
int FindEntry (Isolate *isolate, Key key)
 
void Rehash (Key key)
 
- 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 MUST_USE_RESULT Handle< SeededNumberDictionaryAtNumberPut (Handle< SeededNumberDictionary > dictionary, uint32_t key, Handle< Object > value)
 
static MUST_USE_RESULT Handle< SeededNumberDictionaryAddNumberEntry (Handle< SeededNumberDictionary > dictionary, uint32_t key, Handle< Object > value, PropertyDetails details)
 
static MUST_USE_RESULT Handle< SeededNumberDictionarySet (Handle< SeededNumberDictionary > dictionary, uint32_t key, Handle< Object > value, PropertyDetails details)
 
- Static Public Member Functions inherited from v8::internal::Dictionary< SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t >
static Handle< ObjectDeleteProperty (Handle< SeededNumberDictionary > dictionary, int entry, JSObject::DeleteMode mode)
 
static MUST_USE_RESULT Handle< SeededNumberDictionaryShrink (Handle< SeededNumberDictionary > dictionary, uint32_t key)
 
static MUST_USE_RESULT Handle< SeededNumberDictionaryNew (Isolate *isolate, int at_least_space_for, PretenureFlag pretenure=NOT_TENURED)
 
static Handle< SeededNumberDictionaryEnsureCapacity (Handle< SeededNumberDictionary > obj, int n, uint32_t key)
 
static MUST_USE_RESULT Handle< SeededNumberDictionaryAdd (Handle< SeededNumberDictionary > dictionary, uint32_t key, Handle< Object > value, PropertyDetails details)
 
- Static Public Member Functions inherited from v8::internal::HashTable< Derived, Shape, Key >
static MUST_USE_RESULT Handle< Derived > New (Isolate *isolate, int at_least_space_for, MinimumCapacity capacity_option=USE_DEFAULT_MINIMUM_CAPACITY, PretenureFlag pretenure=NOT_TENURED)
 
static int ComputeCapacity (int at_least_space_for)
 
- 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 kRequiresSlowElementsMask = 1
 
static const int kRequiresSlowElementsTagSize = 1
 
static const uint32_t kRequiresSlowElementsLimit = (1 << 29) - 1
 
- Static Public Attributes inherited from v8::internal::HashTable< Derived, Shape, Key >
static const int kNumberOfElementsIndex = 0
 
static const int kNumberOfDeletedElementsIndex = 1
 
static const int kCapacityIndex = 2
 
static const int kPrefixStartIndex = 3
 
static const int kElementsStartIndex
 
static const int kEntrySize = Shape::kEntrySize
 
static const int kElementsStartOffset
 
static const int kCapacityOffset
 
static const int kNotFound = -1
 
static const int kMaxCapacity
 
- 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
 

Additional Inherited Members

- Public Types inherited from v8::internal::Dictionary< SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t >
enum  SortMode
 
- 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 Types inherited from v8::internal::Dictionary< SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t >
typedef HashTable< SeededNumberDictionary, SeededNumberDictionaryShape, uint32_tDerivedHashTable
 
- Protected Member Functions inherited from v8::internal::HashTable< Derived, Shape, Key >
uint32_t FindInsertionEntry (uint32_t hash)
 
void SetNumberOfElements (int nof)
 
void SetNumberOfDeletedElements (int nod)
 
void SetCapacity (int capacity)
 
- 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::Dictionary< SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t >
static MUST_USE_RESULT Handle< SeededNumberDictionaryAtPut (Handle< SeededNumberDictionary > dictionary, uint32_t key, Handle< Object > value)
 
static void AddEntry (Handle< SeededNumberDictionary > dictionary, uint32_t key, Handle< Object > value, PropertyDetails details, uint32_t hash)
 
static void GenerateNewEnumerationIndices (Handle< SeededNumberDictionary > dictionary)
 
- Static Protected Member Functions inherited from v8::internal::HashTable< Derived, Shape, Key >
static int EntryToIndex (int entry)
 
static uint32_t GetProbe (uint32_t hash, uint32_t number, uint32_t size)
 
static uint32_t FirstProbe (uint32_t hash, uint32_t size)
 
static uint32_t NextProbe (uint32_t last, uint32_t number, uint32_t size)
 
static MUST_USE_RESULT Handle< Derived > Shrink (Handle< Derived > table, Key key)
 
static MUST_USE_RESULT Handle< Derived > EnsureCapacity (Handle< Derived > table, int n, Key key, PretenureFlag pretenure=NOT_TENURED)
 
- 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)
 
- Static Protected Attributes inherited from v8::internal::Dictionary< SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t >
static const int kMaxNumberKeyIndex
 
static const int kNextEnumerationIndexIndex
 

Detailed Description

Definition at line 3670 of file objects.h.

Member Function Documentation

◆ AddNumberEntry()

Handle< SeededNumberDictionary > v8::internal::SeededNumberDictionary::AddNumberEntry ( Handle< SeededNumberDictionary dictionary,
uint32_t  key,
Handle< Object value,
PropertyDetails  details 
)
static

Definition at line 15088 of file objects.cc.

15092  {
15093  dictionary->UpdateMaxNumberKey(key);
15094  SLOW_DCHECK(dictionary->FindEntry(key) == kNotFound);
15095  return Add(dictionary, key, value, details);
15096 }
#define SLOW_DCHECK(condition)
Definition: checks.h:30
static MUST_USE_RESULT Handle< SeededNumberDictionary > Add(Handle< SeededNumberDictionary > dictionary, uint32_t key, Handle< Object > value, PropertyDetails details)
Definition: objects.cc:15024
static const int kNotFound
Definition: objects.h:3283

References SLOW_DCHECK.

Referenced by v8::internal::CopyFastElementsToDictionary(), v8::internal::JSObject::PrepareSlowElementsForSort(), and v8::internal::JSObject::SetDictionaryElement().

+ Here is the caller graph for this function:

◆ AtNumberPut()

Handle< SeededNumberDictionary > v8::internal::SeededNumberDictionary::AtNumberPut ( Handle< SeededNumberDictionary dictionary,
uint32_t  key,
Handle< Object value 
)
static

Definition at line 15108 of file objects.cc.

15111  {
15112  dictionary->UpdateMaxNumberKey(key);
15113  return AtPut(dictionary, key, value);
15114 }
static MUST_USE_RESULT Handle< SeededNumberDictionary > AtPut(Handle< SeededNumberDictionary > dictionary, uint32_t key, Handle< Object > value)
Definition: objects.cc:15001

Referenced by v8::internal::ArrayConcatVisitor::SetDictionaryMode(), and v8::internal::ArrayConcatVisitor::visit().

+ Here is the caller graph for this function:

◆ max_number_key()

uint32_t v8::internal::SeededNumberDictionary::max_number_key ( )
inline

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

3142  {
3144  Object* max_index_object = get(kMaxNumberKeyIndex);
3145  if (!max_index_object->IsSmi()) return 0;
3146  uint32_t value = static_cast<uint32_t>(Smi::cast(max_index_object)->value());
3147  return value >> kRequiresSlowElementsTagSize;
3148 }
Object * get(int index)
Definition: objects-inl.h:2165
static const int kRequiresSlowElementsTagSize
Definition: objects.h:3713
#define DCHECK(condition)
Definition: logging.h:205
kSerializedDataOffset Object
Definition: objects-inl.h:5322

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

Referenced by v8::internal::CopyDictionaryToDoubleElements(), v8::internal::CopyDictionaryToObjectElements(), and v8::internal::JSObject::ShouldConvertToFastElements().

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

◆ requires_slow_elements()

bool v8::internal::SeededNumberDictionary::requires_slow_elements ( )
inline

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

3135  {
3136  Object* max_index_object = get(kMaxNumberKeyIndex);
3137  if (!max_index_object->IsSmi()) return false;
3138  return 0 !=
3139  (Smi::cast(max_index_object)->value() & kRequiresSlowElementsMask);
3140 }
static const int kRequiresSlowElementsMask
Definition: objects.h:3712

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

Referenced by v8::internal::JSObject::ShouldConvertToFastElements().

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

◆ Set()

Handle< SeededNumberDictionary > v8::internal::SeededNumberDictionary::Set ( Handle< SeededNumberDictionary dictionary,
uint32_t  key,
Handle< Object value,
PropertyDetails  details 
)
static

Definition at line 15125 of file objects.cc.

15129  {
15130  int entry = dictionary->FindEntry(key);
15131  if (entry == kNotFound) {
15132  return AddNumberEntry(dictionary, key, value, details);
15133  }
15134  // Preserve enumeration index.
15135  details = PropertyDetails(details.attributes(),
15136  details.type(),
15137  dictionary->DetailsAt(entry).dictionary_index());
15138  Handle<Object> object_key =
15139  SeededNumberDictionaryShape::AsHandle(dictionary->GetIsolate(), key);
15140  dictionary->SetEntry(entry, object_key, value, details);
15141  return dictionary;
15142 }
static Handle< Object > AsHandle(Isolate *isolate, uint32_t key)
Definition: objects-inl.h:6853
static MUST_USE_RESULT Handle< SeededNumberDictionary > AddNumberEntry(Handle< SeededNumberDictionary > dictionary, uint32_t key, Handle< Object > value, PropertyDetails details)
Definition: objects.cc:15088

References v8::internal::NumberDictionaryShape::AsHandle().

Referenced by v8::internal::JSObject::SetElementCallback().

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

◆ set_requires_slow_elements()

void v8::internal::SeededNumberDictionary::set_requires_slow_elements ( )
inline

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

3150  {
3152 }
void set(int index, Object *value)
Definition: objects-inl.h:2190
static Smi * FromInt(int value)
Definition: objects-inl.h:1321

References v8::internal::Smi::FromInt(), and v8::internal::FixedArray::set().

Referenced by v8::internal::JSObject::Freeze().

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

◆ UpdateMaxNumberKey()

void v8::internal::SeededNumberDictionary::UpdateMaxNumberKey ( uint32_t  key)

Definition at line 15068 of file objects.cc.

15068  {
15069  DisallowHeapAllocation no_allocation;
15070  // If the dictionary requires slow elements an element has already
15071  // been added at a high index.
15072  if (requires_slow_elements()) return;
15073  // Check if this index is high enough that we should require slow
15074  // elements.
15075  if (key > kRequiresSlowElementsLimit) {
15077  return;
15078  }
15079  // Update max key value.
15080  Object* max_index_object = get(kMaxNumberKeyIndex);
15081  if (!max_index_object->IsSmi() || max_number_key() < key) {
15084  }
15085 }
static const uint32_t kRequiresSlowElementsLimit
Definition: objects.h:3714
PerThreadAssertScopeDebugOnly< HEAP_ALLOCATION_ASSERT, false > DisallowHeapAllocation
Definition: assert-scope.h:110

References v8::internal::Smi::FromInt(), v8::internal::FixedArray::get(), and v8::internal::FixedArray::set().

+ Here is the call graph for this function:

Member Data Documentation

◆ kRequiresSlowElementsLimit

const uint32_t v8::internal::SeededNumberDictionary::kRequiresSlowElementsLimit = (1 << 29) - 1
static

Definition at line 3714 of file objects.h.

◆ kRequiresSlowElementsMask

const int v8::internal::SeededNumberDictionary::kRequiresSlowElementsMask = 1
static

Definition at line 3712 of file objects.h.

◆ kRequiresSlowElementsTagSize

const int v8::internal::SeededNumberDictionary::kRequiresSlowElementsTagSize = 1
static

Definition at line 3713 of file objects.h.


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