V8 Project
v8::internal::TransitionArray Class Reference

#include <transitions.h>

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

Public Member Functions

NameGetKey (int transition_number)
 
void SetKey (int transition_number, Name *value)
 
Object ** GetKeySlot (int transition_number)
 
int GetSortedKeyIndex (int transition_number)
 
NameGetSortedKey (int transition_number)
 
MapGetTarget (int transition_number)
 
void SetTarget (int transition_number, Map *target)
 
PropertyDetails GetTargetDetails (int transition_number)
 
bool HasElementsTransition ()
 
Objectback_pointer_storage ()
 
void set_back_pointer_storage (Object *back_pointer, WriteBarrierMode mode=UPDATE_WRITE_BARRIER)
 
FixedArrayGetPrototypeTransitions ()
 
void SetPrototypeTransitions (FixedArray *prototype_transitions, WriteBarrierMode mode=UPDATE_WRITE_BARRIER)
 
Object ** GetPrototypeTransitionsSlot ()
 
bool HasPrototypeTransitions ()
 
int number_of_transitions ()
 
int number_of_entries ()
 
int Search (Name *name)
 
bool IsSimpleTransition ()
 
bool IsFullTransitionArray ()
 
 STATIC_ASSERT (kSimpleTransitionIndex !=kNotFound)
 
- 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 Handle< TransitionArrayExtendToFullTransitionArray (Handle< Map > containing_map)
 
static Handle< TransitionArrayCopyInsert (Handle< Map > map, Handle< Name > name, Handle< Map > target, SimpleTransitionFlag flag)
 
static Handle< TransitionArrayAllocate (Isolate *isolate, int number_of_transitions)
 
static TransitionArraycast (Object *obj)
 
- 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 kBackPointerStorageIndex = 0
 
static const int kPrototypeTransitionsIndex = 1
 
static const int kFirstIndex = 2
 
static const int kSimpleTransitionTarget = 1
 
static const int kSimpleTransitionSize = 2
 
static const int kSimpleTransitionIndex = 0
 
static const int kBackPointerStorageOffset = FixedArray::kHeaderSize
 
static const int kPrototypeTransitionsOffset
 
static const int kTransitionKey = 0
 
static const int kTransitionTarget = 1
 
static const int kTransitionSize = 2
 
static const int kMaxNumberOfTransitions = 1024 + 512
 
- 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 NoIncrementalWriteBarrierSet (int transition_number, Name *key, Map *target)
 
void NoIncrementalWriteBarrierCopyFrom (TransitionArray *origin, int origin_transition, int target_transition)
 
 DISALLOW_IMPLICIT_CONSTRUCTORS (TransitionArray)
 

Static Private Member Functions

static int ToKeyIndex (int transition_number)
 
static int ToTargetIndex (int transition_number)
 
static Handle< TransitionArrayAllocateSimple (Isolate *isolate, Handle< Map > target)
 
static Handle< TransitionArrayNewWith (Handle< Map > map, Handle< Name > name, Handle< Map > target, SimpleTransitionFlag flag)
 

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 35 of file transitions.h.

Member Function Documentation

◆ Allocate()

Handle< TransitionArray > v8::internal::TransitionArray::Allocate ( Isolate isolate,
int  number_of_transitions 
)
static

Definition at line 15 of file transitions.cc.

16  {
17  Handle<FixedArray> array =
18  isolate->factory()->NewFixedArray(ToKeyIndex(number_of_transitions));
20  return Handle<TransitionArray>::cast(array);
21 }
static Handle< T > cast(Handle< S > that)
Definition: handles.h:116
static Smi * FromInt(int value)
Definition: objects-inl.h:1321
static int ToKeyIndex(int transition_number)
Definition: transitions.h:158
static const int kPrototypeTransitionsIndex
Definition: transitions.h:121

References v8::internal::Handle< T >::cast(), v8::internal::Isolate::factory(), v8::internal::Smi::FromInt(), kPrototypeTransitionsIndex, number_of_transitions(), and ToKeyIndex().

Referenced by CopyInsert(), v8::internal::EnsureHasTransitionArray(), ExtendToFullTransitionArray(), and NewWith().

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

◆ AllocateSimple()

Handle< TransitionArray > v8::internal::TransitionArray::AllocateSimple ( Isolate isolate,
Handle< Map target 
)
staticprivate

