|
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) |
|
Object * | KeyAt (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) |
|
Object * | get (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) |
|
int | length () const |
|
void | set_length (int value) |
|
int | synchronized_length () const |
|
void | synchronized_set_length (int value) |
|
Map * | map () const |
|
void | set_map (Map *value) |
|
void | set_map_no_write_barrier (Map *value) |
|
Map * | synchronized_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) |
|
Heap * | GetHeap () const |
|
Isolate * | GetIsolate () 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) |
|
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< HeapType > | OptimalType (Isolate *isolate, Representation representation) |
|
bool | HasValidElements () |
|
bool | HasSpecificClassOf (String *name) |
|
bool | BooleanValue () |
|
Object * | GetHash () |
|
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 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 Handle< Object > | get (Handle< FixedArray > array, int index) |
|
static Handle< FixedArray > | CopySize (Handle< FixedArray > array, int new_length, PretenureFlag pretenure=NOT_TENURED) |
|
static MUST_USE_RESULT MaybeHandle< FixedArray > | AddKeysFromArrayLike (Handle< FixedArray > content, Handle< JSObject > array) |
|
static MUST_USE_RESULT MaybeHandle< FixedArray > | UnionOfKeys (Handle< FixedArray > first, Handle< FixedArray > second) |
|
static int | SizeFor (int length) |
|
static int | OffsetOfElementAt (int index) |
|
static HeapObject * | FromAddress (Address address) |
|
static Object ** | RawField (HeapObject *obj, int offset) |
|
static void | UpdateMapCodeCache (Handle< HeapObject > object, Handle< Name > name, Handle< Code > code) |
|
static Handle< Object > | NewStorageFor (Isolate *isolate, Handle< Object > object, Representation representation) |
|
static Handle< Object > | WrapForRead (Isolate *isolate, Handle< Object > object, Representation representation) |
|
static MaybeHandle< JSReceiver > | ToObject (Isolate *isolate, Handle< Object > object) |
|
static MaybeHandle< JSReceiver > | ToObject (Isolate *isolate, Handle< Object > object, Handle< Context > context) |
|
static MUST_USE_RESULT MaybeHandle< Smi > | ToSmi (Isolate *isolate, Handle< Object > object) |
|
static MUST_USE_RESULT MaybeHandle< Object > | GetProperty (LookupIterator *it) |
|
static MUST_USE_RESULT MaybeHandle< Object > | SetProperty (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< Object > | SetProperty (LookupIterator *it, Handle< Object > value, StrictMode strict_mode, StoreFromKeyed store_mode, StorePropertyMode data_store_mode=NORMAL_PROPERTY) |
|
static MUST_USE_RESULT MaybeHandle< Object > | WriteToReadOnlyProperty (LookupIterator *it, Handle< Object > value, StrictMode strict_mode) |
|
static Handle< Object > | SetDataProperty (LookupIterator *it, Handle< Object > value) |
|
static MUST_USE_RESULT MaybeHandle< Object > | AddDataProperty (LookupIterator *it, Handle< Object > value, PropertyAttributes attributes, StrictMode strict_mode, StoreFromKeyed store_mode) |
|
static MUST_USE_RESULT MaybeHandle< Object > | GetPropertyOrElement (Handle< Object > object, Handle< Name > key) |
|
static MUST_USE_RESULT MaybeHandle< Object > | GetProperty (Isolate *isolate, Handle< Object > object, const char *key) |
|
static MUST_USE_RESULT MaybeHandle< Object > | GetProperty (Handle< Object > object, Handle< Name > key) |
|
static MUST_USE_RESULT MaybeHandle< Object > | GetPropertyWithAccessor (Handle< Object > receiver, Handle< Name > name, Handle< JSObject > holder, Handle< Object > structure) |
|
static MUST_USE_RESULT MaybeHandle< Object > | SetPropertyWithAccessor (Handle< Object > receiver, Handle< Name > name, Handle< Object > value, Handle< JSObject > holder, Handle< Object > structure, StrictMode strict_mode) |
|
static MUST_USE_RESULT MaybeHandle< Object > | GetPropertyWithDefinedGetter (Handle< Object > receiver, Handle< JSReceiver > getter) |
|
static MUST_USE_RESULT MaybeHandle< Object > | SetPropertyWithDefinedSetter (Handle< Object > receiver, Handle< JSReceiver > setter, Handle< Object > value) |
|
static MUST_USE_RESULT MaybeHandle< Object > | GetElement (Isolate *isolate, Handle< Object > object, uint32_t index) |
|
static MUST_USE_RESULT MaybeHandle< Object > | GetElementWithReceiver (Isolate *isolate, Handle< Object > object, Handle< Object > receiver, uint32_t index) |
|
static Handle< Smi > | GetOrCreateHash (Isolate *isolate, Handle< Object > object) |
|
template<typename Derived, typename Shape, typename Key>
class v8::internal::HashTable< Derived, Shape, Key >
Definition at line 3190 of file objects.h.
template<typename Derived , typename Shape , typename Key >
Definition at line 13928 of file objects.cc.
13933 Isolate* isolate = table->GetIsolate();
13934 int capacity = table->Capacity();
13935 int nof = table->NumberOfElements() + n;
13936 int nod = table->NumberOfDeletedElements();
13940 if (nod <= (capacity - nof) >> 1) {
13941 int needed_free = nof >> 1;
13942 if (nof + needed_free <= capacity)
return table;
13945 const int kMinCapacityForPretenure = 256;
13946 bool should_pretenure = pretenure ==
TENURED ||
13947 ((capacity > kMinCapacityForPretenure) &&
13948 !isolate->heap()->InNewSpace(*table));
13955 table->Rehash(new_table, 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)
@ USE_DEFAULT_MINIMUM_CAPACITY
References v8::internal::Isolate::heap(), v8::internal::Heap::InNewSpace(), v8::internal::HashTable< Derived, Shape, Key >::New(), v8::internal::NOT_TENURED, v8::internal::TENURED, and v8::internal::USE_DEFAULT_MINIMUM_CAPACITY.
template<typename Derived , typename Shape , typename Key >
Definition at line 13756 of file objects.cc.
13761 DCHECK(0 <= at_least_space_for);
13764 ? at_least_space_for
13770 Factory* factory = isolate->factory();
13772 Handle<FixedArray> array = factory->NewFixedArray(
length, pretenure);
13773 array->set_map_no_write_barrier(*factory->hash_table_map());
13776 table->SetNumberOfElements(0);
13777 table->SetNumberOfDeletedElements(0);
13778 table->SetCapacity(capacity);
static Handle< T > cast(Handle< S > that)
static int ComputeCapacity(int at_least_space_for)
static const int kMaxCapacity
static void FatalProcessOutOfMemory(const char *location, bool take_snapshot=false)
@ USE_CUSTOM_MINIMUM_CAPACITY
References v8::internal::Handle< T >::cast(), DCHECK, v8::internal::Isolate::factory(), v8::internal::Heap::FatalProcessOutOfMemory(), v8::base::bits::IsPowerOfTwo32(), v8::internal::HashTable< Derived, Shape, Key >::kMaxCapacity, v8::internal::FixedArrayBase::length(), and v8::internal::USE_CUSTOM_MINIMUM_CAPACITY.
Referenced by v8::internal::HashTable< Derived, Shape, Key >::EnsureCapacity(), and v8::internal::HashTable< Derived, Shape, Key >::Shrink().
template<typename Derived , typename Shape , typename Key >
Definition at line 13824 of file objects.cc.
13841 for (
int i = 0;
i < capacity;
i++) {
13848 for (
int j = 0; j < Shape::kEntrySize; j++) {
13849 new_table->set(insertion_index + j,
get(from_index + j),
mode);
13854 new_table->SetNumberOfDeletedElements(0);
static const int kPrefixStartIndex
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long mode(MIPS only)") DEFINE_BOOL(enable_always_align_csp
PerThreadAssertScopeDebugOnly< HEAP_ALLOCATION_ASSERT, false > DisallowHeapAllocation
References DCHECK, v8::internal::FixedArray::get(), v8::internal::HashTable< Derived, Shape, Key >::HashForObject(), and mode().
template<typename Derived , typename Shape , typename Key >