Definition at line 24 of file transitions.cc.

25  {
26  Handle<FixedArray> array =
27  isolate->factory()->NewFixedArray(kSimpleTransitionSize);
28  array->set(kSimpleTransitionTarget, *target);
29  return Handle<TransitionArray>::cast(array);
30 }
static const int kSimpleTransitionSize
Definition: transitions.h:126
static const int kSimpleTransitionTarget
Definition: transitions.h:125

References v8::internal::Handle< T >::cast(), v8::internal::Isolate::factory(), kSimpleTransitionSize, and kSimpleTransitionTarget.

Referenced by NewWith().

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

◆ back_pointer_storage()

Object * v8::internal::TransitionArray::back_pointer_storage ( )
inline

Definition at line 41 of file transitions-inl.h.

41  {
43 }
Object * get(int index)
Definition: objects-inl.h:2165
static const int kBackPointerStorageIndex
Definition: transitions.h:118

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

Referenced by CopyInsert(), v8::internal::V8HeapExplorer::ExtractMapReferences(), and v8::internal::Map::GetBackPointer().

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

◆ cast()

TransitionArray * v8::internal::TransitionArray::cast ( Object obj)
inlinestatic

Definition at line 30 of file transitions-inl.h.

30  {
31  DCHECK(object->IsTransitionArray());
32  return reinterpret_cast<TransitionArray*>(object);
33 }
#define DCHECK(condition)
Definition: logging.h:205

References DCHECK.

Referenced by v8::internal::Map::GetBackPointer(), and v8::internal::Map::SetBackPointer().

+ Here is the caller graph for this function:

◆ CopyInsert()

Handle< TransitionArray > v8::internal::TransitionArray::CopyInsert ( Handle< Map map,
Handle< Name name,
Handle< Map target,
SimpleTransitionFlag  flag 
)
static

Definition at line 88 of file transitions.cc.

91  {
92  if (!map->HasTransitionArray()) {
93  return TransitionArray::NewWith(map, name, target, flag);
94  }
95 
96  int number_of_transitions = map->transitions()->number_of_transitions();
97  int new_size = number_of_transitions;
98 
99  int insertion_index = map->transitions()->Search(*name);
100  if (insertion_index == kNotFound) ++new_size;
101 
102  Handle<TransitionArray> result = Allocate(map->GetIsolate(), new_size);
103 
104  // The map's transition array may grown smaller during the allocation above as
105  // it was weakly traversed, though it is guaranteed not to disappear. Trim the
106  // result copy if needed, and recompute variables.
109  TransitionArray* array = map->transitions();
110  if (array->number_of_transitions() != number_of_transitions) {
111  DCHECK(array->number_of_transitions() < number_of_transitions);
112 
113  number_of_transitions = array->number_of_transitions();
114  new_size = number_of_transitions;
115 
116  insertion_index = array->Search(*name);
117  if (insertion_index == kNotFound) ++new_size;
118 
119  result->Shrink(ToKeyIndex(new_size));
120  }
121 
122  if (array->HasPrototypeTransitions()) {
123  result->SetPrototypeTransitions(array->GetPrototypeTransitions());
124  }
125 
126  if (insertion_index != kNotFound) {
127  for (int i = 0; i < number_of_transitions; ++i) {
128  if (i != insertion_index) {
129  result->NoIncrementalWriteBarrierCopyFrom(array, i, i);
130  }
131  }
132  result->NoIncrementalWriteBarrierSet(insertion_index, *name, *target);
133  result->set_back_pointer_storage(array->back_pointer_storage());
134  return result;
135  }
136 
137  insertion_index = 0;
138  for (; insertion_index < number_of_transitions; ++insertion_index) {
139  if (InsertionPointFound(array->GetKey(insertion_index), *name)) break;
140  result->NoIncrementalWriteBarrierCopyFrom(
141  array, insertion_index, insertion_index);
142  }
143 
144  result->NoIncrementalWriteBarrierSet(insertion_index, *name, *target);
145 
146  for (; insertion_index < number_of_transitions; ++insertion_index) {
147  result->NoIncrementalWriteBarrierCopyFrom(
148  array, insertion_index, insertion_index + 1);
149  }
150 
151  result->set_back_pointer_storage(array->back_pointer_storage());
152  return result;
153 }
Isolate * GetIsolate() const
Definition: objects-inl.h:1387
bool HasTransitionArray() const
Definition: objects-inl.h:5150
static const int kNotFound
Definition: transitions.h:116
static Handle< TransitionArray > NewWith(Handle< Map > map, Handle< Name > name, Handle< Map > target, SimpleTransitionFlag flag)
Definition: transitions.cc:47
static Handle< TransitionArray > Allocate(Isolate *isolate, int number_of_transitions)
Definition: transitions.cc:15
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 enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in name
PerThreadAssertScopeDebugOnly< HEAP_ALLOCATION_ASSERT, false > DisallowHeapAllocation
Definition: assert-scope.h:110
kFeedbackVectorOffset flag
Definition: objects-inl.h:5418
static bool InsertionPointFound(Name *key1, Name *key2)
Definition: transitions.cc:42

References Allocate(), back_pointer_storage(), DCHECK, v8::internal::flag, v8::internal::HeapObject::GetIsolate(), GetKey(), GetPrototypeTransitions(), HasPrototypeTransitions(), v8::internal::Map::HasTransitionArray(), v8::internal::InsertionPointFound(), kNotFound, v8::internal::HeapObject::map(), name, NewWith(), number_of_transitions(), Search(), and ToKeyIndex().

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

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

◆ DISALLOW_IMPLICIT_CONSTRUCTORS()

v8::internal::TransitionArray::DISALLOW_IMPLICIT_CONSTRUCTORS ( TransitionArray  )
private

◆ ExtendToFullTransitionArray()

Handle< TransitionArray > v8::internal::TransitionArray::ExtendToFullTransitionArray ( Handle< Map containing_map)
static

Definition at line 65 of file transitions.cc.

66  {
67  DCHECK(!containing_map->transitions()->IsFullTransitionArray());
68  int nof = containing_map->transitions()->number_of_transitions();
69 
70  // A transition array may shrink during GC.
71  Handle<TransitionArray> result = Allocate(containing_map->GetIsolate(), nof);
73  int new_nof = containing_map->transitions()->number_of_transitions();
74  if (new_nof != nof) {
75  DCHECK(new_nof == 0);
76  result->Shrink(ToKeyIndex(0));
77  } else if (nof == 1) {
78  result->NoIncrementalWriteBarrierCopyFrom(
79  containing_map->transitions(), kSimpleTransitionIndex, 0);
80  }
81 
82  result->set_back_pointer_storage(
83  containing_map->transitions()->back_pointer_storage());
84  return result;
85 }
static const int kSimpleTransitionIndex
Definition: transitions.h:127

References Allocate(), DCHECK, kSimpleTransitionIndex, and ToKeyIndex().

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

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

◆ GetKey()

Name * v8::internal::TransitionArray::GetKey ( int  transition_number)
inline

Definition at line 92 of file transitions-inl.h.

92  {
93  if (IsSimpleTransition()) {
94  Map* target = GetTarget(kSimpleTransitionIndex);
95  int descriptor = target->LastAdded();
96  Name* key = target->instance_descriptors()->GetKey(descriptor);
97  return key;
98  }
99  DCHECK(transition_number < number_of_transitions());
100  return Name::cast(get(ToKeyIndex(transition_number)));
101 }
Map * GetTarget(int transition_number)

References DCHECK, v8::internal::FixedArray::get(), GetTarget(), IsSimpleTransition(), kSimpleTransitionIndex, v8::internal::Map::LastAdded(), number_of_transitions(), and ToKeyIndex().

Referenced by v8::internal::MarkCompactCollector::ClearMapTransitions(), CopyInsert(), v8::internal::Map::ExpectedTransitionKey(), GetSortedKey(), NoIncrementalWriteBarrierCopyFrom(), and Search().

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

◆ GetKeySlot()

Object ** v8::internal::TransitionArray::GetKeySlot ( int  transition_number)
inline

Definition at line 85 of file transitions-inl.h.

85  {
87  DCHECK(transition_number < number_of_transitions());
88  return RawFieldOfElementAt(ToKeyIndex(transition_number));
89 }
Object ** RawFieldOfElementAt(int index)
Definition: objects.h:2458

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

Referenced by v8::internal::MarkCompactCollector::ClearMapTransitions(), and v8::internal::StaticMarkingVisitor< StaticVisitor >::MarkTransitionArray().

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

◆ GetPrototypeTransitions()

FixedArray * v8::internal::TransitionArray::GetPrototypeTransitions ( )
inline

Definition at line 61 of file transitions-inl.h.

61  {
63  Object* prototype_transitions = get(kPrototypeTransitionsIndex);
64  return FixedArray::cast(prototype_transitions);
65 }
kSerializedDataOffset Object
Definition: objects-inl.h:5322

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

Referenced by v8::internal::TraversableMap::ChildIteratorNext(), CopyInsert(), and v8::internal::V8HeapExplorer::ExtractMapReferences().

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

◆ GetPrototypeTransitionsSlot()

Object ** v8::internal::TransitionArray::GetPrototypeTransitionsSlot ( )
inline

Definition at line 79 of file transitions-inl.h.

79  {
80  return HeapObject::RawField(reinterpret_cast<HeapObject*>(this),
82 }
static Object ** RawField(HeapObject *obj, int offset)
Definition: objects-inl.h:1311
static const int kPrototypeTransitionsOffset
Definition: transitions.h:133

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

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

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

◆ GetSortedKey()

Name* v8::internal::TransitionArray::GetSortedKey ( int  transition_number)
inline

Definition at line 43 of file transitions.h.

43  {
44  return GetKey(transition_number);
45  }
Name * GetKey(int transition_number)

References GetKey().

+ Here is the call graph for this function:

◆ GetSortedKeyIndex()

int v8::internal::TransitionArray::GetSortedKeyIndex ( int  transition_number)
inline

Definition at line 41 of file transitions.h.

41 { return transition_number; }

◆ GetTarget()

Map * v8::internal::TransitionArray::GetTarget ( int  transition_number)
inline

Definition at line 111 of file transitions-inl.h.

111  {
112  if (IsSimpleTransition()) {
113  DCHECK(transition_number == kSimpleTransitionIndex);
114  return Map::cast(get(kSimpleTransitionTarget));
115  }
116  DCHECK(transition_number < number_of_transitions());
117  return Map::cast(get(ToTargetIndex(transition_number)));
118 }
static int ToTargetIndex(int transition_number)
Definition: transitions.h:164

References DCHECK, v8::internal::FixedArray::get(), IsSimpleTransition(), kSimpleTransitionIndex, kSimpleTransitionTarget, number_of_transitions(), and ToTargetIndex().

Referenced by v8::internal::MarkCompactCollector::ClearMapTransitions(), v8::internal::Map::DeprecateTarget(), v8::internal::Map::DeprecateTransitionTree(), v8::internal::Map::FindLastMatchMap(), v8::internal::Map::FindTransitionToField(), GetKey(), GetTargetDetails(), NoIncrementalWriteBarrierCopyFrom(), and v8::internal::Map::UpdateFieldType().

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

◆ GetTargetDetails()

PropertyDetails v8::internal::TransitionArray::GetTargetDetails ( int  transition_number)
inline

Definition at line 131 of file transitions-inl.h.

131  {
132  Map* map = GetTarget(transition_number);
133  return map->GetLastDescriptorDetails();
134 }
PropertyDetails GetLastDescriptorDetails()
Definition: objects-inl.h:2867

References v8::internal::Map::GetLastDescriptorDetails(), GetTarget(), and v8::internal::HeapObject::map().

Referenced by v8::internal::Map::ExpectedTransitionKey(), and v8::internal::Map::FindTransitionToField().

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

◆ HasElementsTransition()

bool v8::internal::TransitionArray::HasElementsTransition ( )
inline

Definition at line 36 of file transitions-inl.h.

36  {
37  return Search(GetHeap()->elements_transition_symbol()) != kNotFound;
38 }
Heap * GetHeap() const
Definition: objects-inl.h:1379

References v8::internal::HeapObject::GetHeap(), kNotFound, and Search().

+ Here is the call graph for this function:

◆ HasPrototypeTransitions()

bool v8::internal::TransitionArray::HasPrototypeTransitions ( )
inline

Definition at line 55 of file transitions-inl.h.

55  {
56  return IsFullTransitionArray() &&
58 }

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

Referenced by v8::internal::TraversableMap::ChildIteratorNext(), CopyInsert(), v8::internal::V8HeapExplorer::ExtractMapReferences(), and v8::internal::StaticMarkingVisitor< StaticVisitor >::MarkTransitionArray().

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

◆ IsFullTransitionArray()

bool v8::internal::TransitionArray::IsFullTransitionArray ( )
inline

Definition at line 107 of file transitions.h.

107  {
108  return length() > kFirstIndex ||
110  }
static const int kFirstIndex
Definition: transitions.h:122

References IsSimpleTransition(), kFirstIndex, and v8::internal::FixedArrayBase::length().

Referenced by GetPrototypeTransitions(), HasPrototypeTransitions(), and SetPrototypeTransitions().

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

◆ IsSimpleTransition()

bool v8::internal::TransitionArray::IsSimpleTransition ( )
inline

Definition at line 96 of file transitions.h.

96  {
97  return length() == kSimpleTransitionSize &&
98  get(kSimpleTransitionTarget)->IsHeapObject() &&
99  // The IntrusivePrototypeTransitionIterator may have set the map of the
100  // prototype transitions array to a smi. In that case, there are
101  // prototype transitions, hence this transition array is a full
102  // transition array.
103  HeapObject::cast(get(kSimpleTransitionTarget))->map()->IsMap() &&
104  get(kSimpleTransitionTarget)->IsMap();
105  }

References v8::internal::FixedArray::get(), kSimpleTransitionSize, kSimpleTransitionTarget, and v8::internal::FixedArrayBase::length().

Referenced by v8::internal::MarkCompactCollector::ClearMapTransitions(), v8::internal::Map::ExpectedTransitionKey(), v8::internal::V8HeapExplorer::ExtractMapReferences(), GetKey(), GetKeySlot(), GetTarget(), IsFullTransitionArray(), v8::internal::StaticMarkingVisitor< StaticVisitor >::MarkTransitionArray(), number_of_transitions(), Search(), SetKey(), and SetTarget().

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

◆ NewWith()

Handle< TransitionArray > v8::internal::TransitionArray::NewWith ( Handle< Map map,
Handle< Name name,
Handle< Map target,
SimpleTransitionFlag  flag 
)
staticprivate

Definition at line 47 of file transitions.cc.

50  {
51  Handle<TransitionArray> result;
52  Isolate* isolate = name->GetIsolate();
53 
54  if (flag == SIMPLE_TRANSITION) {
55  result = AllocateSimple(isolate, target);
56  } else {
57  result = Allocate(isolate, 1);
58  result->NoIncrementalWriteBarrierSet(0, *name, *target);
59  }
60  result->set_back_pointer_storage(map->GetBackPointer());
61  return result;
62 }
Object * GetBackPointer()
Definition: objects-inl.h:5134
static Handle< TransitionArray > AllocateSimple(Isolate *isolate, Handle< Map > target)
Definition: transitions.cc:24
@ SIMPLE_TRANSITION
Definition: objects.h:278

References Allocate(), AllocateSimple(), v8::internal::flag, v8::internal::Map::GetBackPointer(), v8::internal::HeapObject::map(), name, and v8::internal::SIMPLE_TRANSITION.

Referenced by CopyInsert().

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

◆ NoIncrementalWriteBarrierCopyFrom()

void v8::internal::TransitionArray::NoIncrementalWriteBarrierCopyFrom ( TransitionArray origin,
int  origin_transition,
int  target_transition 
)
inlineprivate

Definition at line 33 of file transitions.cc.

35  {
36  NoIncrementalWriteBarrierSet(target_transition,
37  origin->GetKey(origin_transition),
38  origin->GetTarget(origin_transition));
39 }
void NoIncrementalWriteBarrierSet(int transition_number, Name *key, Map *target)

References GetKey(), GetTarget(), and NoIncrementalWriteBarrierSet().

+ Here is the call graph for this function:

◆ NoIncrementalWriteBarrierSet()

void v8::internal::TransitionArray::NoIncrementalWriteBarrierSet ( int  transition_number,
Name key,
Map target 
)
inlineprivate

Definition at line 147 of file transitions-inl.h.

149  {
151  this, ToKeyIndex(transition_number), key);
153  this, ToTargetIndex(transition_number), target);
154 }
static void NoIncrementalWriteBarrierSet(FixedArray *array, int index, Object *value)
Definition: objects-inl.h:2680

References v8::internal::FixedArray::NoIncrementalWriteBarrierSet(), ToKeyIndex(), and ToTargetIndex().

Referenced by NoIncrementalWriteBarrierCopyFrom().

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

◆ number_of_entries()

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

Definition at line 73 of file transitions.h.

73 { return number_of_transitions(); }

References number_of_transitions().

+ Here is the call graph for this function:

◆ number_of_transitions()

int v8::internal::TransitionArray::number_of_transitions ( )
inline

Definition at line 67 of file transitions.h.

67  {
68  if (IsSimpleTransition()) return 1;
69  int len = length();
70  return len <= kFirstIndex ? 0 : (len - kFirstIndex) / kTransitionSize;
71  }
static const int kTransitionSize
Definition: transitions.h:139

References IsSimpleTransition(), kFirstIndex, kTransitionSize, and v8::internal::FixedArrayBase::length().

Referenced by Allocate(), v8::internal::MarkCompactCollector::ClearMapTransitions(), CopyInsert(), v8::internal::Map::DeprecateTransitionTree(), GetKey(), GetKeySlot(), GetTarget(), v8::internal::StaticMarkingVisitor< StaticVisitor >::MarkTransitionArray(), number_of_entries(), SetKey(), SetTarget(), and v8::internal::Map::UpdateFieldType().

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

◆ Search()

int v8::internal::TransitionArray::Search ( Name name)
inline

Definition at line 137 of file transitions-inl.h.

137  {
138  if (IsSimpleTransition()) {
139  Name* key = GetKey(kSimpleTransitionIndex);
140  if (key->Equals(name)) return kSimpleTransitionIndex;
141  return kNotFound;
142  }
143  return internal::Search<ALL_ENTRIES>(this, name);
144 }

References v8::internal::Name::Equals(), GetKey(), IsSimpleTransition(), kNotFound, kSimpleTransitionIndex, and name.

Referenced by CopyInsert(), v8::internal::Map::DeprecateTarget(), v8::internal::Map::FindLastMatchMap(), v8::internal::Map::FindTransitionToField(), and HasElementsTransition().

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

◆ set_back_pointer_storage()

void v8::internal::TransitionArray::set_back_pointer_storage ( Object back_pointer,
WriteBarrierMode  mode = UPDATE_WRITE_BARRIER 
)
inline

Definition at line 46 of file transitions-inl.h.

47  {
48  Heap* heap = GetHeap();
49  WRITE_FIELD(this, kBackPointerStorageOffset, back_pointer);
51  heap, this, kBackPointerStorageOffset, back_pointer, mode);
52 }
static const int kBackPointerStorageOffset
Definition: transitions.h:130
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
#define WRITE_FIELD(p, offset, value)
#define CONDITIONAL_WRITE_BARRIER(heap, object, offset, value, mode)

References CONDITIONAL_WRITE_BARRIER, v8::internal::HeapObject::GetHeap(), kBackPointerStorageOffset, mode(), and WRITE_FIELD.

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

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

◆ SetKey()

void v8::internal::TransitionArray::SetKey ( int  transition_number,
Name value 
)
inline

Definition at line 104 of file transitions-inl.h.

104  {
106  DCHECK(transition_number < number_of_transitions());
107  set(ToKeyIndex(transition_number), key);
108 }
void set(int index, Object *value)
Definition: objects-inl.h:2190

References DCHECK, IsSimpleTransition(), number_of_transitions(), v8::internal::FixedArray::set(), and ToKeyIndex().

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

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

◆ SetPrototypeTransitions()

void v8::internal::TransitionArray::SetPrototypeTransitions ( FixedArray prototype_transitions,
WriteBarrierMode  mode = UPDATE_WRITE_BARRIER 
)
inline

Definition at line 68 of file transitions-inl.h.

69  {
71  DCHECK(transitions->IsFixedArray());
72  Heap* heap = GetHeap();
73  WRITE_FIELD(this, kPrototypeTransitionsOffset, transitions);
75  heap, this, kPrototypeTransitionsOffset, transitions, mode);
76 }

References CONDITIONAL_WRITE_BARRIER, DCHECK, v8::internal::HeapObject::GetHeap(), IsFullTransitionArray(), kPrototypeTransitionsOffset, mode(), and WRITE_FIELD.

+ Here is the call graph for this function:

◆ SetTarget()

void v8::internal::TransitionArray::SetTarget ( int  transition_number,
Map target 
)
inline

Definition at line 121 of file transitions-inl.h.

121  {
122  if (IsSimpleTransition()) {
123  DCHECK(transition_number == kSimpleTransitionIndex);
124  return set(kSimpleTransitionTarget, value);
125  }
126  DCHECK(transition_number < number_of_transitions());
127  set(ToTargetIndex(transition_number), value);
128 }

References DCHECK, IsSimpleTransition(), kSimpleTransitionIndex, kSimpleTransitionTarget, number_of_transitions(), v8::internal::FixedArray::set(), and ToTargetIndex().

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

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

◆ STATIC_ASSERT()

v8::internal::TransitionArray::STATIC_ASSERT ( kSimpleTransitionIndex = kNotFound)

◆ ToKeyIndex()

static int v8::internal::TransitionArray::ToKeyIndex ( int  transition_number)
inlinestaticprivate

Definition at line 158 of file transitions.h.

158  {
159  return kFirstIndex +
160  (transition_number * kTransitionSize) +
162  }
static const int kTransitionKey
Definition: transitions.h:137

References kFirstIndex, kTransitionKey, and kTransitionSize.

Referenced by Allocate(), CopyInsert(), ExtendToFullTransitionArray(), GetKey(), GetKeySlot(), NoIncrementalWriteBarrierSet(), and SetKey().

+ Here is the caller graph for this function:

◆ ToTargetIndex()

static int v8::internal::TransitionArray::ToTargetIndex ( int  transition_number)
inlinestaticprivate

Definition at line 164 of file transitions.h.

164  {
165  return kFirstIndex +
166  (transition_number * kTransitionSize) +
168  }
static const int kTransitionTarget
Definition: transitions.h:138

References kFirstIndex, kTransitionSize, and kTransitionTarget.

Referenced by GetTarget(), NoIncrementalWriteBarrierSet(), and SetTarget().

+ Here is the caller graph for this function:

Member Data Documentation

◆ kBackPointerStorageIndex

const int v8::internal::TransitionArray::kBackPointerStorageIndex = 0
static

Definition at line 118 of file transitions.h.

Referenced by back_pointer_storage().

◆ kBackPointerStorageOffset

const int v8::internal::TransitionArray::kBackPointerStorageOffset = FixedArray::kHeaderSize
static

Definition at line 130 of file transitions.h.

Referenced by set_back_pointer_storage().

◆ kFirstIndex

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

◆ kMaxNumberOfTransitions

const int v8::internal::TransitionArray::kMaxNumberOfTransitions = 1024 + 512
static

Definition at line 154 of file transitions.h.

◆ kNotFound

◆ kPrototypeTransitionsIndex

const int v8::internal::TransitionArray::kPrototypeTransitionsIndex = 1
static

Definition at line 121 of file transitions.h.

Referenced by Allocate(), GetPrototypeTransitions(), and HasPrototypeTransitions().

◆ kPrototypeTransitionsOffset

const int v8::internal::TransitionArray::kPrototypeTransitionsOffset
static
Initial value:

Definition at line 133 of file transitions.h.

Referenced by GetPrototypeTransitionsSlot(), and SetPrototypeTransitions().

◆ kSimpleTransitionIndex

const int v8::internal::TransitionArray::kSimpleTransitionIndex = 0
static

◆ kSimpleTransitionSize

const int v8::internal::TransitionArray::kSimpleTransitionSize = 2
static

Definition at line 126 of file transitions.h.

Referenced by AllocateSimple(), and IsSimpleTransition().

◆ kSimpleTransitionTarget

const int v8::internal::TransitionArray::kSimpleTransitionTarget = 1
static

Definition at line 125 of file transitions.h.

Referenced by AllocateSimple(), GetTarget(), IsSimpleTransition(), and SetTarget().

◆ kTransitionKey

const int v8::internal::TransitionArray::kTransitionKey = 0
static

Definition at line 137 of file transitions.h.

Referenced by ToKeyIndex().

◆ kTransitionSize

const int v8::internal::TransitionArray::kTransitionSize = 2
static

◆ kTransitionTarget

const int v8::internal::TransitionArray::kTransitionTarget = 1
static

Definition at line 138 of file transitions.h.

Referenced by ToTargetIndex().


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