V8 Project
v8::internal::Map Class Reference

#include <objects.h>

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

Classes

class  ConstructionCount
 
class  Deprecated
 
class  DictionaryMap
 
class  DoneInobjectSlackTracking
 
class  ElementsKindBits
 
class  EnumLengthBits
 
class  FunctionWithPrototype
 
class  HasInstanceCallHandler
 
class  IsFrozen
 
class  IsMigrationTarget
 
class  IsPrototypeMapBits
 
class  IsUnstable
 
class  NumberOfOwnDescriptorsBits
 
class  OwnsDescriptors
 

Public Types

typedef void(* TraverseCallback) (Map *map, void *data)
 
typedef FixedBodyDescriptor< kPointerFieldsBeginOffset, kPointerFieldsEndOffset, kSizeBodyDescriptor
 
- 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 }
 

Public Member Functions

int instance_size ()
 
void set_instance_size (int value)
 
int inobject_properties ()
 
void set_inobject_properties (int value)
 
int pre_allocated_property_fields ()
 
void set_pre_allocated_property_fields (int value)
 
InstanceType instance_type ()
 
void set_instance_type (InstanceType value)
 
int unused_property_fields ()
 
void set_unused_property_fields (int value)
 
byte bit_field ()
 
void set_bit_field (byte value)
 
byte bit_field2 ()
 
void set_bit_field2 (byte value)
 
uint32_t bit_field3 ()
 
void set_bit_field3 (uint32_t bits)
 
 STATIC_ASSERT (kDescriptorIndexBitCount+kDescriptorIndexBitCount==20)
 
void set_non_instance_prototype (bool value)
 
bool has_non_instance_prototype ()
 
void set_function_with_prototype (bool value)
 
bool function_with_prototype ()
 
void set_is_hidden_prototype ()
 
bool is_hidden_prototype ()
 
void set_has_named_interceptor ()
 
bool has_named_interceptor ()
 
void set_has_indexed_interceptor ()
 
bool has_indexed_interceptor ()
 
void set_is_undetectable ()
 
bool is_undetectable ()
 
void set_is_observed ()
 
bool is_observed ()
 
void set_is_extensible (bool value)
 
bool is_extensible ()
 
void set_is_prototype_map (bool value)
 
bool is_prototype_map ()
 
void set_elements_kind (ElementsKind elements_kind)
 
ElementsKind elements_kind ()
 
bool has_fast_smi_elements ()
 
bool has_fast_object_elements ()
 
bool has_fast_smi_or_object_elements ()
 
bool has_fast_double_elements ()
 
bool has_fast_elements ()
 
bool has_sloppy_arguments_elements ()
 
bool has_external_array_elements ()
 
bool has_fixed_typed_array_elements ()
 
bool has_dictionary_elements ()
 
bool has_slow_elements_kind ()
 
bool DictionaryElementsInPrototypeChainOnly ()
 
bool HasTransitionArray () const
 
bool HasElementsTransition ()
 
Mapelements_transition_map ()
 
MapGetTransition (int transition_index)
 
int SearchTransition (Name *name)
 
FixedArrayBaseGetInitialElements ()
 
MapFindRootMap ()
 
MapFindFieldOwner (int descriptor)
 
int GetInObjectPropertyOffset (int index)
 
int NumberOfFields ()
 
bool InstancesNeedRewriting (Map *target, int target_number_of_fields, int target_inobject, int target_unused, int *old_number_of_fields)
 
Stringconstructor_name ()
 
void set_dictionary_map (bool value)
 
bool is_dictionary_map ()
 
void set_is_access_check_needed (bool access_check_needed)
 
bool is_access_check_needed ()
 
bool has_code_cache ()
 
void InitializeDescriptors (DescriptorArray *descriptors)
 
ObjectGetBackPointer ()
 
void SetBackPointer (Object *value, WriteBarrierMode mode=UPDATE_WRITE_BARRIER)
 
void init_back_pointer (Object *undefined)
 
FixedArrayGetPrototypeTransitions ()
 
bool HasPrototypeTransitions ()
 
int NumberOfProtoTransitions ()
 
void SetNumberOfProtoTransitions (int value)
 
void LookupDescriptor (JSObject *holder, Name *name, LookupResult *result)
 
void LookupTransition (JSObject *holder, Name *name, LookupResult *result)
 
PropertyDetails GetLastDescriptorDetails ()
 
bool CanHaveMoreTransitions ()
 
int LastAdded ()
 
int NumberOfOwnDescriptors ()
 
void SetNumberOfOwnDescriptors (int number)
 
CellRetrieveDescriptorsPointer ()
 
int EnumLength ()
 
void SetEnumLength (int length)
 
bool owns_descriptors ()
 
void set_owns_descriptors (bool owns_descriptors)
 
bool has_instance_call_handler ()
 
void set_has_instance_call_handler ()
 
void freeze ()
 
bool is_frozen ()
 
void mark_unstable ()
 
bool is_stable ()
 
void set_migration_target (bool value)
 
bool is_migration_target ()
 
void set_done_inobject_slack_tracking (bool value)
 
bool done_inobject_slack_tracking ()
 
void set_construction_count (int value)
 
int construction_count ()
 
void deprecate ()
 
bool is_deprecated ()
 
bool CanBeDeprecated ()
 
bool TooManyFastProperties (StoreFromKeyed store_mode)
 
void AppendDescriptor (Descriptor *desc)
 
int NextFreePropertyIndex ()
 
int NumberOfDescribedProperties (DescriptorFlag which=OWN_DESCRIPTORS, PropertyAttributes filter=NONE)
 
int InitialPropertiesLength ()
 
void ClearCodeCache (Heap *heap)
 
ObjectFindInCodeCache (Name *name, Code::Flags flags)
 
int IndexInCodeCache (Object *name, Code *code)
 
void RemoveFromCodeCache (Name *name, Code *code, int index)
 
void ClearNonLiveTransitions (Heap *heap)
 
int Hash ()
 
MapLookupElementsTransitionMap (ElementsKind elements_kind)
 
Handle< MapFindTransitionedMap (MapHandleList *candidates)
 
bool CanTransition ()
 
bool IsJSObjectMap ()
 
bool IsJSProxyMap ()
 
bool IsJSGlobalProxyMap ()
 
bool IsJSGlobalObjectMap ()
 
bool IsGlobalObjectMap ()
 
bool CanOmitMapChecks ()
 
bool IsMapInArrayPrototypeChain ()
 
int visitor_id ()
 
void set_visitor_id (int visitor_id)
 
void TraverseTransitionTree (TraverseCallback callback, void *data)
 
 STATIC_ASSERT (kInstanceTypeAndBitFieldOffset==Internals::kMapInstanceTypeAndBitFieldOffset)
 
bool EquivalentToForNormalization (Map *other, PropertyNormalizationMode mode)
 
- 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 bool IsValidElementsTransition (ElementsKind from_kind, ElementsKind to_kind)
 
static Handle< StringExpectedTransitionKey (Handle< Map > map)
 
static Handle< MapExpectedTransitionTarget (Handle< Map > map)
 
static Handle< MapFindTransitionToField (Handle< Map > map, Handle< Name > key)
 
static Handle< MapGeneralizeAllFieldRepresentations (Handle< Map > map)
 
static MUST_USE_RESULT Handle< HeapTypeGeneralizeFieldType (Handle< HeapType > type1, Handle< HeapType > type2, Isolate *isolate)
 
static void GeneralizeFieldType (Handle< Map > map, int modify_index, Handle< HeapType > new_field_type)
 
static Handle< MapGeneralizeRepresentation (Handle< Map > map, int modify_index, Representation new_representation, Handle< HeapType > new_field_type, StoreMode store_mode)
 
static Handle< MapCopyGeneralizeAllRepresentations (Handle< Map > map, int modify_index, StoreMode store_mode, PropertyAttributes attributes, const char *reason)
 
static Handle< MapCopyGeneralizeAllRepresentations (Handle< Map > map, int modify_index, StoreMode store_mode, const char *reason)
 
static Handle< MapPrepareForDataProperty (Handle< Map > old_map, int descriptor_number, Handle< Object > value)
 
static Handle< MapNormalize (Handle< Map > map, PropertyNormalizationMode mode)
 
static MaybeHandle< MapTryUpdate (Handle< Map > map) WARN_UNUSED_RESULT
 
static MaybeHandle< MapTryUpdateInternal (Handle< Map > map) WARN_UNUSED_RESULT
 
static Handle< MapUpdate (Handle< Map > map)
 
static Handle< MapCopyDropDescriptors (Handle< Map > map)
 
static Handle< MapCopyInsertDescriptor (Handle< Map > map, Descriptor *descriptor, TransitionFlag flag)
 
static MUST_USE_RESULT MaybeHandle< MapCopyWithField (Handle< Map > map, Handle< Name > name, Handle< HeapType > type, PropertyAttributes attributes, Representation representation, TransitionFlag flag)
 
static MUST_USE_RESULT MaybeHandle< MapCopyWithConstant (Handle< Map > map, Handle< Name > name, Handle< Object > constant, PropertyAttributes attributes, TransitionFlag flag)
 
static Handle< MapTransitionElementsTo (Handle< Map > map, ElementsKind to_kind)
 
static Handle< MapAsElementsKind (Handle< Map > map, ElementsKind kind)
 
static Handle< MapCopyAsElementsKind (Handle< Map > map, ElementsKind kind, TransitionFlag flag)
 
static Handle< MapCopyForObserved (Handle< Map > map)
 
static Handle< MapCopyForFreeze (Handle< Map > map)
 
static Handle< MapTransitionToDataProperty (Handle< Map > map, Handle< Name > name, Handle< Object > value, PropertyAttributes attributes, StoreFromKeyed store_mode)
 
static Handle< MapTransitionToAccessorProperty (Handle< Map > map, Handle< Name > name, AccessorComponent component, Handle< Object > accessor, PropertyAttributes attributes)
 
static Handle< MapReconfigureDataProperty (Handle< Map > map, int descriptor, PropertyAttributes attributes)
 
static Handle< MapCopy (Handle< Map > map)
 
static Handle< MapCreate (Isolate *isolate, int inobject_properties)
 
static void UpdateCodeCache (Handle< Map > map, Handle< Name > name, Handle< Code > code)
 
static void AppendCallbackDescriptors (Handle< Map > map, Handle< Object > descriptors)
 
static void EnsureDescriptorSlack (Handle< Map > map, int slack)
 
static void AddDependentCompilationInfo (Handle< Map > map, DependentCode::DependencyGroup group, CompilationInfo *info)
 
static void AddDependentCode (Handle< Map > map, DependentCode::DependencyGroup group, Handle< Code > code)
 
static void AddDependentIC (Handle< Map > map, Handle< Code > stub)
 
static Handle< MapTransitionToPrototype (Handle< Map > map, Handle< Object > prototype)
 
- 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 kProtoTransitionHeaderSize = 1
 
static const int kProtoTransitionNumberOfEntriesOffset = 0
 
static const int kProtoTransitionElementsPerEntry = 2
 
static const int kProtoTransitionPrototypeOffset = 0
 
static const int kProtoTransitionMapOffset = 1
 
static const int kMaxCachedPrototypeTransitions = 256
 
static const int kMaxPreAllocatedPropertyFields = 255
 
static const int kInstanceSizesOffset = HeapObject::kHeaderSize
 
static const int kInstanceAttributesOffset = kInstanceSizesOffset + kIntSize
 
static const int kBitField3Offset = kInstanceAttributesOffset + kIntSize
 
static const int kPrototypeOffset = kBitField3Offset + kPointerSize
 
static const int kConstructorOffset = kPrototypeOffset + kPointerSize
 
static const int kTransitionsOrBackPointerOffset
 
static const int kDescriptorsOffset
 
static const int kCodeCacheOffset = kDescriptorsOffset + kPointerSize
 
static const int kDependentCodeOffset = kCodeCacheOffset + kPointerSize
 
static const int kSize = kDependentCodeOffset + kPointerSize
 
static const int kPointerFieldsBeginOffset = Map::kPrototypeOffset
 
static const int kPointerFieldsEndOffset = kSize
 
static const int kInstanceSizeOffset = kInstanceSizesOffset + 0
 
static const int kInObjectPropertiesByte = 1
 
static const int kInObjectPropertiesOffset
 
static const int kPreAllocatedPropertyFieldsByte = 2
 
static const int kPreAllocatedPropertyFieldsOffset
 
static const int kVisitorIdByte = 3
 
static const int kVisitorIdOffset = kInstanceSizesOffset + kVisitorIdByte
 
static const int kBitFieldOffset = kInstanceAttributesOffset + 0
 
static const int kInstanceTypeOffset = kInstanceAttributesOffset + 1
 
static const int kInstanceTypeAndBitFieldOffset
 
static const int kBitField2Offset = kInstanceAttributesOffset + 2
 
static const int kUnusedPropertyFieldsOffset = kInstanceAttributesOffset + 3
 
static const int kHasNonInstancePrototype = 0
 
static const int kIsHiddenPrototype = 1
 
static const int kHasNamedInterceptor = 2
 
static const int kHasIndexedInterceptor = 3
 
static const int kIsUndetectable = 4
 
static const int kIsObserved = 5
 
static const int kIsAccessCheckNeeded = 6
 
static const int kIsExtensible = 0
 
static const int kStringWrapperSafeForDefaultValueOf = 1
 
static const int8_t kMaximumBitField2FastElementValue
 
static const int8_t kMaximumBitField2FastSmiElementValue
 
static const int8_t kMaximumBitField2FastHoleyElementValue
 
static const int8_t kMaximumBitField2FastHoleySmiElementValue
 
- 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

bool EquivalentToForTransition (Map *other)
 
void NotifyLeafMapLayoutChange ()
 
void ZapPrototypeTransitions ()
 
void ZapTransitions ()
 
void DeprecateTransitionTree ()
 
void DeprecateTarget (Name *key, DescriptorArray *new_descriptors)
 
MapFindLastMatchMap (int verbatim, int length, DescriptorArray *descriptors)
 
void UpdateFieldType (int descriptor_number, Handle< Name > name, Handle< HeapType > new_type)
 
void PrintGeneralization (FILE *file, const char *reason, int modify_index, int split, int descriptors, bool constant_to_field, Representation old_representation, Representation new_representation, HeapType *old_field_type, HeapType *new_field_type)
 
 DISALLOW_IMPLICIT_CONSTRUCTORS (Map)
 

Static Private Member Functions

static void ConnectElementsTransition (Handle< Map > parent, Handle< Map > child)
 
static void ConnectTransition (Handle< Map > parent, Handle< Map > child, Handle< Name > name, SimpleTransitionFlag flag)
 
static Handle< MapRawCopy (Handle< Map > map, int instance_size)
 
static Handle< MapShareDescriptor (Handle< Map > map, Handle< DescriptorArray > descriptors, Descriptor *descriptor)
 
static Handle< MapCopyInstallDescriptors (Handle< Map > map, int new_descriptor, Handle< DescriptorArray > descriptors)
 
static Handle< MapCopyAddDescriptor (Handle< Map > map, Descriptor *descriptor, TransitionFlag flag)
 
static Handle< MapCopyReplaceDescriptors (Handle< Map > map, Handle< DescriptorArray > descriptors, TransitionFlag flag, MaybeHandle< Name > maybe_name, SimpleTransitionFlag simple_flag=FULL_TRANSITION)
 
static Handle< MapCopyReplaceDescriptor (Handle< Map > map, Handle< DescriptorArray > descriptors, Descriptor *descriptor, int index, TransitionFlag flag)
 
static Handle< MapCopyNormalized (Handle< Map > map, PropertyNormalizationMode mode)
 
static Handle< MapTransitionElementsToSlow (Handle< Map > object, ElementsKind to_kind)
 
static void SetPrototypeTransitions (Handle< Map > map, Handle< FixedArray > prototype_transitions)
 
static Handle< MapGetPrototypeTransition (Handle< Map > map, Handle< Object > prototype)
 
static Handle< MapPutPrototypeTransition (Handle< Map > map, Handle< Object > prototype, Handle< Map > target_map)
 

Static Private Attributes

static const int kFastPropertiesSoftLimit = 12
 
static const int kMaxFastProperties = 128
 

Additional Inherited Members

- 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)
 

Detailed Description

Definition at line 5597 of file objects.h.

Member Typedef Documentation

◆ BodyDescriptor

◆ TraverseCallback

typedef void(* v8::internal::Map::TraverseCallback) (Map *map, void *data)

Definition at line 6169 of file objects.h.

Member Function Documentation

◆ AddDependentCode()

void v8::internal::Map::AddDependentCode ( Handle< Map map,
DependentCode::DependencyGroup  group,
Handle< Code code 
)
static

Definition at line 11357 of file objects.cc.

11359  {
11360  Handle<DependentCode> codes = DependentCode::Insert(
11361  Handle<DependentCode>(map->dependent_code()), group, code);
11362  if (*codes != map->dependent_code()) map->set_dependent_code(*codes);
11363 }
static Handle< DependentCode > Insert(Handle< DependentCode > entries, DependencyGroup group, Handle< Object > object)
Definition: objects.cc:11410

References v8::internal::DependentCode::Insert(), and v8::internal::HeapObject::map().

Referenced by AddDependentIC(), and v8::internal::LChunk::CommitDependencies().

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

◆ AddDependentCompilationInfo()

void v8::internal::Map::AddDependentCompilationInfo ( Handle< Map map,
DependentCode::DependencyGroup  group,
CompilationInfo info 
)
static

Definition at line 11345 of file objects.cc.

11347  {
11348  Handle<DependentCode> codes =
11349  DependentCode::Insert(handle(map->dependent_code(), info->isolate()),
11350  group, info->object_wrapper());
11351  if (*codes != map->dependent_code()) map->set_dependent_code(*codes);
11352  info->dependencies(group)->Add(map, info->zone());
11353 }
Handle< T > handle(T *t, Isolate *isolate)
Definition: handles.h:146

References v8::internal::CompilationInfo::dependencies(), v8::internal::handle(), v8::internal::DependentCode::Insert(), v8::internal::CompilationInfo::isolate(), v8::internal::HeapObject::map(), v8::internal::CompilationInfo::object_wrapper(), and v8::internal::CompilationInfo::zone().

Referenced by v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::LoadFieldMaps(), and v8::internal::FINAL< kOperandKind, kNumCachedOperands >::MarkDependsOnEmptyArrayProtoElements().

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

◆ AddDependentIC()

void v8::internal::Map::AddDependentIC ( Handle< Map map,
Handle< Code stub 
)
static

Definition at line 11367 of file objects.cc.

11368  {
11369  DCHECK(stub->next_code_link()->IsUndefined());
11370  int n = map->dependent_code()->number_of_entries(DependentCode::kWeakICGroup);
11371  if (n == 0) {
11372  // Slow path: insert the head of the list with possible heap allocation.
11374  } else {
11375  // Fast path: link the stub to the existing head of the list without any
11376  // heap allocation.
11377  DCHECK(n == 1);
11378  map->dependent_code()->AddToDependentICList(stub);
11379  }
11380 }
static void AddDependentCode(Handle< Map > map, DependentCode::DependencyGroup group, Handle< Code > code)
Definition: objects.cc:11357
#define DCHECK(condition)
Definition: logging.h:205

References AddDependentCode(), DCHECK, v8::internal::DependentCode::kWeakICGroup, and v8::internal::HeapObject::map().

Referenced by v8::internal::IC::RegisterWeakMapDependency().

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

◆ AppendCallbackDescriptors()

void v8::internal::Map::AppendCallbackDescriptors ( Handle< Map map,
Handle< Object descriptors 
)
static

Definition at line 3174 of file objects.cc.

3175  {
3176  int nof = map->NumberOfOwnDescriptors();
3177  Handle<DescriptorArray> array(map->instance_descriptors());
3178  NeanderArray callbacks(descriptors);
3179  DCHECK(array->NumberOfSlackDescriptors() >= callbacks.length());
3180  nof = AppendUniqueCallbacks<DescriptorArrayAppender>(&callbacks, array, nof);
3182 }
int NumberOfOwnDescriptors()
Definition: objects.h:5944
void SetNumberOfOwnDescriptors(int number)
Definition: objects.h:5948

References DCHECK, v8::NeanderArray::length(), v8::internal::HeapObject::map(), NumberOfOwnDescriptors(), and SetNumberOfOwnDescriptors().

+ Here is the call graph for this function:

◆ AppendDescriptor()

void v8::internal::Map::AppendDescriptor ( Descriptor desc)
inline

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

5125  {
5126  DescriptorArray* descriptors = instance_descriptors();
5127  int number_of_own_descriptors = NumberOfOwnDescriptors();
5128  DCHECK(descriptors->number_of_descriptors() == number_of_own_descriptors);
5129  descriptors->Append(desc);
5130  SetNumberOfOwnDescriptors(number_of_own_descriptors + 1);
5131 }

References v8::internal::DescriptorArray::Append(), DCHECK, v8::internal::DescriptorArray::number_of_descriptors(), NumberOfOwnDescriptors(), and SetNumberOfOwnDescriptors().

+ Here is the call graph for this function:

◆ AsElementsKind()

Handle< Map > v8::internal::Map::AsElementsKind ( Handle< Map map,
ElementsKind  kind 
)
static

Definition at line 3374 of file objects.cc.

3374  {
3375  Handle<Map> closest_map(FindClosestElementsTransition(*map, kind));
3376 
3377  if (closest_map->elements_kind() == kind) {
3378  return closest_map;
3379  }
3380 
3381  return AddMissingElementsTransitions(closest_map, kind);
3382 }
static Map * FindClosestElementsTransition(Map *map, ElementsKind to_kind)
Definition: objects.cc:3235
static Handle< Map > AddMissingElementsTransitions(Handle< Map > map, ElementsKind to_kind)
Definition: objects.cc:3294

References v8::internal::AddMissingElementsTransitions(), v8::internal::FindClosestElementsTransition(), and v8::internal::HeapObject::map().

Referenced by v8::internal::JSObject::AllocateStorageForMap(), v8::internal::ArrayConstructorCommon(), and v8::internal::TypedArrayMap().

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

◆ bit_field()

byte v8::internal::Map::bit_field ( )
inline

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

4343  {
4344  return READ_BYTE_FIELD(this, kBitFieldOffset);
4345 }
static const int kBitFieldOffset
Definition: objects.h:6228
#define READ_BYTE_FIELD(p, offset)
Definition: objects-inl.h:1296

References kBitFieldOffset, and READ_BYTE_FIELD.

Referenced by v8::internal::CheckEquivalent(), function_with_prototype(), has_non_instance_prototype(), is_access_check_needed(), RawCopy(), set_function_with_prototype(), set_is_access_check_needed(), and set_non_instance_prototype().

+ Here is the caller graph for this function:

◆ bit_field2()

byte v8::internal::Map::bit_field2 ( )
inline

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

4353  {
4354  return READ_BYTE_FIELD(this, kBitField2Offset);
4355 }
static const int kBitField2Offset
Definition: objects.h:6233

References kBitField2Offset, and READ_BYTE_FIELD.

Referenced by v8::internal::CheckEquivalent(), Hash(), is_extensible(), is_prototype_map(), RawCopy(), set_is_extensible(), and set_is_prototype_map().

+ Here is the caller graph for this function:

◆ bit_field3()

uint32_t v8::internal::Map::bit_field3 ( )
inline

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

5120  {
5121  return READ_UINT32_FIELD(this, kBitField3Offset);
5122 }
static const int kBitField3Offset
Definition: objects.h:6189
#define READ_UINT32_FIELD(p, offset)
Definition: objects-inl.h:1272

References kBitField3Offset, and READ_UINT32_FIELD.

Referenced by construction_count(), deprecate(), done_inobject_slack_tracking(), freeze(), has_instance_call_handler(), is_deprecated(), is_dictionary_map(), is_frozen(), is_migration_target(), is_stable(), mark_unstable(), owns_descriptors(), RawCopy(), set_construction_count(), set_dictionary_map(), set_done_inobject_slack_tracking(), set_has_instance_call_handler(), set_migration_target(), and set_owns_descriptors().

+ Here is the caller graph for this function:

◆ CanBeDeprecated()

bool v8::internal::Map::CanBeDeprecated ( )
inline

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

4525  {
4526  int descriptor = LastAdded();
4527  for (int i = 0; i <= descriptor; i++) {
4528  PropertyDetails details = instance_descriptors()->GetDetails(i);
4529  if (details.representation().IsNone()) return true;
4530  if (details.representation().IsSmi()) return true;
4531  if (details.representation().IsDouble()) return true;
4532  if (details.representation().IsHeapObject()) return true;
4533  if (details.type() == CONSTANT) return true;
4534  }
4535  return false;
4536 }

References v8::internal::CONSTANT, and LastAdded().

+ Here is the call graph for this function:

◆ CanHaveMoreTransitions()

bool v8::internal::Map::CanHaveMoreTransitions ( )
inline

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

5162  {
5163  if (!HasTransitionArray()) return true;
5164  return FixedArray::SizeFor(transitions()->length() +
5167 }
static int SizeFor(int length)
Definition: objects.h:2452
bool HasTransitionArray() const
Definition: objects-inl.h:5150
static const int kMaxRegularHeapObjectSize
Definition: spaces.h:754
static const int kTransitionSize
Definition: transitions.h:139

References HasTransitionArray(), v8::internal::Page::kMaxRegularHeapObjectSize, v8::internal::TransitionArray::kTransitionSize, and v8::internal::FixedArray::SizeFor().

Referenced by CopyAddDescriptor(), and CopyReplaceDescriptors().

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

◆ CanOmitMapChecks()

bool v8::internal::Map::CanOmitMapChecks ( )
inline

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

4549  {
4550  return is_stable() && FLAG_omit_map_checks_for_leaf_maps;
4551 }

References is_stable().

+ Here is the call graph for this function:

◆ CanTransition()

bool v8::internal::Map::CanTransition ( )
inline

Definition at line 6119 of file objects.h.

6119  {
6120  // Only JSObject and subtypes have map transitions and back pointers.
6122  return instance_type() >= FIRST_JS_OBJECT_TYPE;
6123  }
STATIC_ASSERT(kDescriptorIndexBitCount+kDescriptorIndexBitCount==20)
InstanceType instance_type()
Definition: objects-inl.h:4323
@ FIRST_JS_OBJECT_TYPE
Definition: objects.h:775
@ LAST_JS_OBJECT_TYPE
Definition: objects.h:776

References v8::internal::FIRST_JS_OBJECT_TYPE, v8::internal::LAST_JS_OBJECT_TYPE, v8::internal::LAST_TYPE, and v8::internal::STATIC_ASSERT().

+ Here is the call graph for this function:

◆ ClearCodeCache()

void v8::internal::Map::ClearCodeCache ( Heap heap)
inline

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

6945  {
6946  // No write barrier is needed since empty_fixed_array is not in new space.
6947  // Please note this function is used during marking:
6948  // - MarkCompactCollector::MarkUnmarkedObject
6949  // - IncrementalMarking::Step
6950  DCHECK(!heap->InNewSpace(heap->empty_fixed_array()));
6951  WRITE_FIELD(this, kCodeCacheOffset, heap->empty_fixed_array());
6952 }
static const int kCodeCacheOffset
Definition: objects.h:6200
#define WRITE_FIELD(p, offset, value)
Definition: objects-inl.h:1190

References DCHECK, v8::internal::Heap::InNewSpace(), kCodeCacheOffset, and WRITE_FIELD.

+ Here is the call graph for this function:

◆ ClearNonLiveTransitions()

void v8::internal::Map::ClearNonLiveTransitions ( Heap heap)

◆ ConnectElementsTransition()

void v8::internal::Map::ConnectElementsTransition ( Handle< Map parent,
Handle< Map child 
)
staticprivate

Definition at line 1879 of file objects.cc.

1879  {
1880  Isolate* isolate = parent->GetIsolate();
1881  Handle<Name> name = isolate->factory()->elements_transition_symbol();
1882  ConnectTransition(parent, child, name, FULL_TRANSITION);
1883 }
static void ConnectTransition(Handle< Map > parent, Handle< Map > child, Handle< Name > name, SimpleTransitionFlag flag)
Definition: objects.cc:6519
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
@ FULL_TRANSITION
Definition: objects.h:279

◆ ConnectTransition()

void v8::internal::Map::ConnectTransition ( Handle< Map parent,
Handle< Map child,
Handle< Name name,
SimpleTransitionFlag  flag 
)
staticprivate

Definition at line 6519 of file objects.cc.

6520  {
6521  parent->set_owns_descriptors(false);
6522  if (parent->is_prototype_map()) {
6523  DCHECK(child->is_prototype_map());
6524  } else {
6525  Handle<TransitionArray> transitions =
6526  TransitionArray::CopyInsert(parent, name, child, flag);
6527  parent->set_transitions(*transitions);
6528  child->SetBackPointer(*parent);
6529  }
6530 }
static Handle< TransitionArray > CopyInsert(Handle< Map > map, Handle< Name > name, Handle< Map > target, SimpleTransitionFlag flag)
Definition: transitions.cc:88
kFeedbackVectorOffset flag
Definition: objects-inl.h:5418

References v8::internal::TransitionArray::CopyInsert(), DCHECK, v8::internal::flag, and name.

+ Here is the call graph for this function:

◆ construction_count()

int v8::internal::Map::construction_count ( )
inline

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

4495  {
4497 }
static T decode(U value)
Definition: utils.h:228
uint32_t bit_field3()
Definition: objects-inl.h:5120

References bit_field3(), and v8::internal::BitFieldBase< T, shift, size, U >::decode().

Referenced by v8::internal::JSFunction::IsInobjectSlackTrackingInProgress().

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

◆ constructor_name()

String * v8::internal::Map::constructor_name ( )

Definition at line 1689 of file objects.cc.

1689  {
1690  if (constructor()->IsJSFunction()) {
1691  JSFunction* constructor = JSFunction::cast(this->constructor());
1692  String* name = String::cast(constructor->shared()->name());
1693  if (name->length() > 0) return name;
1694  String* inferred_name = constructor->shared()->inferred_name();
1695  if (inferred_name->length() > 0) return inferred_name;
1696  Object* proto = prototype();
1697  if (proto->IsJSObject()) return JSObject::cast(proto)->constructor_name();
1698  }
1699  // TODO(rossberg): what about proxies?
1700  // If the constructor is not present, return "Object".
1701  return GetHeap()->Object_string();
1702 }
Heap * GetHeap() const
Definition: objects-inl.h:1379
kSerializedDataOffset Object
Definition: objects-inl.h:5322

Referenced by PrintGeneralization(), and v8::internal::JSObject::PrintInstanceMigration().

+ Here is the caller graph for this function:

◆ Copy()

Handle< Map > v8::internal::Map::Copy ( Handle< Map map)
static

Definition at line 6664 of file objects.cc.

6664  {
6665  Handle<DescriptorArray> descriptors(map->instance_descriptors());
6666  int number_of_own_descriptors = map->NumberOfOwnDescriptors();
6667  Handle<DescriptorArray> new_descriptors =
6668  DescriptorArray::CopyUpTo(descriptors, number_of_own_descriptors);
6669  return CopyReplaceDescriptors(
6670  map, new_descriptors, OMIT_TRANSITION, MaybeHandle<Name>());
6671 }
static Handle< DescriptorArray > CopyUpTo(Handle< DescriptorArray > desc, int enumeration_index, int slack=0)
Definition: objects.cc:6951
static Handle< Map > CopyReplaceDescriptors(Handle< Map > map, Handle< DescriptorArray > descriptors, TransitionFlag flag, MaybeHandle< Name > maybe_name, SimpleTransitionFlag simple_flag=FULL_TRANSITION)
Definition: objects.cc:6533
@ OMIT_TRANSITION
Definition: objects.h:264

References v8::internal::DescriptorArray::CopyUpTo(), v8::internal::HeapObject::map(), NumberOfOwnDescriptors(), and v8::internal::OMIT_TRANSITION.

Referenced by v8::internal::JSObject::Freeze(), v8::internal::NewJSObjectWithNullProto(), v8::internal::NewSloppyArguments(), v8::internal::JSObject::OptimizeAsPrototype(), v8::internal::JSObject::PreventExtensions(), v8::internal::RUNTIME_FUNCTION(), v8::internal::JSFunction::SetInstancePrototype(), v8::internal::JSObject::SetObserved(), v8::internal::JSFunction::SetPrototype(), and v8::Object::TurnOnAccessCheck().

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

◆ CopyAddDescriptor()

Handle< Map > v8::internal::Map::CopyAddDescriptor ( Handle< Map map,
Descriptor descriptor,
TransitionFlag  flag 
)
staticprivate

Definition at line 6911 of file objects.cc.

6913  {
6914  Handle<DescriptorArray> descriptors(map->instance_descriptors());
6915 
6916  // Ensure the key is unique.
6917  descriptor->KeyToUniqueName();
6918 
6919  if (flag == INSERT_TRANSITION &&
6920  map->owns_descriptors() &&
6922  return ShareDescriptor(map, descriptors, descriptor);
6923  }
6924 
6925  Handle<DescriptorArray> new_descriptors = DescriptorArray::CopyUpTo(
6926  descriptors, map->NumberOfOwnDescriptors(), 1);
6927  new_descriptors->Append(descriptor);
6928 
6929  return CopyReplaceDescriptors(
6930  map, new_descriptors, flag, descriptor->GetKey(), SIMPLE_TRANSITION);
6931 }
bool CanHaveMoreTransitions()
Definition: objects-inl.h:5162
static Handle< Map > ShareDescriptor(Handle< Map > map, Handle< DescriptorArray > descriptors, Descriptor *descriptor)
Definition: objects.cc:6483
@ INSERT_TRANSITION
Definition: objects.h:263
@ SIMPLE_TRANSITION
Definition: objects.h:278

References CanHaveMoreTransitions(), v8::internal::DescriptorArray::CopyUpTo(), v8::internal::flag, v8::internal::INSERT_TRANSITION, v8::internal::HeapObject::map(), NumberOfOwnDescriptors(), owns_descriptors(), and v8::internal::SIMPLE_TRANSITION.

+ Here is the call graph for this function:

◆ CopyAsElementsKind()

Handle< Map > v8::internal::Map::CopyAsElementsKind ( Handle< Map map,
ElementsKind  kind,
TransitionFlag  flag 
)
static

Definition at line 6592 of file objects.cc.

6593  {
6594  if (flag == INSERT_TRANSITION) {
6600  (kind == DICTIONARY_ELEMENTS ||
6601  IsExternalArrayElementsKind(kind))));
6602  DCHECK(!IsFastElementsKind(kind) ||
6604  DCHECK(kind != map->elements_kind());
6605  }
6606 
6607  bool insert_transition =
6609 
6610  if (insert_transition && map->owns_descriptors()) {
6611  // In case the map owned its own descriptors, share the descriptors and
6612  // transfer ownership to the new map.
6613  Handle<Map> new_map = CopyDropDescriptors(map);
6614 
6615  ConnectElementsTransition(map, new_map);
6616 
6617  new_map->set_elements_kind(kind);
6618  new_map->InitializeDescriptors(map->instance_descriptors());
6619  return new_map;
6620  }
6621 
6622  // In case the map did not own its own descriptors, a split is forced by
6623  // copying the map; creating a new descriptor array cell.
6624  // Create a new free-floating map only if we are not allowed to store it.
6625  Handle<Map> new_map = Copy(map);
6626 
6627  new_map->set_elements_kind(kind);
6628 
6629  if (insert_transition) {
6630  ConnectElementsTransition(map, new_map);
6631  }
6632 
6633  return new_map;
6634 }
ElementsKind elements_kind()
Definition: objects.h:5730
Map * elements_transition_map()
Definition: objects-inl.h:5156
bool HasElementsTransition()
Definition: objects-inl.h:5145
static Handle< Map > CopyDropDescriptors(Handle< Map > map)
Definition: objects.cc:6468
static Handle< Map > Copy(Handle< Map > map)
Definition: objects.cc:6664
static void ConnectElementsTransition(Handle< Map > parent, Handle< Map > child)
Definition: objects.cc:1879
bool IsExternalArrayElementsKind(ElementsKind kind)
Definition: elements-kind.h:95
bool IsMoreGeneralElementsKindTransition(ElementsKind from_kind, ElementsKind to_kind)
bool IsFastElementsKind(ElementsKind kind)

References DCHECK, v8::internal::DICTIONARY_ELEMENTS, elements_kind(), elements_transition_map(), v8::internal::flag, HasElementsTransition(), v8::internal::INSERT_TRANSITION, v8::internal::IsExternalArrayElementsKind(), v8::internal::IsFastElementsKind(), v8::internal::IsMoreGeneralElementsKindTransition(), v8::internal::HeapObject::map(), and owns_descriptors().

Referenced by v8::internal::CacheInitialJSArrayMaps(), and v8::internal::HashTable< MapCache, MapCacheShape, HashTableKey * >::Rehash().

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

◆ CopyDropDescriptors()

Handle< Map > v8::internal::Map::CopyDropDescriptors ( Handle< Map map)
static

Definition at line 6468 of file objects.cc.

6468  {
6469  Handle<Map> result = RawCopy(map, map->instance_size());
6470 
6471  // Please note instance_type and instance_size are set when allocated.
6472  result->set_inobject_properties(map->inobject_properties());
6473  result->set_unused_property_fields(map->unused_property_fields());
6474 
6475  result->set_pre_allocated_property_fields(
6477  result->ClearCodeCache(map->GetHeap());
6479  return result;
6480 }
int unused_property_fields()
Definition: objects-inl.h:4333
int pre_allocated_property_fields()
Definition: objects-inl.h:4246
void NotifyLeafMapLayoutChange()
Definition: objects-inl.h:4539
static Handle< Map > RawCopy(Handle< Map > map, int instance_size)
Definition: objects.cc:6375

References v8::internal::HeapObject::GetHeap(), inobject_properties(), instance_size(), v8::internal::HeapObject::map(), NotifyLeafMapLayoutChange(), pre_allocated_property_fields(), and unused_property_fields().

Referenced by v8::internal::JSObject::DeleteNormalizedProperty(), v8::internal::JSObject::MigrateSlowToFast(), and v8::internal::JSObject::SetPropertyCallback().

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

◆ CopyForFreeze()

Handle< Map > v8::internal::Map::CopyForFreeze ( Handle< Map map)
static

Definition at line 6699 of file objects.cc.

6699  {
6700  int num_descriptors = map->NumberOfOwnDescriptors();
6701  Isolate* isolate = map->GetIsolate();
6702  Handle<DescriptorArray> new_desc = DescriptorArray::CopyUpToAddAttributes(
6703  handle(map->instance_descriptors(), isolate), num_descriptors, FROZEN);
6704  Handle<Map> new_map = CopyReplaceDescriptors(
6705  map, new_desc, INSERT_TRANSITION, isolate->factory()->frozen_symbol());
6706  new_map->freeze();
6707  new_map->set_is_extensible(false);
6708  new_map->set_elements_kind(DICTIONARY_ELEMENTS);
6709  return new_map;
6710 }
static Handle< DescriptorArray > CopyUpToAddAttributes(Handle< DescriptorArray > desc, int enumeration_index, PropertyAttributes attributes, int slack=0)
Definition: objects.cc:6960
Isolate * GetIsolate() const
Definition: objects-inl.h:1387
@ FROZEN

References v8::internal::DescriptorArray::CopyUpToAddAttributes(), v8::internal::DICTIONARY_ELEMENTS, v8::internal::Isolate::factory(), FROZEN, v8::internal::HeapObject::GetIsolate(), v8::internal::handle(), v8::internal::INSERT_TRANSITION, v8::internal::HeapObject::map(), and NumberOfOwnDescriptors().

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

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

◆ CopyForObserved()

Handle< Map > v8::internal::Map::CopyForObserved ( Handle< Map map)
static

Definition at line 6637 of file objects.cc.

6637  {
6638  DCHECK(!map->is_observed());
6639 
6640  Isolate* isolate = map->GetIsolate();
6641 
6642  // In case the map owned its own descriptors, share the descriptors and
6643  // transfer ownership to the new map.
6644  Handle<Map> new_map;
6645  if (map->owns_descriptors()) {
6646  new_map = CopyDropDescriptors(map);
6647  } else {
6649  new_map = Copy(map);
6650  }
6651 
6652  new_map->set_is_observed();
6653  if (map->owns_descriptors()) {
6654  new_map->InitializeDescriptors(map->instance_descriptors());
6655  }
6656 
6657  Handle<Name> name = isolate->factory()->observed_symbol();
6659 
6660  return new_map;
6661 }
bool is_observed()
Definition: objects.h:5714

References DCHECK, v8::internal::Isolate::factory(), v8::internal::FULL_TRANSITION, v8::internal::HeapObject::GetIsolate(), is_observed(), is_prototype_map(), v8::internal::HeapObject::map(), name, and owns_descriptors().

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

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

◆ CopyGeneralizeAllRepresentations() [1/2]

Handle< Map > v8::internal::Map::CopyGeneralizeAllRepresentations ( Handle< Map map,
int  modify_index,
StoreMode  store_mode,
const char *  reason 
)
static

Definition at line 2158 of file objects.cc.

2161  {
2162  PropertyDetails details =
2163  map->instance_descriptors()->GetDetails(modify_index);
2164  return CopyGeneralizeAllRepresentations(map, modify_index, store_mode,
2165  details.attributes(), reason);
2166 }
static Handle< Map > CopyGeneralizeAllRepresentations(Handle< Map > map, int modify_index, StoreMode store_mode, PropertyAttributes attributes, const char *reason)
Definition: objects.cc:2105

References v8::internal::HeapObject::map().

+ Here is the call graph for this function:

◆ CopyGeneralizeAllRepresentations() [2/2]

Handle< Map > v8::internal::Map::CopyGeneralizeAllRepresentations ( Handle< Map map,
int  modify_index,
StoreMode  store_mode,
PropertyAttributes  attributes,
const char *  reason 
)
static

Definition at line 2105 of file objects.cc.

2109  {
2110  Isolate* isolate = map->GetIsolate();
2111  Handle<Map> new_map = Copy(map);
2112 
2113  DescriptorArray* descriptors = new_map->instance_descriptors();
2114  int length = descriptors->number_of_descriptors();
2115  for (int i = 0; i < length; i++) {
2116  descriptors->SetRepresentation(i, Representation::Tagged());
2117  if (descriptors->GetDetails(i).type() == FIELD) {
2118  descriptors->SetValue(i, HeapType::Any());
2119  }
2120  }
2121 
2122  // Unless the instance is being migrated, ensure that modify_index is a field.
2123  PropertyDetails details = descriptors->GetDetails(modify_index);
2124  if (store_mode == FORCE_FIELD &&
2125  (details.type() != FIELD || details.attributes() != attributes)) {
2126  int field_index = details.type() == FIELD ? details.field_index()
2127  : new_map->NumberOfFields();
2128  FieldDescriptor d(handle(descriptors->GetKey(modify_index), isolate),
2129  field_index, attributes, Representation::Tagged());
2130  descriptors->Replace(modify_index, &d);
2131  if (details.type() != FIELD) {
2132  int unused_property_fields = new_map->unused_property_fields() - 1;
2133  if (unused_property_fields < 0) {
2135  }
2136  new_map->set_unused_property_fields(unused_property_fields);
2137  }
2138  } else {
2139  DCHECK(details.attributes() == attributes);
2140  }
2141 
2142  if (FLAG_trace_generalization) {
2143  HeapType* field_type = (details.type() == FIELD)
2144  ? map->instance_descriptors()->GetFieldType(modify_index)
2145  : NULL;
2146  map->PrintGeneralization(stdout, reason, modify_index,
2147  new_map->NumberOfOwnDescriptors(),
2148  new_map->NumberOfOwnDescriptors(),
2149  details.type() == CONSTANT && store_mode == FORCE_FIELD,
2150  details.representation(), Representation::Tagged(),
2151  field_type, HeapType::Any());
2152  }
2153  return new_map;
2154 }
static const int kFieldsAdded
Definition: objects.h:2190
void PrintGeneralization(FILE *file, const char *reason, int modify_index, int split, int descriptors, bool constant_to_field, Representation old_representation, Representation new_representation, HeapType *old_field_type, HeapType *new_field_type)
Definition: objects.cc:1303
static Representation Tagged()
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 NULL
TypeImpl< HeapTypeConfig > HeapType
Definition: list.h:191

References v8::internal::CONSTANT, DCHECK, v8::internal::FIELD, v8::internal::FORCE_FIELD, v8::internal::DescriptorArray::GetDetails(), v8::internal::HeapObject::GetIsolate(), v8::internal::DescriptorArray::GetKey(), v8::internal::handle(), v8::internal::JSObject::kFieldsAdded, v8::internal::HeapObject::map(), NULL, v8::internal::DescriptorArray::number_of_descriptors(), PrintGeneralization(), v8::internal::DescriptorArray::Replace(), v8::internal::DescriptorArray::SetRepresentation(), v8::internal::DescriptorArray::SetValue(), and v8::internal::Representation::Tagged().

+ Here is the call graph for this function:

◆ CopyInsertDescriptor()

Handle< Map > v8::internal::Map::CopyInsertDescriptor ( Handle< Map map,
Descriptor descriptor,
TransitionFlag  flag 
)
static

Definition at line 6934 of file objects.cc.

6936  {
6937  Handle<DescriptorArray> old_descriptors(map->instance_descriptors());
6938 
6939  // Ensure the key is unique.
6940  descriptor->KeyToUniqueName();
6941 
6942  // We replace the key if it is already present.
6943  int index = old_descriptors->SearchWithCache(*descriptor->GetKey(), *map);
6944  if (index != DescriptorArray::kNotFound) {
6945  return CopyReplaceDescriptor(map, old_descriptors, descriptor, index, flag);
6946  }
6947  return CopyAddDescriptor(map, descriptor, flag);
6948 }
static const int kNotFound
Definition: objects.h:3015
static Handle< Map > CopyReplaceDescriptor(Handle< Map > map, Handle< DescriptorArray > descriptors, Descriptor *descriptor, int index, TransitionFlag flag)
Definition: objects.cc:7006
static Handle< Map > CopyAddDescriptor(Handle< Map > map, Descriptor *descriptor, TransitionFlag flag)
Definition: objects.cc:6911

References v8::internal::flag, v8::internal::DescriptorArray::kNotFound, and v8::internal::HeapObject::map().

Referenced by TransitionToAccessorProperty().

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

◆ CopyInstallDescriptors()

Handle< Map > v8::internal::Map::CopyInstallDescriptors ( Handle< Map map,
int  new_descriptor,
Handle< DescriptorArray descriptors 
)
staticprivate

Definition at line 6565 of file objects.cc.

6567  {
6568  DCHECK(descriptors->IsSortedNoDuplicates());
6569 
6570  Handle<Map> result = CopyDropDescriptors(map);
6571 
6572  result->InitializeDescriptors(*descriptors);
6573  result->SetNumberOfOwnDescriptors(new_descriptor + 1);
6574 
6576  if (descriptors->GetDetails(new_descriptor).type() == FIELD) {
6578  if (unused_property_fields < 0) {
6580  }
6581  }
6582 
6583  result->set_unused_property_fields(unused_property_fields);
6584 
6585  Handle<Name> name = handle(descriptors->GetKey(new_descriptor));
6587 
6588  return result;
6589 }

References DCHECK, v8::internal::FIELD, v8::internal::handle(), v8::internal::JSObject::kFieldsAdded, v8::internal::HeapObject::map(), name, v8::internal::SIMPLE_TRANSITION, and unused_property_fields().

+ Here is the call graph for this function:

◆ CopyNormalized()

Handle< Map > v8::internal::Map::CopyNormalized ( Handle< Map map,
PropertyNormalizationMode  mode 
)
staticprivate

Definition at line 6444 of file objects.cc.

6445  {
6446  int new_instance_size = map->instance_size();
6448  new_instance_size -= map->inobject_properties() * kPointerSize;
6449  }
6450 
6451  Handle<Map> result = RawCopy(map, new_instance_size);
6452 
6454  result->set_inobject_properties(map->inobject_properties());
6455  }
6456 
6457  result->set_dictionary_map(true);
6458  result->set_migration_target(false);
6459 
6460 #ifdef VERIFY_HEAP
6461  if (FLAG_verify_heap) result->DictionaryMapVerify();
6462 #endif
6463 
6464  return result;
6465 }
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
const int kPointerSize
Definition: globals.h:129
@ CLEAR_INOBJECT_PROPERTIES
Definition: objects.h:248

References v8::internal::CLEAR_INOBJECT_PROPERTIES, inobject_properties(), instance_size(), v8::internal::kPointerSize, v8::internal::HeapObject::map(), and mode().

Referenced by Normalize().

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

◆ CopyReplaceDescriptor()

Handle< Map > v8::internal::Map::CopyReplaceDescriptor ( Handle< Map map,
Handle< DescriptorArray descriptors,
Descriptor descriptor,
int  index,
TransitionFlag  flag 
)
staticprivate

Definition at line 7006 of file objects.cc.

7010  {
7011  // Ensure the key is unique.
7012  descriptor->KeyToUniqueName();
7013 
7014  Handle<Name> key = descriptor->GetKey();
7015  DCHECK(*key == descriptors->GetKey(insertion_index));
7016 
7017  Handle<DescriptorArray> new_descriptors = DescriptorArray::CopyUpTo(
7018  descriptors, map->NumberOfOwnDescriptors());
7019 
7020  new_descriptors->Replace(insertion_index, descriptor);
7021 
7022  SimpleTransitionFlag simple_flag =
7023  (insertion_index == descriptors->number_of_descriptors() - 1)
7025  : FULL_TRANSITION;
7026  return CopyReplaceDescriptors(map, new_descriptors, flag, key, simple_flag);
7027 }
SimpleTransitionFlag
Definition: objects.h:277

References v8::internal::DescriptorArray::CopyUpTo(), DCHECK, v8::internal::flag, v8::internal::FULL_TRANSITION, v8::internal::HeapObject::map(), NumberOfOwnDescriptors(), and v8::internal::SIMPLE_TRANSITION.

+ Here is the call graph for this function:

◆ CopyReplaceDescriptors()

Handle< Map > v8::internal::Map::CopyReplaceDescriptors ( Handle< Map map,
Handle< DescriptorArray descriptors,
TransitionFlag  flag,
MaybeHandle< Name maybe_name,
SimpleTransitionFlag  simple_flag = FULL_TRANSITION 
)
staticprivate

Definition at line 6533 of file objects.cc.

6537  {
6538  DCHECK(descriptors->IsSortedNoDuplicates());
6539 
6540  Handle<Map> result = CopyDropDescriptors(map);
6541  result->InitializeDescriptors(*descriptors);
6542 
6543  if (!map->is_prototype_map()) {
6545  Handle<Name> name;
6546  CHECK(maybe_name.ToHandle(&name));
6547  ConnectTransition(map, result, name, simple_flag);
6548  } else {
6549  int length = descriptors->number_of_descriptors();
6550  for (int i = 0; i < length; i++) {
6551  descriptors->SetRepresentation(i, Representation::Tagged());
6552  if (descriptors->GetDetails(i).type() == FIELD) {
6553  descriptors->SetValue(i, HeapType::Any());
6554  }
6555  }
6556  }
6557  }
6558 
6559  return result;
6560 }
#define CHECK(condition)
Definition: logging.h:36

References CanHaveMoreTransitions(), CHECK, DCHECK, v8::internal::FIELD, v8::internal::flag, v8::internal::INSERT_TRANSITION, is_prototype_map(), v8::internal::HeapObject::map(), name, and v8::internal::Representation::Tagged().

+ Here is the call graph for this function:

◆ CopyWithConstant()

MaybeHandle< Map > v8::internal::Map::CopyWithConstant ( Handle< Map map,
Handle< Name name,
Handle< Object constant,
PropertyAttributes  attributes,
TransitionFlag  flag 
)
static

Definition at line 1746 of file objects.cc.

1750  {
1751  // Ensure the descriptor array does not get too big.
1753  return MaybeHandle<Map>();
1754  }
1755 
1756  // Allocate new instance descriptors with (name, constant) added.
1757  ConstantDescriptor new_constant_desc(name, constant, attributes);
1758  return Map::CopyAddDescriptor(map, &new_constant_desc, flag);
1759 }
static const int kMaxNumberOfDescriptors

Referenced by TransitionToDataProperty().

+ Here is the caller graph for this function:

◆ CopyWithField()

MaybeHandle< Map > v8::internal::Map::CopyWithField ( Handle< Map map,
Handle< Name name,
Handle< HeapType type,
PropertyAttributes  attributes,
Representation  representation,
TransitionFlag  flag 
)
static

Definition at line 1710 of file objects.cc.

1715  {
1717  map->instance_descriptors()->Search(
1719 
1720  // Ensure the descriptor array does not get too big.
1722  return MaybeHandle<Map>();
1723  }
1724 
1725  Isolate* isolate = map->GetIsolate();
1726 
1727  // Compute the new index for new field.
1728  int index = map->NextFreePropertyIndex();
1729 
1731  representation = Representation::Tagged();
1732  type = HeapType::Any(isolate);
1733  }
1734 
1735  FieldDescriptor new_field_desc(name, index, type, attributes, representation);
1736  Handle<Map> new_map = Map::CopyAddDescriptor(map, &new_field_desc, flag);
1737  int unused_property_fields = new_map->unused_property_fields() - 1;
1738  if (unused_property_fields < 0) {
1740  }
1741  new_map->set_unused_property_fields(unused_property_fields);
1742  return new_map;
1743 }
int NextFreePropertyIndex()
Definition: objects.cc:5663
@ JS_CONTEXT_EXTENSION_OBJECT_TYPE
Definition: objects.h:732

Referenced by TransitionToDataProperty().

+ Here is the caller graph for this function:

◆ Create()

Handle< Map > v8::internal::Map::Create ( Isolate isolate,
int  inobject_properties 
)
static

Definition at line 6674 of file objects.cc.

6674  {
6675  Handle<Map> copy = Copy(handle(isolate->object_function()->initial_map()));
6676 
6677  // Check that we do not overflow the instance size when adding the extra
6678  // inobject properties. If the instance size overflows, we allocate as many
6679  // properties as we can as inobject properties.
6680  int max_extra_properties =
6682 
6683  if (inobject_properties > max_extra_properties) {
6684  inobject_properties = max_extra_properties;
6685  }
6686 
6687  int new_instance_size =
6689 
6690  // Adjust the map with the extra inobject properties.
6691  copy->set_inobject_properties(inobject_properties);
6692  copy->set_unused_property_fields(inobject_properties);
6693  copy->set_instance_size(new_instance_size);
6694  copy->set_visitor_id(StaticVisitorBase::GetVisitorId(*copy));
6695  return copy;
6696 }
static const int kMaxInstanceSize
Definition: objects.h:2186
static const int kHeaderSize
Definition: objects.h:2195
static VisitorId GetVisitorId(int instance_type, int instance_size)
const int kPointerSizeLog2
Definition: globals.h:147

References v8::internal::StaticVisitorBase::GetVisitorId(), v8::internal::handle(), v8::internal::JSObject::kHeaderSize, v8::internal::JSObject::kMaxInstanceSize, v8::internal::kPointerSize, and v8::internal::kPointerSizeLog2.

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

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

◆ deprecate()

void v8::internal::Map::deprecate ( )
inline

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

4460  {
4462 }
static U update(U previous, T value)
Definition: utils.h:223
void set_bit_field3(uint32_t bits)
Definition: objects-inl.h:5112

References bit_field3(), set_bit_field3(), and v8::internal::BitFieldBase< T, shift, size, U >::update().

+ Here is the call graph for this function:

◆ DeprecateTarget()

void v8::internal::Map::DeprecateTarget ( Name key,
DescriptorArray new_descriptors 
)
private

Definition at line 2187 of file objects.cc.

2187  {
2188  if (HasTransitionArray()) {
2189  TransitionArray* transitions = this->transitions();
2190  int transition = transitions->Search(key);
2191  if (transition != TransitionArray::kNotFound) {
2192  transitions->GetTarget(transition)->DeprecateTransitionTree();
2193  }
2194  }
2195 
2196  // Don't overwrite the empty descriptor array.
2197  if (NumberOfOwnDescriptors() == 0) return;
2198 
2199  DescriptorArray* to_replace = instance_descriptors();
2200  Map* current = this;
2201  GetHeap()->incremental_marking()->RecordWrites(to_replace);
2202  while (current->instance_descriptors() == to_replace) {
2203  current->SetEnumLength(kInvalidEnumCacheSentinel);
2204  current->set_instance_descriptors(new_descriptors);
2205  Object* next = current->GetBackPointer();
2206  if (next->IsUndefined()) break;
2207  current = Map::cast(next);
2208  }
2209 
2210  set_owns_descriptors(false);
2211 }
IncrementalMarking * incremental_marking()
Definition: heap.h:1205
void set_owns_descriptors(bool owns_descriptors)
Definition: objects-inl.h:4440
static const int kNotFound
Definition: transitions.h:116
static const int kInvalidEnumCacheSentinel

References DeprecateTransitionTree(), GetBackPointer(), v8::internal::HeapObject::GetHeap(), v8::internal::TransitionArray::GetTarget(), v8::internal::Heap::incremental_marking(), v8::internal::kInvalidEnumCacheSentinel, v8::internal::TransitionArray::kNotFound, v8::internal::IncrementalMarking::RecordWrites(), v8::internal::TransitionArray::Search(), and SetEnumLength().

+ Here is the call graph for this function:

◆ DeprecateTransitionTree()

void v8::internal::Map::DeprecateTransitionTree ( )
private

Definition at line 2169 of file objects.cc.

2169  {
2170  if (is_deprecated()) return;
2171  if (HasTransitionArray()) {
2172  TransitionArray* transitions = this->transitions();
2173  for (int i = 0; i < transitions->number_of_transitions(); i++) {
2174  transitions->GetTarget(i)->DeprecateTransitionTree();
2175  }
2176  }
2177  deprecate();
2178  dependent_code()->DeoptimizeDependentCodeGroup(
2181 }
kSerializedDataOffset kPrototypeTemplateOffset kIndexedPropertyHandlerOffset kInstanceCallHandlerOffset kInternalFieldCountOffset dependent_code
Definition: objects-inl.h:5353

References v8::internal::dependent_code, DeprecateTransitionTree(), v8::internal::HeapObject::GetIsolate(), v8::internal::TransitionArray::GetTarget(), v8::internal::DependentCode::kTransitionGroup, and v8::internal::TransitionArray::number_of_transitions().

Referenced by DeprecateTarget(), and DeprecateTransitionTree().

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

◆ DictionaryElementsInPrototypeChainOnly()

bool v8::internal::Map::DictionaryElementsInPrototypeChainOnly ( )

Definition at line 6003 of file objects.cc.

6003  {
6005  return false;
6006  }
6007 
6008  for (PrototypeIterator iter(this); !iter.IsAtEnd(); iter.Advance()) {
6009  if (iter.GetCurrent()->IsJSProxy()) {
6010  // Be conservative, don't walk into proxies.
6011  return true;
6012  }
6013 
6015  JSObject::cast(iter.GetCurrent())->map()->elements_kind())) {
6016  return true;
6017  }
6018  }
6019 
6020  return false;
6021 }
friend class PrototypeIterator
Definition: objects.h:1227
bool IsDictionaryElementsKind(ElementsKind kind)
Definition: elements-kind.h:85

References v8::internal::PrototypeIterator::IsAtEnd(), and v8::internal::IsDictionaryElementsKind().

+ Here is the call graph for this function:

◆ DISALLOW_IMPLICIT_CONSTRUCTORS()

v8::internal::Map::DISALLOW_IMPLICIT_CONSTRUCTORS ( Map  )
private

◆ done_inobject_slack_tracking()

bool v8::internal::Map::done_inobject_slack_tracking ( )
inline

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

4485  {
4487 }

References bit_field3(), and v8::internal::BitFieldBase< T, shift, size, U >::decode().

Referenced by v8::internal::JSFunction::CompleteInobjectSlackTracking(), and v8::internal::JSFunction::StartInobjectSlackTracking().

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

◆ elements_kind()

ElementsKind v8::internal::Map::elements_kind ( )
inline

Definition at line 5730 of file objects.h.

5730  {
5732  }

References v8::internal::BitFieldBase< T, shift, size, U >::decode().

Referenced by v8::internal::JSObject::AllocateStorageForMap(), CopyAsElementsKind(), v8::internal::JSObject::GetElementsKind(), v8::internal::IC::IsTransitionOfMonomorphicTarget(), v8::internal::HashTable< MapCache, MapCacheShape, HashTableKey * >::IterateElements(), LookupElementsTransitionMap(), v8::internal::JSTypedArray::MaterializeArrayBuffer(), v8::internal::HashTable< MapCache, MapCacheShape, HashTableKey * >::New(), v8::internal::RUNTIME_FUNCTION(), TransitionElementsTo(), and TransitionElementsToSlow().

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

◆ elements_transition_map()

Map * v8::internal::Map::elements_transition_map ( )
inline

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

5156  {
5157  int index = transitions()->Search(GetHeap()->elements_transition_symbol());
5158  return transitions()->GetTarget(index);
5159 }

References v8::internal::HeapObject::GetHeap().

Referenced by CopyAsElementsKind(), v8::internal::HashTable< MapCache, MapCacheShape, HashTableKey * >::IterateElements(), and v8::internal::HashTable< MapCache, MapCacheShape, HashTableKey * >::New().

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

◆ EnsureDescriptorSlack()

void v8::internal::Map::EnsureDescriptorSlack ( Handle< Map map,
int  slack 
)
static

Definition at line 3057 of file objects.cc.

3057  {
3058  // Only supports adding slack to owned descriptors.
3060 
3061  Handle<DescriptorArray> descriptors(map->instance_descriptors());
3062  int old_size = map->NumberOfOwnDescriptors();
3063  if (slack <= descriptors->NumberOfSlackDescriptors()) return;
3064 
3065  Handle<DescriptorArray> new_descriptors = DescriptorArray::CopyUpTo(
3066  descriptors, old_size, slack);
3067 
3068  if (old_size == 0) {
3069  map->set_instance_descriptors(*new_descriptors);
3070  return;
3071  }
3072 
3073  // If the source descriptors had an enum cache we copy it. This ensures
3074  // that the maps to which we push the new descriptor array back can rely
3075  // on a cache always being available once it is set. If the map has more
3076  // enumerated descriptors than available in the original cache, the cache
3077  // will be lazily replaced by the extended cache when needed.
3078  if (descriptors->HasEnumCache()) {
3079  new_descriptors->CopyEnumCacheFrom(*descriptors);
3080  }
3081 
3082  // Replace descriptors by new_descriptors in all maps that share it.
3083  map->GetHeap()->incremental_marking()->RecordWrites(*descriptors);
3084 
3085  Map* walk_map;
3086  for (Object* current = map->GetBackPointer();
3087  !current->IsUndefined();
3088  current = walk_map->GetBackPointer()) {
3089  walk_map = Map::cast(current);
3090  if (walk_map->instance_descriptors() != *descriptors) break;
3091  walk_map->set_instance_descriptors(*new_descriptors);
3092  }
3093 
3094  map->set_instance_descriptors(*new_descriptors);
3095 }
Object * GetBackPointer()
Definition: objects-inl.h:5134

References v8::internal::DescriptorArray::CopyUpTo(), DCHECK, GetBackPointer(), v8::internal::HeapObject::GetHeap(), v8::internal::Heap::incremental_marking(), v8::internal::HeapObject::map(), NumberOfOwnDescriptors(), owns_descriptors(), and v8::internal::IncrementalMarking::RecordWrites().

+ Here is the call graph for this function:

◆ EnumLength()

int v8::internal::Map::EnumLength ( )
inline

Definition at line 5955 of file objects.h.

5955  {
5957  }

Referenced by v8::internal::JSReceiver::IsSimpleEnum(), and v8::internal::JSObject::NumberOfOwnProperties().

+ Here is the caller graph for this function:

◆ EquivalentToForNormalization()

bool v8::internal::Map::EquivalentToForNormalization ( Map other,
PropertyNormalizationMode  mode 
)

Definition at line 9054 of file objects.cc.

9055  {
9056  int properties = mode == CLEAR_INOBJECT_PROPERTIES
9057  ? 0 : other->inobject_properties();
9058  return CheckEquivalent(this, other) && inobject_properties() == properties;
9059 }
static bool CheckEquivalent(Map *first, Map *second)
Definition: objects.cc:9037

References v8::internal::CheckEquivalent(), v8::internal::CLEAR_INOBJECT_PROPERTIES, inobject_properties(), and mode().

+ Here is the call graph for this function:

◆ EquivalentToForTransition()

bool v8::internal::Map::EquivalentToForTransition ( Map other)
private

Definition at line 9049 of file objects.cc.

9049  {
9050  return CheckEquivalent(this, other);
9051 }

References v8::internal::CheckEquivalent().

+ Here is the call graph for this function:

◆ ExpectedTransitionKey()

Handle< String > v8::internal::Map::ExpectedTransitionKey ( Handle< Map map)
inlinestatic

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

1847  {
1848  DisallowHeapAllocation no_gc;
1849  if (!map->HasTransitionArray()) return Handle<String>::null();
1850  TransitionArray* transitions = map->transitions();
1851  if (!transitions->IsSimpleTransition()) return Handle<String>::null();
1852  int transition = TransitionArray::kSimpleTransitionIndex;
1853  PropertyDetails details = transitions->GetTargetDetails(transition);
1854  Name* name = transitions->GetKey(transition);
1855  if (details.type() != FIELD) return Handle<String>::null();
1856  if (details.attributes() != NONE) return Handle<String>::null();
1857  if (!name->IsString()) return Handle<String>::null();
1858  return Handle<String>(String::cast(name));
1859 }
static Handle< T > null()
Definition: handles.h:123
static const int kSimpleTransitionIndex
Definition: transitions.h:127
PerThreadAssertScopeDebugOnly< HEAP_ALLOCATION_ASSERT, false > DisallowHeapAllocation
Definition: assert-scope.h:110
@ NONE

References v8::internal::FIELD, v8::internal::TransitionArray::GetKey(), v8::internal::TransitionArray::GetTargetDetails(), HasTransitionArray(), v8::internal::TransitionArray::IsSimpleTransition(), v8::internal::TransitionArray::kSimpleTransitionIndex, v8::internal::HeapObject::map(), name, NONE, and v8::internal::Handle< T >::null().

Referenced by ExpectedTransitionTarget().

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

◆ ExpectedTransitionTarget()

Handle< Map > v8::internal::Map::ExpectedTransitionTarget ( Handle< Map map)
inlinestatic

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

1862  {
1863  DCHECK(!ExpectedTransitionKey(map).is_null());
1864  return Handle<Map>(map->transitions()->GetTarget(
1866 }
static Handle< String > ExpectedTransitionKey(Handle< Map > map)
Definition: objects-inl.h:1847

References DCHECK, ExpectedTransitionKey(), v8::internal::TransitionArray::kSimpleTransitionIndex, and v8::internal::HeapObject::map().

+ Here is the call graph for this function:

◆ FindFieldOwner()

Map * v8::internal::Map::FindFieldOwner ( int  descriptor)

Definition at line 2262 of file objects.cc.

2262  {
2263  DisallowHeapAllocation no_allocation;
2264  DCHECK_EQ(FIELD, instance_descriptors()->GetDetails(descriptor).type());
2265  Map* result = this;
2266  while (true) {
2267  Object* back = result->GetBackPointer();
2268  if (back->IsUndefined()) break;
2269  Map* parent = Map::cast(back);
2270  if (parent->NumberOfOwnDescriptors() <= descriptor) break;
2271  result = parent;
2272  }
2273  return result;
2274 }
#define DCHECK_EQ(v1, v2)
Definition: logging.h:206

References DCHECK_EQ, v8::internal::FIELD, GetBackPointer(), and NumberOfOwnDescriptors().

Referenced by GeneralizeFieldType().

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

◆ FindInCodeCache()

Object * v8::internal::Map::FindInCodeCache ( Name name,
Code::Flags  flags 
)

Definition at line 7047 of file objects.cc.

7047  {
7048  // Do a lookup if a code cache exists.
7049  if (!code_cache()->IsFixedArray()) {
7050  return CodeCache::cast(code_cache())->Lookup(name, flags);
7051  } else {
7052  return GetHeap()->undefined_value();
7053  }
7054 }

References v8::internal::anonymous_namespace{flags.cc}::flags, v8::internal::HeapObject::GetHeap(), and name.

+ Here is the call graph for this function:

◆ FindLastMatchMap()

Map * v8::internal::Map::FindLastMatchMap ( int  verbatim,
int  length,
DescriptorArray descriptors 
)
private

Definition at line 2224 of file objects.cc.

2226  {
2227  DisallowHeapAllocation no_allocation;
2228 
2229  // This can only be called on roots of transition trees.
2230  DCHECK(GetBackPointer()->IsUndefined());
2231 
2232  Map* current = this;
2233 
2234  for (int i = verbatim; i < length; i++) {
2235  if (!current->HasTransitionArray()) break;
2236  Name* name = descriptors->GetKey(i);
2237  TransitionArray* transitions = current->transitions();
2238  int transition = transitions->Search(name);
2239  if (transition == TransitionArray::kNotFound) break;
2240 
2241  Map* next = transitions->GetTarget(transition);
2242  DescriptorArray* next_descriptors = next->instance_descriptors();
2243 
2244  PropertyDetails details = descriptors->GetDetails(i);
2245  PropertyDetails next_details = next_descriptors->GetDetails(i);
2246  if (details.type() != next_details.type()) break;
2247  if (details.attributes() != next_details.attributes()) break;
2248  if (!details.representation().Equals(next_details.representation())) break;
2249  if (next_details.type() == FIELD) {
2250  if (!descriptors->GetFieldType(i)->NowIs(
2251  next_descriptors->GetFieldType(i))) break;
2252  } else {
2253  if (descriptors->GetValue(i) != next_descriptors->GetValue(i)) break;
2254  }
2255 
2256  current = next;
2257  }
2258  return current;
2259 }

References DCHECK, v8::internal::FIELD, v8::internal::DescriptorArray::GetDetails(), v8::internal::DescriptorArray::GetFieldType(), v8::internal::DescriptorArray::GetKey(), v8::internal::TransitionArray::GetTarget(), v8::internal::DescriptorArray::GetValue(), HasTransitionArray(), v8::internal::TransitionArray::kNotFound, name, v8::internal::TypeImpl< Config >::NowIs(), and v8::internal::TransitionArray::Search().

+ Here is the call graph for this function:

◆ FindRootMap()

Map * v8::internal::Map::FindRootMap ( )

Definition at line 2214 of file objects.cc.

2214  {
2215  Map* result = this;
2216  while (true) {
2217  Object* back = result->GetBackPointer();
2218  if (back->IsUndefined()) return result;
2219  result = Map::cast(back);
2220  }
2221 }

References GetBackPointer().

+ Here is the call graph for this function:

◆ FindTransitionedMap()

Handle< Map > v8::internal::Map::FindTransitionedMap ( MapHandleList candidates)

Definition at line 3212 of file objects.cc.

3212  {
3213  ElementsKind kind = elements_kind();
3214  Handle<Map> transitioned_map = Handle<Map>::null();
3215  Handle<Map> current_map(this);
3216  bool packed = IsFastPackedElementsKind(kind);
3218  while (CanTransitionToMoreGeneralFastElementsKind(kind, false)) {
3219  kind = GetNextMoreGeneralFastElementsKind(kind, false);
3220  Handle<Map> maybe_transitioned_map =
3221  MaybeNull(current_map->LookupElementsTransitionMap(kind));
3222  if (maybe_transitioned_map.is_null()) break;
3223  if (ContainsMap(candidates, maybe_transitioned_map) &&
3224  (packed || !IsFastPackedElementsKind(kind))) {
3225  transitioned_map = maybe_transitioned_map;
3226  if (!IsFastPackedElementsKind(kind)) packed = false;
3227  }
3228  current_map = maybe_transitioned_map;
3229  }
3230  }
3231  return transitioned_map;
3232 }
bool CanTransitionToMoreGeneralFastElementsKind(ElementsKind elements_kind, bool allow_only_packed)
ElementsKind GetNextMoreGeneralFastElementsKind(ElementsKind elements_kind, bool allow_only_packed)
bool IsFastPackedElementsKind(ElementsKind kind)
static bool ContainsMap(MapHandleList *maps, Handle< Map > map)
Definition: objects.cc:3196
bool IsTransitionableFastElementsKind(ElementsKind from_kind)
static Handle< T > MaybeNull(T *p)
Definition: objects.cc:3206

References v8::internal::CanTransitionToMoreGeneralFastElementsKind(), v8::internal::ContainsMap(), v8::internal::GetNextMoreGeneralFastElementsKind(), v8::internal::Handle< T >::is_null(), v8::internal::IsFastPackedElementsKind(), v8::internal::IsTransitionableFastElementsKind(), v8::internal::MaybeNull(), and v8::internal::Handle< T >::null().

+ Here is the call graph for this function:

◆ FindTransitionToField()

Handle< Map > v8::internal::Map::FindTransitionToField ( Handle< Map map,
Handle< Name key 
)
inlinestatic

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

1869  {
1870  DisallowHeapAllocation no_allocation;
1871  if (!map->HasTransitionArray()) return Handle<Map>::null();
1872  TransitionArray* transitions = map->transitions();
1873  int transition = transitions->Search(*key);
1874  if (transition == TransitionArray::kNotFound) return Handle<Map>::null();
1875  PropertyDetails target_details = transitions->GetTargetDetails(transition);
1876  if (target_details.type() != FIELD) return Handle<Map>::null();
1877  if (target_details.attributes() != NONE) return Handle<Map>::null();
1878  return Handle<Map>(transitions->GetTarget(transition));
1879 }

References v8::internal::FIELD, v8::internal::TransitionArray::GetTarget(), v8::internal::TransitionArray::GetTargetDetails(), HasTransitionArray(), v8::internal::TransitionArray::kNotFound, v8::internal::HeapObject::map(), NONE, v8::internal::Handle< T >::null(), and v8::internal::TransitionArray::Search().

+ Here is the call graph for this function:

◆ freeze()

void v8::internal::Map::freeze ( )
inline

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

4500  {
4502 }

References bit_field3(), set_bit_field3(), and v8::internal::BitFieldBase< T, shift, size, U >::update().

+ Here is the call graph for this function:

◆ function_with_prototype()

bool v8::internal::Map::function_with_prototype ( )
inline

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

4382  {
4384 }

References bit_field(), and v8::internal::BitFieldBase< T, shift, size, U >::decode().

Referenced by v8::internal::JSFunction::should_have_prototype().

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

◆ GeneralizeAllFieldRepresentations()

Handle< Map > v8::internal::Map::GeneralizeAllFieldRepresentations ( Handle< Map map)
static

Definition at line 2676 of file objects.cc.

2677  {
2678  Handle<DescriptorArray> descriptors(map->instance_descriptors());
2679  for (int i = 0; i < map->NumberOfOwnDescriptors(); ++i) {
2680  if (descriptors->GetDetails(i).type() == FIELD) {
2682  HeapType::Any(map->GetIsolate()),
2683  FORCE_FIELD);
2684  }
2685  }
2686  return map;
2687 }
static Handle< Map > GeneralizeRepresentation(Handle< Map > map, int modify_index, Representation new_representation, Handle< HeapType > new_field_type, StoreMode store_mode)
Definition: objects.cc:2378

References v8::internal::FIELD, v8::internal::FORCE_FIELD, v8::internal::HeapObject::GetIsolate(), v8::internal::HeapObject::map(), NumberOfOwnDescriptors(), and v8::internal::Representation::Tagged().

Referenced by v8::internal::Deoptimizer::MaterializeNextHeapObject().

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

◆ GeneralizeFieldType() [1/2]

Handle< HeapType > v8::internal::Map::GeneralizeFieldType ( Handle< HeapType type1,
Handle< HeapType type2,
Isolate isolate 
)
static

Definition at line 2297 of file objects.cc.

2299  {
2300  static const int kMaxClassesPerFieldType = 5;
2301  if (type1->NowIs(type2)) return type2;
2302  if (type2->NowIs(type1)) return type1;
2303  if (type1->NowStable() && type2->NowStable()) {
2304  Handle<HeapType> type = HeapType::Union(type1, type2, isolate);
2305  if (type->NumClasses() <= kMaxClassesPerFieldType) {
2306  DCHECK(type->NowStable());
2307  DCHECK(type1->NowIs(type));
2308  DCHECK(type2->NowIs(type));
2309  return type;
2310  }
2311  }
2312  return HeapType::Any(isolate);
2313 }
static TypeHandle Union(TypeHandle type1, TypeHandle type2, Region *reg)
Definition: types.cc:737

References DCHECK, and v8::internal::TypeImpl< Config >::Union().

Referenced by GeneralizeFieldType().

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

◆ GeneralizeFieldType() [2/2]

void v8::internal::Map::GeneralizeFieldType ( Handle< Map map,
int  modify_index,
Handle< HeapType new_field_type 
)
static

Definition at line 2317 of file objects.cc.

2319  {
2320  Isolate* isolate = map->GetIsolate();
2321 
2322  // Check if we actually need to generalize the field type at all.
2323  Handle<HeapType> old_field_type(
2324  map->instance_descriptors()->GetFieldType(modify_index), isolate);
2325  if (new_field_type->NowIs(old_field_type)) {
2326  DCHECK(Map::GeneralizeFieldType(old_field_type,
2327  new_field_type,
2328  isolate)->NowIs(old_field_type));
2329  return;
2330  }
2331 
2332  // Determine the field owner.
2333  Handle<Map> field_owner(map->FindFieldOwner(modify_index), isolate);
2334  Handle<DescriptorArray> descriptors(
2335  field_owner->instance_descriptors(), isolate);
2336  DCHECK_EQ(*old_field_type, descriptors->GetFieldType(modify_index));
2337 
2338  // Determine the generalized new field type.
2339  new_field_type = Map::GeneralizeFieldType(
2340  old_field_type, new_field_type, isolate);
2341 
2342  PropertyDetails details = descriptors->GetDetails(modify_index);
2343  Handle<Name> name(descriptors->GetKey(modify_index));
2344  field_owner->UpdateFieldType(modify_index, name, new_field_type);
2345  field_owner->dependent_code()->DeoptimizeDependentCodeGroup(
2347 
2348  if (FLAG_trace_generalization) {
2350  stdout, "field type generalization",
2351  modify_index, map->NumberOfOwnDescriptors(),
2352  map->NumberOfOwnDescriptors(), false,
2353  details.representation(), details.representation(),
2354  *old_field_type, *new_field_type);
2355  }
2356 }
static MUST_USE_RESULT Handle< HeapType > GeneralizeFieldType(Handle< HeapType > type1, Handle< HeapType > type2, Isolate *isolate)
Definition: objects.cc:2297
Map * FindFieldOwner(int descriptor)
Definition: objects.cc:2262

References DCHECK, DCHECK_EQ, FindFieldOwner(), GeneralizeFieldType(), v8::internal::HeapObject::GetIsolate(), v8::internal::DependentCode::kFieldTypeGroup, v8::internal::HeapObject::map(), name, NumberOfOwnDescriptors(), and PrintGeneralization().

+ Here is the call graph for this function:

◆ GeneralizeRepresentation()

Handle< Map > v8::internal::Map::GeneralizeRepresentation ( Handle< Map map,
int  modify_index,
Representation  new_representation,
Handle< HeapType new_field_type,
StoreMode  store_mode 
)
static

Definition at line 2378 of file objects.cc.

2382  {
2383  Isolate* isolate = old_map->GetIsolate();
2384 
2385  Handle<DescriptorArray> old_descriptors(
2386  old_map->instance_descriptors(), isolate);
2387  int old_nof = old_map->NumberOfOwnDescriptors();
2388  PropertyDetails old_details = old_descriptors->GetDetails(modify_index);
2389  Representation old_representation = old_details.representation();
2390 
2391  // It's fine to transition from None to anything but double without any
2392  // modification to the object, because the default uninitialized value for
2393  // representation None can be overwritten by both smi and tagged values.
2394  // Doubles, however, would require a box allocation.
2395  if (old_representation.IsNone() &&
2396  !new_representation.IsNone() &&
2397  !new_representation.IsDouble()) {
2398  DCHECK(old_details.type() == FIELD);
2399  DCHECK(old_descriptors->GetFieldType(modify_index)->NowIs(
2400  HeapType::None()));
2401  if (FLAG_trace_generalization) {
2402  old_map->PrintGeneralization(
2403  stdout, "uninitialized field",
2404  modify_index, old_map->NumberOfOwnDescriptors(),
2405  old_map->NumberOfOwnDescriptors(), false,
2406  old_representation, new_representation,
2407  old_descriptors->GetFieldType(modify_index), *new_field_type);
2408  }
2409  old_descriptors->SetRepresentation(modify_index, new_representation);
2410  old_descriptors->SetValue(modify_index, *new_field_type);
2411  return old_map;
2412  }
2413 
2414  // Check the state of the root map.
2415  Handle<Map> root_map(old_map->FindRootMap(), isolate);
2416  if (!old_map->EquivalentToForTransition(*root_map)) {
2418  old_map, modify_index, store_mode, "not equivalent");
2419  }
2420  int root_nof = root_map->NumberOfOwnDescriptors();
2421  if (modify_index < root_nof) {
2422  PropertyDetails old_details = old_descriptors->GetDetails(modify_index);
2423  if ((old_details.type() != FIELD && store_mode == FORCE_FIELD) ||
2424  (old_details.type() == FIELD &&
2425  (!new_field_type->NowIs(old_descriptors->GetFieldType(modify_index)) ||
2426  !new_representation.fits_into(old_details.representation())))) {
2428  old_map, modify_index, store_mode, "root modification");
2429  }
2430  }
2431 
2432  Handle<Map> target_map = root_map;
2433  for (int i = root_nof; i < old_nof; ++i) {
2434  int j = target_map->SearchTransition(old_descriptors->GetKey(i));
2435  if (j == TransitionArray::kNotFound) break;
2436  Handle<Map> tmp_map(target_map->GetTransition(j), isolate);
2437  Handle<DescriptorArray> tmp_descriptors = handle(
2438  tmp_map->instance_descriptors(), isolate);
2439 
2440  // Check if target map is incompatible.
2441  PropertyDetails old_details = old_descriptors->GetDetails(i);
2442  PropertyDetails tmp_details = tmp_descriptors->GetDetails(i);
2443  PropertyType old_type = old_details.type();
2444  PropertyType tmp_type = tmp_details.type();
2445  if (tmp_details.attributes() != old_details.attributes() ||
2446  ((tmp_type == CALLBACKS || old_type == CALLBACKS) &&
2447  (tmp_type != old_type ||
2448  tmp_descriptors->GetValue(i) != old_descriptors->GetValue(i)))) {
2450  old_map, modify_index, store_mode, "incompatible");
2451  }
2452  Representation old_representation = old_details.representation();
2453  Representation tmp_representation = tmp_details.representation();
2454  if (!old_representation.fits_into(tmp_representation) ||
2455  (!new_representation.fits_into(tmp_representation) &&
2456  modify_index == i)) {
2457  break;
2458  }
2459  if (tmp_type == FIELD) {
2460  // Generalize the field type as necessary.
2461  Handle<HeapType> old_field_type = (old_type == FIELD)
2462  ? handle(old_descriptors->GetFieldType(i), isolate)
2463  : old_descriptors->GetValue(i)->OptimalType(
2464  isolate, tmp_representation);
2465  if (modify_index == i) {
2466  old_field_type = GeneralizeFieldType(
2467  new_field_type, old_field_type, isolate);
2468  }
2469  GeneralizeFieldType(tmp_map, i, old_field_type);
2470  } else if (tmp_type == CONSTANT) {
2471  if (old_type != CONSTANT ||
2472  old_descriptors->GetConstant(i) != tmp_descriptors->GetConstant(i)) {
2473  break;
2474  }
2475  } else {
2476  DCHECK_EQ(tmp_type, old_type);
2477  DCHECK_EQ(tmp_descriptors->GetValue(i), old_descriptors->GetValue(i));
2478  }
2479  target_map = tmp_map;
2480  }
2481 
2482  // Directly change the map if the target map is more general.
2483  Handle<DescriptorArray> target_descriptors(
2484  target_map->instance_descriptors(), isolate);
2485  int target_nof = target_map->NumberOfOwnDescriptors();
2486  if (target_nof == old_nof &&
2487  (store_mode != FORCE_FIELD ||
2488  target_descriptors->GetDetails(modify_index).type() == FIELD)) {
2489  DCHECK(modify_index < target_nof);
2490  DCHECK(new_representation.fits_into(
2491  target_descriptors->GetDetails(modify_index).representation()));
2492  DCHECK(target_descriptors->GetDetails(modify_index).type() != FIELD ||
2493  new_field_type->NowIs(
2494  target_descriptors->GetFieldType(modify_index)));
2495  return target_map;
2496  }
2497 
2498  // Find the last compatible target map in the transition tree.
2499  for (int i = target_nof; i < old_nof; ++i) {
2500  int j = target_map->SearchTransition(old_descriptors->GetKey(i));
2501  if (j == TransitionArray::kNotFound) break;
2502  Handle<Map> tmp_map(target_map->GetTransition(j), isolate);
2503  Handle<DescriptorArray> tmp_descriptors(
2504  tmp_map->instance_descriptors(), isolate);
2505 
2506  // Check if target map is compatible.
2507  PropertyDetails old_details = old_descriptors->GetDetails(i);
2508  PropertyDetails tmp_details = tmp_descriptors->GetDetails(i);
2509  if (tmp_details.attributes() != old_details.attributes() ||
2510  ((tmp_details.type() == CALLBACKS || old_details.type() == CALLBACKS) &&
2511  (tmp_details.type() != old_details.type() ||
2512  tmp_descriptors->GetValue(i) != old_descriptors->GetValue(i)))) {
2514  old_map, modify_index, store_mode, "incompatible");
2515  }
2516  target_map = tmp_map;
2517  }
2518  target_nof = target_map->NumberOfOwnDescriptors();
2519  target_descriptors = handle(target_map->instance_descriptors(), isolate);
2520 
2521  // Allocate a new descriptor array large enough to hold the required
2522  // descriptors, with minimally the exact same size as the old descriptor
2523  // array.
2524  int new_slack = Max(
2525  old_nof, old_descriptors->number_of_descriptors()) - old_nof;
2526  Handle<DescriptorArray> new_descriptors = DescriptorArray::Allocate(
2527  isolate, old_nof, new_slack);
2528  DCHECK(new_descriptors->length() > target_descriptors->length() ||
2529  new_descriptors->NumberOfSlackDescriptors() > 0 ||
2530  new_descriptors->number_of_descriptors() ==
2531  old_descriptors->number_of_descriptors());
2532  DCHECK(new_descriptors->number_of_descriptors() == old_nof);
2533 
2534  // 0 -> |root_nof|
2535  int current_offset = 0;
2536  for (int i = 0; i < root_nof; ++i) {
2537  PropertyDetails old_details = old_descriptors->GetDetails(i);
2538  if (old_details.type() == FIELD) current_offset++;
2539  Descriptor d(handle(old_descriptors->GetKey(i), isolate),
2540  handle(old_descriptors->GetValue(i), isolate),
2541  old_details);
2542  new_descriptors->Set(i, &d);
2543  }
2544 
2545  // |root_nof| -> |target_nof|
2546  for (int i = root_nof; i < target_nof; ++i) {
2547  Handle<Name> target_key(target_descriptors->GetKey(i), isolate);
2548  PropertyDetails old_details = old_descriptors->GetDetails(i);
2549  PropertyDetails target_details = target_descriptors->GetDetails(i);
2550  target_details = target_details.CopyWithRepresentation(
2551  old_details.representation().generalize(
2552  target_details.representation()));
2553  if (modify_index == i) {
2554  target_details = target_details.CopyWithRepresentation(
2555  new_representation.generalize(target_details.representation()));
2556  }
2557  DCHECK_EQ(old_details.attributes(), target_details.attributes());
2558  if (old_details.type() == FIELD ||
2559  target_details.type() == FIELD ||
2560  (modify_index == i && store_mode == FORCE_FIELD) ||
2561  (target_descriptors->GetValue(i) != old_descriptors->GetValue(i))) {
2562  Handle<HeapType> old_field_type = (old_details.type() == FIELD)
2563  ? handle(old_descriptors->GetFieldType(i), isolate)
2564  : old_descriptors->GetValue(i)->OptimalType(
2565  isolate, target_details.representation());
2566  Handle<HeapType> target_field_type = (target_details.type() == FIELD)
2567  ? handle(target_descriptors->GetFieldType(i), isolate)
2568  : target_descriptors->GetValue(i)->OptimalType(
2569  isolate, target_details.representation());
2570  target_field_type = GeneralizeFieldType(
2571  target_field_type, old_field_type, isolate);
2572  if (modify_index == i) {
2573  target_field_type = GeneralizeFieldType(
2574  target_field_type, new_field_type, isolate);
2575  }
2576  FieldDescriptor d(target_key,
2577  current_offset++,
2578  target_field_type,
2579  target_details.attributes(),
2580  target_details.representation());
2581  new_descriptors->Set(i, &d);
2582  } else {
2583  DCHECK_NE(FIELD, target_details.type());
2584  Descriptor d(target_key,
2585  handle(target_descriptors->GetValue(i), isolate),
2586  target_details);
2587  new_descriptors->Set(i, &d);
2588  }
2589  }
2590 
2591  // |target_nof| -> |old_nof|
2592  for (int i = target_nof; i < old_nof; ++i) {
2593  PropertyDetails old_details = old_descriptors->GetDetails(i);
2594  Handle<Name> old_key(old_descriptors->GetKey(i), isolate);
2595  if (modify_index == i) {
2596  old_details = old_details.CopyWithRepresentation(
2597  new_representation.generalize(old_details.representation()));
2598  }
2599  if (old_details.type() == FIELD) {
2600  Handle<HeapType> old_field_type(
2601  old_descriptors->GetFieldType(i), isolate);
2602  if (modify_index == i) {
2603  old_field_type = GeneralizeFieldType(
2604  old_field_type, new_field_type, isolate);
2605  }
2606  FieldDescriptor d(old_key,
2607  current_offset++,
2608  old_field_type,
2609  old_details.attributes(),
2610  old_details.representation());
2611  new_descriptors->Set(i, &d);
2612  } else {
2613  DCHECK(old_details.type() == CONSTANT || old_details.type() == CALLBACKS);
2614  if (modify_index == i && store_mode == FORCE_FIELD) {
2615  FieldDescriptor d(old_key,
2616  current_offset++,
2618  old_descriptors->GetValue(i)->OptimalType(
2619  isolate, old_details.representation()),
2620  new_field_type, isolate),
2621  old_details.attributes(),
2622  old_details.representation());
2623  new_descriptors->Set(i, &d);
2624  } else {
2625  DCHECK_NE(FIELD, old_details.type());
2626  Descriptor d(old_key,
2627  handle(old_descriptors->GetValue(i), isolate),
2628  old_details);
2629  new_descriptors->Set(i, &d);
2630  }
2631  }
2632  }
2633 
2634  new_descriptors->Sort();
2635 
2636  DCHECK(store_mode != FORCE_FIELD ||
2637  new_descriptors->GetDetails(modify_index).type() == FIELD);
2638 
2639  Handle<Map> split_map(root_map->FindLastMatchMap(
2640  root_nof, old_nof, *new_descriptors), isolate);
2641  int split_nof = split_map->NumberOfOwnDescriptors();
2642  DCHECK_NE(old_nof, split_nof);
2643 
2644  split_map->DeprecateTarget(
2645  old_descriptors->GetKey(split_nof), *new_descriptors);
2646 
2647  if (FLAG_trace_generalization) {
2648  PropertyDetails old_details = old_descriptors->GetDetails(modify_index);
2649  PropertyDetails new_details = new_descriptors->GetDetails(modify_index);
2650  Handle<HeapType> old_field_type = (old_details.type() == FIELD)
2651  ? handle(old_descriptors->GetFieldType(modify_index), isolate)
2652  : HeapType::Constant(handle(old_descriptors->GetValue(modify_index),
2653  isolate), isolate);
2654  Handle<HeapType> new_field_type = (new_details.type() == FIELD)
2655  ? handle(new_descriptors->GetFieldType(modify_index), isolate)
2656  : HeapType::Constant(handle(new_descriptors->GetValue(modify_index),
2657  isolate), isolate);
2658  old_map->PrintGeneralization(
2659  stdout, "", modify_index, split_nof, old_nof,
2660  old_details.type() == CONSTANT && store_mode == FORCE_FIELD,
2661  old_details.representation(), new_details.representation(),
2662  *old_field_type, *new_field_type);
2663  }
2664 
2665  // Add missing transitions.
2666  Handle<Map> new_map = split_map;
2667  for (int i = split_nof; i < old_nof; ++i) {
2668  new_map = CopyInstallDescriptors(new_map, i, new_descriptors);
2669  }
2670  new_map->set_owns_descriptors(true);
2671  return new_map;
2672 }
static Handle< DescriptorArray > Allocate(Isolate *isolate, int number_of_descriptors, int slack=0)
Definition: objects.cc:7790
static Handle< Map > CopyInstallDescriptors(Handle< Map > map, int new_descriptor, Handle< DescriptorArray > descriptors)
Definition: objects.cc:6565
static TypeHandle Constant(i::Handle< i::Object > value, Region *region)
Definition: types.h:330
#define DCHECK_NE(v1, v2)
Definition: logging.h:207
static LifetimePosition Max(LifetimePosition a, LifetimePosition b)
@ None
Definition: v8.h:2211

References v8::internal::DescriptorArray::Allocate(), v8::internal::CALLBACKS, v8::internal::CONSTANT, v8::internal::TypeImpl< Config >::Constant(), DCHECK, DCHECK_EQ, DCHECK_NE, v8::internal::FIELD, v8::internal::Representation::fits_into(), v8::internal::FORCE_FIELD, v8::internal::Representation::generalize(), v8::internal::handle(), v8::internal::Representation::IsDouble(), v8::internal::Representation::IsNone(), v8::internal::TransitionArray::kNotFound, v8::internal::Max(), and v8::None.

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

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

◆ GetBackPointer()

Object * v8::internal::Map::GetBackPointer ( )
inline

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

5134  {
5136  if (object->IsDescriptorArray()) {
5137  return TransitionArray::cast(object)->back_pointer_storage();
5138  } else {
5139  DCHECK(object->IsMap() || object->IsUndefined());
5140  return object;
5141  }
5142 }
static const int kTransitionsOrBackPointerOffset
Definition: objects.h:6196
static TransitionArray * cast(Object *obj)
#define READ_FIELD(p, offset)
Definition: objects-inl.h:1179

References v8::internal::TransitionArray::back_pointer_storage(), v8::internal::TransitionArray::cast(), DCHECK, kTransitionsOrBackPointerOffset, and READ_FIELD.

Referenced by DeprecateTarget(), EnsureDescriptorSlack(), FindFieldOwner(), FindRootMap(), v8::internal::TransitionArray::NewWith(), and SetBackPointer().

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

◆ GetInitialElements()

FixedArrayBase * v8::internal::Map::GetInitialElements ( )
inline

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

2891  {
2894  DCHECK(!GetHeap()->InNewSpace(GetHeap()->empty_fixed_array()));
2895  return GetHeap()->empty_fixed_array();
2896  } else if (has_external_array_elements()) {
2897  ExternalArray* empty_array = GetHeap()->EmptyExternalArrayForMap(this);
2898  DCHECK(!GetHeap()->InNewSpace(empty_array));
2899  return empty_array;
2900  } else if (has_fixed_typed_array_elements()) {
2901  FixedTypedArrayBase* empty_array =
2903  DCHECK(!GetHeap()->InNewSpace(empty_array));
2904  return empty_array;
2905  } else {
2906  UNREACHABLE();
2907  }
2908  return NULL;
2909 }
FixedTypedArrayBase * EmptyFixedTypedArrayForMap(Map *map)
Definition: heap.cc:3184
ExternalArray * EmptyExternalArrayForMap(Map *map)
Definition: heap.cc:3178
bool has_external_array_elements()
Definition: objects.h:5760
bool has_fast_smi_or_object_elements()
Definition: objects.h:5744
bool has_fixed_typed_array_elements()
Definition: objects.h:5764
bool has_fast_double_elements()
Definition: objects.h:5748
#define UNREACHABLE()
Definition: logging.h:30

References DCHECK, v8::internal::Heap::EmptyExternalArrayForMap(), v8::internal::Heap::EmptyFixedTypedArrayForMap(), v8::internal::HeapObject::GetHeap(), has_external_array_elements(), has_fast_double_elements(), has_fast_smi_or_object_elements(), has_fixed_typed_array_elements(), NULL, and UNREACHABLE.

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

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

◆ GetInObjectPropertyOffset()

int v8::internal::Map::GetInObjectPropertyOffset ( int  index)
inline

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

4251  {
4252  // Adjust for the number of properties stored in the object.
4253  index -= inobject_properties();
4254  DCHECK(index <= 0);
4255  return instance_size() + (index * kPointerSize);
4256 }

References DCHECK, inobject_properties(), instance_size(), and v8::internal::kPointerSize.

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

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

◆ GetLastDescriptorDetails()

PropertyDetails v8::internal::Map::GetLastDescriptorDetails ( )
inline

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

2867  {
2868  return instance_descriptors()->GetDetails(LastAdded());
2869 }

References LastAdded().

Referenced by v8::internal::TransitionArray::GetTargetDetails(), and v8::internal::JSObject::MigrateToNewProperty().

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

◆ GetPrototypeTransition()

Handle< Map > v8::internal::Map::GetPrototypeTransition ( Handle< Map map,
Handle< Object prototype 
)
staticprivate

Definition at line 11267 of file objects.cc.

11268  {
11269  FixedArray* cache = map->GetPrototypeTransitions();
11270  int number_of_transitions = map->NumberOfProtoTransitions();
11271  const int proto_offset =
11273  const int map_offset = kProtoTransitionHeaderSize + kProtoTransitionMapOffset;
11274  const int step = kProtoTransitionElementsPerEntry;
11275  for (int i = 0; i < number_of_transitions; i++) {
11276  if (cache->get(proto_offset + i * step) == *prototype) {
11277  Object* result = cache->get(map_offset + i * step);
11278  return Handle<Map>(Map::cast(result));
11279  }
11280  }
11281  return Handle<Map>();
11282 }
FixedArray * GetPrototypeTransitions()
Definition: objects-inl.h:5181
static const int kProtoTransitionMapOffset
Definition: objects.h:5905
static const int kProtoTransitionElementsPerEntry
Definition: objects.h:5903
static const int kProtoTransitionPrototypeOffset
Definition: objects.h:5904
int NumberOfProtoTransitions()
Definition: objects.h:5907
static const int kProtoTransitionHeaderSize
Definition: objects.h:5901

References v8::internal::FixedArray::get(), GetPrototypeTransitions(), kProtoTransitionElementsPerEntry, kProtoTransitionHeaderSize, kProtoTransitionMapOffset, kProtoTransitionPrototypeOffset, v8::internal::HeapObject::map(), and NumberOfProtoTransitions().

+ Here is the call graph for this function:

◆ GetPrototypeTransitions()

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

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

5181  {
5182  if (!HasTransitionArray()) return GetHeap()->empty_fixed_array();
5183  if (!transitions()->HasPrototypeTransitions()) {
5184  return GetHeap()->empty_fixed_array();
5185  }
5186  return transitions()->GetPrototypeTransitions();
5187 }
bool HasPrototypeTransitions()
Definition: objects-inl.h:5205

References v8::internal::HeapObject::GetHeap(), HasPrototypeTransitions(), and HasTransitionArray().

Referenced by GetPrototypeTransition(), PutPrototypeTransition(), SetPrototypeTransitions(), and ZapPrototypeTransitions().

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

◆ GetTransition()

Map * v8::internal::Map::GetTransition ( int  transition_index)
inline

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

5170  {
5171  return transitions()->GetTarget(transition_index);
5172 }

Referenced by LookupTransition(), TransitionToAccessorProperty(), TransitionToDataProperty(), and TryUpdateInternal().

+ Here is the caller graph for this function:

◆ has_code_cache()

bool v8::internal::Map::has_code_cache ( )
inline

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

4520  {
4521  return code_cache() != GetIsolate()->heap()->empty_fixed_array();
4522 }

References v8::internal::HeapObject::GetIsolate(), and v8::internal::Isolate::heap().

Referenced by v8::internal::MarkCompactMarkingVisitor::ObjectStatsTracker< MarkCompactMarkingVisitor::kVisitMap >::Visit().

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

◆ has_dictionary_elements()

bool v8::internal::Map::has_dictionary_elements ( )
inline

Definition at line 5768 of file objects.h.

5768  {
5770  }

References v8::internal::IsDictionaryElementsKind().

+ Here is the call graph for this function:

◆ has_external_array_elements()

bool v8::internal::Map::has_external_array_elements ( )
inline

Definition at line 5760 of file objects.h.

5760  {
5762  }

References v8::internal::IsExternalArrayElementsKind().

Referenced by GetInitialElements().

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

◆ has_fast_double_elements()

bool v8::internal::Map::has_fast_double_elements ( )
inline

Definition at line 5748 of file objects.h.

5748  {
5750  }
bool IsFastDoubleElementsKind(ElementsKind kind)

References v8::internal::IsFastDoubleElementsKind().

Referenced by GetInitialElements().

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

◆ has_fast_elements()

bool v8::internal::Map::has_fast_elements ( )
inline

Definition at line 5752 of file objects.h.

5752  {
5754  }

References v8::internal::IsFastElementsKind().

+ Here is the call graph for this function:

◆ has_fast_object_elements()

bool v8::internal::Map::has_fast_object_elements ( )
inline

Definition at line 5740 of file objects.h.

5740  {
5742  }
bool IsFastObjectElementsKind(ElementsKind kind)

References v8::internal::IsFastObjectElementsKind().

Referenced by v8::internal::JSFunction::EnsureHasInitialMap().

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

◆ has_fast_smi_elements()

bool v8::internal::Map::has_fast_smi_elements ( )
inline

Definition at line 5735 of file objects.h.

5735  {
5737  }
bool IsFastSmiElementsKind(ElementsKind kind)

References v8::internal::IsFastSmiElementsKind().

+ Here is the call graph for this function:

◆ has_fast_smi_or_object_elements()

bool v8::internal::Map::has_fast_smi_or_object_elements ( )
inline

Definition at line 5744 of file objects.h.

5744  {
5746  }
bool IsFastSmiOrObjectElementsKind(ElementsKind kind)

References v8::internal::IsFastSmiOrObjectElementsKind().

Referenced by GetInitialElements().

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

◆ has_fixed_typed_array_elements()

bool v8::internal::Map::has_fixed_typed_array_elements ( )
inline

Definition at line 5764 of file objects.h.

5764  {
5766  }
bool IsFixedTypedArrayElementsKind(ElementsKind kind)

References v8::internal::IsFixedTypedArrayElementsKind().

Referenced by GetInitialElements().

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

◆ has_indexed_interceptor()

bool v8::internal::Map::has_indexed_interceptor ( )
inline

Definition at line 5691 of file objects.h.

5691  {
5692  return ((1 << kHasIndexedInterceptor) & bit_field()) != 0;
5693  }
static const int kHasIndexedInterceptor
Definition: objects.h:6243

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

+ Here is the caller graph for this function:

◆ has_instance_call_handler()

bool v8::internal::Map::has_instance_call_handler ( )
inline

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

4455  {
4457 }

References bit_field3(), and v8::internal::BitFieldBase< T, shift, size, U >::decode().

Referenced by v8::internal::CheckEquivalent(), and v8::internal::HandleApiCallAsFunctionOrConstructor().

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

◆ has_named_interceptor()

bool v8::internal::Map::has_named_interceptor ( )
inline

Definition at line 5682 of file objects.h.

5682  {
5683  return ((1 << kHasNamedInterceptor) & bit_field()) != 0;
5684  }
static const int kHasNamedInterceptor
Definition: objects.h:6242

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

+ Here is the caller graph for this function:

◆ has_non_instance_prototype()

bool v8::internal::Map::has_non_instance_prototype ( )
inline

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

4372  {
4373  return ((1 << kHasNonInstancePrototype) & bit_field()) != 0;
4374 }
static const int kHasNonInstancePrototype
Definition: objects.h:6240

References bit_field(), and kHasNonInstancePrototype.

Referenced by v8::internal::JSFunction::has_prototype().

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

◆ has_sloppy_arguments_elements()

bool v8::internal::Map::has_sloppy_arguments_elements ( )
inline

Definition at line 5756 of file objects.h.

5756  {
5758  }
@ SLOPPY_ARGUMENTS_ELEMENTS
Definition: elements-kind.h:31

References v8::internal::SLOPPY_ARGUMENTS_ELEMENTS.

◆ has_slow_elements_kind()

bool v8::internal::Map::has_slow_elements_kind ( )
inline

Definition at line 5772 of file objects.h.

5772  {
5775  }

References v8::internal::DICTIONARY_ELEMENTS, and v8::internal::SLOPPY_ARGUMENTS_ELEMENTS.

◆ HasElementsTransition()

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

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

5145  {
5146  return HasTransitionArray() && transitions()->HasElementsTransition();
5147 }

References HasTransitionArray().

Referenced by CopyAsElementsKind(), and v8::internal::HashTable< MapCache, MapCacheShape, HashTableKey * >::New().

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

◆ Hash()

int v8::internal::Map::Hash ( )

Definition at line 9019 of file objects.cc.

9019  {
9020  // For performance reasons we only hash the 3 most variable fields of a map:
9021  // constructor, prototype and bit_field2. For predictability reasons we
9022  // use objects' offsets in respective pages for hashing instead of raw
9023  // addresses.
9024 
9025  // Shift away the tag.
9026  int hash = ObjectAddressForHashing(constructor()) >> 2;
9027 
9028  // XOR-ing the prototype and constructor directly yields too many zero bits
9029  // when the two pointers are close (which is fairly common).
9030  // To avoid this we shift the prototype bits relatively to the constructor.
9031  hash ^= ObjectAddressForHashing(prototype()) << (32 - kPageSizeBits);
9032 
9033  return hash ^ (hash >> 16) ^ bit_field2();
9034 }
const int kPageSizeBits
Definition: build_config.h:159
static uint32_t ObjectAddressForHashing(Object *object)
Definition: objects.cc:9013

References bit_field2(), kPageSizeBits, and v8::internal::ObjectAddressForHashing().

Referenced by v8::internal::NormalizedMapCache::GetIndex().

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

◆ HasPrototypeTransitions()

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

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

5205  {
5206  return HasTransitionArray() && transitions()->HasPrototypeTransitions();
5207 }

References HasTransitionArray().

Referenced by GetPrototypeTransitions(), and SetPrototypeTransitions().

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

◆ HasTransitionArray()

bool v8::internal::Map::HasTransitionArray ( ) const
inline

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

5150  {
5152  return object->IsTransitionArray();
5153 }

References kTransitionsOrBackPointerOffset, and READ_FIELD.

Referenced by CanHaveMoreTransitions(), v8::internal::TransitionArray::CopyInsert(), ExpectedTransitionKey(), FindLastMatchMap(), FindTransitionToField(), GetPrototypeTransitions(), HasElementsTransition(), HasPrototypeTransitions(), SearchTransition(), and v8::internal::MarkCompactMarkingVisitor::ObjectStatsTracker< MarkCompactMarkingVisitor::kVisitMap >::Visit().

+ Here is the caller graph for this function:

◆ IndexInCodeCache()

int v8::internal::Map::IndexInCodeCache ( Object name,
Code code 
)

Definition at line 7057 of file objects.cc.

7057  {
7058  // Get the internal index if a code cache exists.
7059  if (!code_cache()->IsFixedArray()) {
7060  return CodeCache::cast(code_cache())->GetIndex(name, code);
7061  }
7062  return -1;
7063 }

References name.

◆ init_back_pointer()

void v8::internal::Map::init_back_pointer ( Object undefined)
inline

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

5245  {
5246  DCHECK(undefined->IsUndefined());
5247  WRITE_FIELD(this, kTransitionsOrBackPointerOffset, undefined);
5248 }

References DCHECK, kTransitionsOrBackPointerOffset, and WRITE_FIELD.

◆ InitializeDescriptors()

void v8::internal::Map::InitializeDescriptors ( DescriptorArray descriptors)
inline

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

5102  {
5103  int len = descriptors->number_of_descriptors();
5104  set_instance_descriptors(descriptors);
5106 }

References v8::internal::DescriptorArray::number_of_descriptors(), and SetNumberOfOwnDescriptors().

+ Here is the call graph for this function:

◆ InitialPropertiesLength()

int v8::internal::Map::InitialPropertiesLength ( )
inline

Definition at line 6066 of file objects.h.

6066  {
6069  }

◆ inobject_properties()

int v8::internal::Map::inobject_properties ( )
inline

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

4241  {
4243 }
static const int kInObjectPropertiesOffset
Definition: objects.h:6212

References kInObjectPropertiesOffset, and READ_BYTE_FIELD.

Referenced by v8::internal::JSObject::AllocateStorageForMap(), CopyDropDescriptors(), CopyNormalized(), EquivalentToForNormalization(), GetInObjectPropertyOffset(), v8::internal::JSObject::GetInternalFieldCount(), and TooManyFastProperties().

+ Here is the caller graph for this function:

◆ instance_size()

int v8::internal::Map::instance_size ( )
inline

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

4235  {
4238 }
static const int kInstanceSizeOffset
Definition: objects.h:6210
#define NOBARRIER_READ_BYTE_FIELD(p, offset)
Definition: objects-inl.h:1299

References kInstanceSizeOffset, v8::internal::kPointerSizeLog2, and NOBARRIER_READ_BYTE_FIELD.

Referenced by CopyDropDescriptors(), CopyNormalized(), GetInObjectPropertyOffset(), v8::internal::JSObject::InitializeBody(), v8::internal::JSObject::MigrateFastToSlow(), v8::internal::HeapObject::SizeFromMap(), and v8::internal::JSObject::BodyDescriptor::SizeOf().

+ Here is the caller graph for this function:

◆ instance_type()

InstanceType v8::internal::Map::instance_type ( )
inline

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

4323  {
4324  return static_cast<InstanceType>(READ_BYTE_FIELD(this, kInstanceTypeOffset));
4325 }
static const int kInstanceTypeOffset
Definition: objects.h:6229

References kInstanceTypeOffset, and READ_BYTE_FIELD.

Referenced by v8::internal::Heap::AllowedToBeMigrated(), v8::internal::CheckEquivalent(), v8::DumpHeapConstants(), v8::internal::ElementsKindForArray(), v8::internal::JSObject::GetHeaderSize(), v8::internal::V8HeapExplorer::GetSystemEntryName(), v8::internal::String::HasOnlyOneByteChars(), v8::internal::String::IsOneByteRepresentation(), v8::internal::String::IsOneByteRepresentationUnderneath(), v8::internal::String::IsTwoByteRepresentation(), v8::internal::String::IsTwoByteRepresentationUnderneath(), v8::internal::HeapObject::MayContainRawValues(), v8::internal::ConsStringIteratorOp::NextLeaf(), RawCopy(), v8::internal::NewSpace::RecordAllocation(), v8::internal::NewSpace::RecordPromotion(), v8::internal::RUNTIME_FUNCTION(), v8::internal::ConsStringIteratorOp::Search(), v8::internal::Serializer::ObjectSerializer::Serialize(), SetBackPointer(), v8::internal::JSFunction::SetInstancePrototype(), v8::internal::HeapObject::SizeFromMap(), and v8::internal::Heap::UpdateAllocationSiteFeedback().

+ Here is the caller graph for this function:

◆ InstancesNeedRewriting()

bool v8::internal::Map::InstancesNeedRewriting ( Map target,
int  target_number_of_fields,
int  target_inobject,
int  target_unused,
int old_number_of_fields 
)

Definition at line 1844 of file objects.cc.

1846  {
1847  // If fields were added (or removed), rewrite the instance.
1848  *old_number_of_fields = NumberOfFields();
1849  DCHECK(target_number_of_fields >= *old_number_of_fields);
1850  if (target_number_of_fields != *old_number_of_fields) return true;
1851 
1852  // If smi descriptors were replaced by double descriptors, rewrite.
1853  DescriptorArray* old_desc = instance_descriptors();
1854  DescriptorArray* new_desc = target->instance_descriptors();
1855  int limit = NumberOfOwnDescriptors();
1856  for (int i = 0; i < limit; i++) {
1857  if (new_desc->GetDetails(i).representation().IsDouble() !=
1858  old_desc->GetDetails(i).representation().IsDouble()) {
1859  return true;
1860  }
1861  }
1862 
1863  // If no fields were added, and no inobject properties were removed, setting
1864  // the map is sufficient.
1865  if (target_inobject == inobject_properties()) return false;
1866  // In-object slack tracking may have reduced the object size of the new map.
1867  // In that case, succeed if all existing fields were inobject, and they still
1868  // fit within the new inobject size.
1869  DCHECK(target_inobject < inobject_properties());
1870  if (target_number_of_fields <= target_inobject) {
1871  DCHECK(target_number_of_fields + target_unused == target_inobject);
1872  return false;
1873  }
1874  // Otherwise, properties will need to be moved to the backing store.
1875  return true;
1876 }
int NumberOfFields()
Definition: objects.cc:2095

◆ is_access_check_needed()

bool v8::internal::Map::is_access_check_needed ( )
inline

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

4396  {
4397  return ((1 << kIsAccessCheckNeeded) & bit_field()) != 0;
4398 }
static const int kIsAccessCheckNeeded
Definition: objects.h:6246

References bit_field(), and kIsAccessCheckNeeded.

+ Here is the call graph for this function:

◆ is_deprecated()

bool v8::internal::Map::is_deprecated ( )
inline

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

4465  {
4466  return Deprecated::decode(bit_field3());
4467 }

References bit_field3(), and v8::internal::BitFieldBase< T, shift, size, U >::decode().

Referenced by v8::internal::JSObject::JSObjectShortPrint(), and Update().

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

◆ is_dictionary_map()

bool v8::internal::Map::is_dictionary_map ( )
inline

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

4430  {
4432 }

References bit_field3(), and v8::internal::BitFieldBase< T, shift, size, U >::decode().

Referenced by PrepareForDataProperty(), PutPrototypeTransition(), RawCopy(), ReconfigureDataProperty(), TransitionToAccessorProperty(), and TransitionToDataProperty().

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

◆ is_extensible()

bool v8::internal::Map::is_extensible ( )
inline

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

4409  {
4410  return ((1 << kIsExtensible) & bit_field2()) != 0;
4411 }
static const int kIsExtensible
Definition: objects.h:6250

References bit_field2(), and kIsExtensible.

+ Here is the call graph for this function:

◆ is_frozen()

bool v8::internal::Map::is_frozen ( )
inline

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

4505  {
4506  return IsFrozen::decode(bit_field3());
4507 }

References bit_field3(), and v8::internal::BitFieldBase< T, shift, size, U >::decode().

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

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

◆ is_hidden_prototype()

bool v8::internal::Map::is_hidden_prototype ( )
inline

Definition at line 5673 of file objects.h.

5673  {
5674  return ((1 << kIsHiddenPrototype) & bit_field()) != 0;
5675  }
static const int kIsHiddenPrototype
Definition: objects.h:6241

◆ is_migration_target()

bool v8::internal::Map::is_migration_target ( )
inline

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

4475  {
4477 }

References bit_field3(), and v8::internal::BitFieldBase< T, shift, size, U >::decode().

+ Here is the call graph for this function:

◆ is_observed()

bool v8::internal::Map::is_observed ( )
inline

Definition at line 5714 of file objects.h.

5714  {
5715  return ((1 << kIsObserved) & bit_field()) != 0;
5716  }
static const int kIsObserved
Definition: objects.h:6245

Referenced by CopyForObserved().

+ Here is the caller graph for this function:

◆ is_prototype_map()

bool v8::internal::Map::is_prototype_map ( )
inline

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

4418  {
4420 }

References bit_field2(), and v8::internal::BitFieldBase< T, shift, size, U >::decode().

Referenced by CopyForObserved(), CopyReplaceDescriptors(), PutPrototypeTransition(), TooManyFastProperties(), and TransitionToAccessorProperty().

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

◆ is_stable()

bool v8::internal::Map::is_stable ( )
inline

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

4515  {
4516  return !IsUnstable::decode(bit_field3());
4517 }

References bit_field3(), and v8::internal::BitFieldBase< T, shift, size, U >::decode().

Referenced by CanOmitMapChecks(), and NotifyLeafMapLayoutChange().

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

◆ is_undetectable()

bool v8::internal::Map::is_undetectable ( )
inline

Definition at line 5705 of file objects.h.

5705  {
5706  return ((1 << kIsUndetectable) & bit_field()) != 0;
5707  }
static const int kIsUndetectable
Definition: objects.h:6244

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

+ Here is the caller graph for this function:

◆ IsGlobalObjectMap()

bool v8::internal::Map::IsGlobalObjectMap ( )
inline

Definition at line 6138 of file objects.h.

6138  {
6139  const InstanceType type = instance_type();
6140  return type == JS_GLOBAL_OBJECT_TYPE || type == JS_BUILTINS_OBJECT_TYPE;
6141  }
@ JS_GLOBAL_OBJECT_TYPE
Definition: objects.h:735
@ JS_BUILTINS_OBJECT_TYPE
Definition: objects.h:736

References v8::internal::JS_BUILTINS_OBJECT_TYPE, and v8::internal::JS_GLOBAL_OBJECT_TYPE.

Referenced by TransitionToAccessorProperty().

+ Here is the caller graph for this function:

◆ IsJSGlobalObjectMap()

bool v8::internal::Map::IsJSGlobalObjectMap ( )
inline

Definition at line 6135 of file objects.h.

6135  {
6137  }

References v8::internal::JS_GLOBAL_OBJECT_TYPE.

◆ IsJSGlobalProxyMap()

bool v8::internal::Map::IsJSGlobalProxyMap ( )
inline

Definition at line 6132 of file objects.h.

6132  {
6133  return instance_type() == JS_GLOBAL_PROXY_TYPE;
6134  }
@ JS_GLOBAL_PROXY_TYPE
Definition: objects.h:737

References v8::internal::JS_GLOBAL_PROXY_TYPE.

◆ IsJSObjectMap()

bool v8::internal::Map::IsJSObjectMap ( )
inline

Definition at line 6125 of file objects.h.

6125  {
6126  return instance_type() >= FIRST_JS_OBJECT_TYPE;
6127  }

References v8::internal::FIRST_JS_OBJECT_TYPE.

Referenced by v8::internal::AccessorInfo::IsCompatibleReceiverType(), and v8::internal::FunctionTemplateInfo::IsTemplateFor().

+ Here is the caller graph for this function:

◆ IsJSProxyMap()

bool v8::internal::Map::IsJSProxyMap ( )
inline

Definition at line 6128 of file objects.h.

6128  {
6129  InstanceType type = instance_type();
6130  return FIRST_JS_PROXY_TYPE <= type && type <= LAST_JS_PROXY_TYPE;
6131  }
@ FIRST_JS_PROXY_TYPE
Definition: objects.h:778
@ LAST_JS_PROXY_TYPE
Definition: objects.h:779

References v8::internal::FIRST_JS_PROXY_TYPE, and v8::internal::LAST_JS_PROXY_TYPE.

◆ IsMapInArrayPrototypeChain()

bool v8::internal::Map::IsMapInArrayPrototypeChain ( )

Definition at line 3280 of file objects.cc.

3280  {
3281  Isolate* isolate = GetIsolate();
3282  if (isolate->initial_array_prototype()->map() == this) {
3283  return true;
3284  }
3285 
3286  if (isolate->initial_object_prototype()->map() == this) {
3287  return true;
3288  }
3289 
3290  return false;
3291 }

References v8::internal::HeapObject::GetIsolate().

+ Here is the call graph for this function:

◆ IsValidElementsTransition()

bool v8::internal::Map::IsValidElementsTransition ( ElementsKind  from_kind,
ElementsKind  to_kind 
)
static

Definition at line 12775 of file objects.cc.

12776  {
12777  // Transitions can't go backwards.
12778  if (!IsMoreGeneralElementsKindTransition(from_kind, to_kind)) {
12779  return false;
12780  }
12781 
12782  // Transitions from HOLEY -> PACKED are not allowed.
12783  return !IsFastHoleyElementsKind(from_kind) ||
12784  IsFastHoleyElementsKind(to_kind);
12785 }
bool IsFastHoleyElementsKind(ElementsKind kind)

References v8::internal::IsFastHoleyElementsKind(), and v8::internal::IsMoreGeneralElementsKindTransition().

Referenced by v8::internal::HOptimizedGraphBuilder::HandlePolymorphicElementAccess(), and v8::internal::TransitionElements().

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

◆ LastAdded()

int v8::internal::Map::LastAdded ( )
inline

Definition at line 5938 of file objects.h.

5938  {
5939  int number_of_own_descriptors = NumberOfOwnDescriptors();
5940  DCHECK(number_of_own_descriptors > 0);
5941  return number_of_own_descriptors - 1;
5942  }

References DCHECK.

Referenced by CanBeDeprecated(), v8::internal::TransitionArray::GetKey(), GetLastDescriptorDetails(), v8::internal::JSObject::MigrateToNewProperty(), and v8::internal::BASE_EMBEDDED< Visitor >::TransitionResult().

+ Here is the caller graph for this function:

◆ LookupDescriptor()

void v8::internal::Map::LookupDescriptor ( JSObject holder,
Name name,
LookupResult *  result 
)
inline

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

2874  {
2875  DescriptorArray* descriptors = this->instance_descriptors();
2876  int number = descriptors->SearchWithCache(name, this);
2877  if (number == DescriptorArray::kNotFound) return result->NotFound();
2878  result->DescriptorResult(holder, descriptors->GetDetails(number), number);
2879 }

References v8::internal::DescriptorArray::GetDetails(), v8::internal::DescriptorArray::kNotFound, and name.

+ Here is the call graph for this function:

◆ LookupElementsTransitionMap()

Map * v8::internal::Map::LookupElementsTransitionMap ( ElementsKind  elements_kind)

Definition at line 3273 of file objects.cc.

3273  {
3274  Map* to_map = FindClosestElementsTransition(this, to_kind);
3275  if (to_map->elements_kind() == to_kind) return to_map;
3276  return NULL;
3277 }

References elements_kind(), v8::internal::FindClosestElementsTransition(), and NULL.

Referenced by v8::internal::IC::IsTransitionOfMonomorphicTarget().

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

◆ LookupTransition()

void v8::internal::Map::LookupTransition ( JSObject holder,
Name name,
LookupResult *  result 
)
inline

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

2884  {
2885  int transition_index = this->SearchTransition(name);
2886  if (transition_index == TransitionArray::kNotFound) return result->NotFound();
2887  result->TransitionResult(holder, this->GetTransition(transition_index));
2888 }
Map * GetTransition(int transition_index)
Definition: objects-inl.h:5170
int SearchTransition(Name *name)
Definition: objects-inl.h:5175

References GetTransition(), v8::internal::TransitionArray::kNotFound, and SearchTransition().

+ Here is the call graph for this function:

◆ mark_unstable()

void v8::internal::Map::mark_unstable ( )
inline

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

4510  {
4512 }

References bit_field3(), set_bit_field3(), and v8::internal::BitFieldBase< T, shift, size, U >::update().

Referenced by NotifyLeafMapLayoutChange().

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

◆ NextFreePropertyIndex()

int v8::internal::Map::NextFreePropertyIndex ( )

Definition at line 5663 of file objects.cc.

5663  {
5664  int max_index = -1;
5665  int number_of_own_descriptors = NumberOfOwnDescriptors();
5666  DescriptorArray* descs = instance_descriptors();
5667  for (int i = 0; i < number_of_own_descriptors; i++) {
5668  if (descs->GetType(i) == FIELD) {
5669  int current_index = descs->GetFieldIndex(i);
5670  if (current_index > max_index) max_index = current_index;
5671  }
5672  }
5673  return max_index + 1;
5674 }

References v8::internal::FIELD, v8::internal::DescriptorArray::GetFieldIndex(), and v8::internal::DescriptorArray::GetType().

+ Here is the call graph for this function:

◆ Normalize()

Handle< Map > v8::internal::Map::Normalize ( Handle< Map map,
PropertyNormalizationMode  mode 
)
static

Definition at line 6398 of file objects.cc.

6399  {
6400  DCHECK(!fast_map->is_dictionary_map());
6401 
6402  Isolate* isolate = fast_map->GetIsolate();
6403  Handle<Object> maybe_cache(isolate->native_context()->normalized_map_cache(),
6404  isolate);
6405  bool use_cache = !maybe_cache->IsUndefined();
6406  Handle<NormalizedMapCache> cache;
6407  if (use_cache) cache = Handle<NormalizedMapCache>::cast(maybe_cache);
6408 
6409  Handle<Map> new_map;
6410  if (use_cache && cache->Get(fast_map, mode).ToHandle(&new_map)) {
6411 #ifdef VERIFY_HEAP
6412  if (FLAG_verify_heap) new_map->DictionaryMapVerify();
6413 #endif
6414 #ifdef ENABLE_SLOW_DCHECKS
6416  // The cached map should match newly created normalized map bit-by-bit,
6417  // except for the code cache, which can contain some ics which can be
6418  // applied to the shared map.
6419  Handle<Map> fresh = Map::CopyNormalized(fast_map, mode);
6420 
6421  DCHECK(memcmp(fresh->address(),
6422  new_map->address(),
6423  Map::kCodeCacheOffset) == 0);
6426  int offset = Map::kDependentCodeOffset + kPointerSize;
6427  DCHECK(memcmp(fresh->address() + offset,
6428  new_map->address() + offset,
6429  Map::kSize - offset) == 0);
6430  }
6431 #endif
6432  } else {
6433  new_map = Map::CopyNormalized(fast_map, mode);
6434  if (use_cache) {
6435  cache->Set(fast_map, new_map);
6436  isolate->counters()->normalized_maps()->Increment();
6437  }
6438  }
6439  fast_map->NotifyLeafMapLayoutChange();
6440  return new_map;
6441 }
static Handle< T > cast(Handle< S > that)
Definition: handles.h:116
static Handle< Map > CopyNormalized(Handle< Map > map, PropertyNormalizationMode mode)
Definition: objects.cc:6444
static const int kDependentCodeOffset
Definition: objects.h:6201
static const int kSize
Definition: objects.h:6202
const bool FLAG_enable_slow_asserts
Definition: checks.h:31

References v8::internal::Handle< T >::cast(), CopyNormalized(), v8::internal::Isolate::counters(), DCHECK, v8::internal::FLAG_enable_slow_asserts, kCodeCacheOffset, kDependentCodeOffset, v8::internal::kPointerSize, kSize, mode(), v8::internal::Isolate::native_context(), and v8::internal::HeapObject::STATIC_ASSERT().

Referenced by v8::internal::JSObject::NormalizeProperties(), TransitionToAccessorProperty(), and TransitionToDataProperty().

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

◆ NotifyLeafMapLayoutChange()

void v8::internal::Map::NotifyLeafMapLayoutChange ( )
inlineprivate

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

4539  {
4540  if (is_stable()) {
4541  mark_unstable();
4542  dependent_code()->DeoptimizeDependentCodeGroup(
4543  GetIsolate(),
4545  }
4546 }

References v8::internal::dependent_code, v8::internal::HeapObject::GetIsolate(), is_stable(), v8::internal::DependentCode::kPrototypeCheckGroup, and mark_unstable().

Referenced by CopyDropDescriptors().

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

◆ NumberOfDescribedProperties()

int v8::internal::Map::NumberOfDescribedProperties ( DescriptorFlag  which = OWN_DESCRIPTORS,
PropertyAttributes  filter = NONE 
)

Definition at line 5646 of file objects.cc.

5647  {
5648  int result = 0;
5649  DescriptorArray* descs = instance_descriptors();
5650  int limit = which == ALL_DESCRIPTORS
5651  ? descs->number_of_descriptors()
5653  for (int i = 0; i < limit; i++) {
5654  if ((descs->GetDetails(i).attributes() & filter) == 0 &&
5655  !FilterKey(descs->GetKey(i), filter)) {
5656  result++;
5657  }
5658  }
5659  return result;
5660 }
static bool FilterKey(Object *key, PropertyAttributes filter)
Definition: objects.cc:5628
@ ALL_DESCRIPTORS
Definition: objects.h:286

References v8::internal::ALL_DESCRIPTORS, v8::internal::FilterKey(), v8::internal::DescriptorArray::GetDetails(), v8::internal::DescriptorArray::GetKey(), and v8::internal::DescriptorArray::number_of_descriptors().

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

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

◆ NumberOfFields()

int v8::internal::Map::NumberOfFields ( )

Definition at line 2095 of file objects.cc.

2095  {
2096  DescriptorArray* descriptors = instance_descriptors();
2097  int result = 0;
2098  for (int i = 0; i < NumberOfOwnDescriptors(); i++) {
2099  if (descriptors->GetDetails(i).type() == FIELD) result++;
2100  }
2101  return result;
2102 }

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

Referenced by TooManyFastProperties().

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

◆ NumberOfOwnDescriptors()

◆ NumberOfProtoTransitions()

int v8::internal::Map::NumberOfProtoTransitions ( )
inline

Definition at line 5907 of file objects.h.

5907  {
5908  FixedArray* cache = GetPrototypeTransitions();
5909  if (cache->length() == 0) return 0;
5910  return
5911  Smi::cast(cache->get(kProtoTransitionNumberOfEntriesOffset))->value();
5912  }
static const int kProtoTransitionNumberOfEntriesOffset
Definition: objects.h:5902

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

Referenced by GetPrototypeTransition(), PutPrototypeTransition(), and SetPrototypeTransitions().

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

◆ owns_descriptors()

bool v8::internal::Map::owns_descriptors ( )
inline

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

4445  {
4447 }

References bit_field3(), and v8::internal::BitFieldBase< T, shift, size, U >::decode().

Referenced by CopyAddDescriptor(), CopyAsElementsKind(), CopyForObserved(), EnsureDescriptorSlack(), set_owns_descriptors(), and v8::internal::MarkCompactMarkingVisitor::ObjectStatsTracker< MarkCompactMarkingVisitor::kVisitMap >::Visit().

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

◆ pre_allocated_property_fields()

int v8::internal::Map::pre_allocated_property_fields ( )
inline

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

4246  {
4248 }
static const int kPreAllocatedPropertyFieldsOffset
Definition: objects.h:6215

References kPreAllocatedPropertyFieldsOffset, and READ_BYTE_FIELD.

Referenced by CopyDropDescriptors(), and v8::internal::JSObject::InitializeBody().

+ Here is the caller graph for this function:

◆ PrepareForDataProperty()

Handle< Map > v8::internal::Map::PrepareForDataProperty ( Handle< Map old_map,
int  descriptor_number,
Handle< Object value 
)
static

Definition at line 6738 of file objects.cc.

6739  {
6740  // Dictionaries can store any property value.
6741  if (map->is_dictionary_map()) return map;
6742 
6743  // Migrate to the newest map before storing the property.
6744  map = Update(map);
6745 
6746  Handle<DescriptorArray> descriptors(map->instance_descriptors());
6747 
6748  if (descriptors->CanHoldValue(descriptor, *value)) return map;
6749 
6750  Isolate* isolate = map->GetIsolate();
6751  Representation representation = value->OptimalRepresentation();
6752  Handle<HeapType> type = value->OptimalType(isolate, representation);
6753 
6754  return GeneralizeRepresentation(map, descriptor, representation, type,
6755  FORCE_FIELD);
6756 }
static Handle< Map > Update(Handle< Map > map)
Definition: objects.cc:2705
bool is_dictionary_map()
Definition: objects-inl.h:4430

References v8::internal::FORCE_FIELD, v8::internal::HeapObject::GetIsolate(), is_dictionary_map(), and v8::internal::HeapObject::map().

Referenced by TransitionToDataProperty().

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

◆ PrintGeneralization()

void v8::internal::Map::PrintGeneralization ( FILE *  file,
const char *  reason,
int  modify_index,
int  split,
int  descriptors,
bool  constant_to_field,
Representation  old_representation,
Representation  new_representation,
HeapType old_field_type,
HeapType new_field_type 
)
private

Definition at line 1303 of file objects.cc.

1312  {
1313  OFStream os(file);
1314  os << "[generalizing ";
1316  os << "] ";
1317  Name* name = instance_descriptors()->GetKey(modify_index);
1318  if (name->IsString()) {
1319  String::cast(name)->PrintOn(file);
1320  } else {
1321  os << "{symbol " << static_cast<void*>(name) << "}";
1322  }
1323  os << ":";
1324  if (constant_to_field) {
1325  os << "c";
1326  } else {
1327  os << old_representation.Mnemonic() << "{";
1328  old_field_type->PrintTo(os, HeapType::SEMANTIC_DIM);
1329  os << "}";
1330  }
1331  os << "->" << new_representation.Mnemonic() << "{";
1332  new_field_type->PrintTo(os, HeapType::SEMANTIC_DIM);
1333  os << "} (";
1334  if (strlen(reason) > 0) {
1335  os << reason;
1336  } else {
1337  os << "+" << (descriptors - split) << " maps";
1338  }
1339  os << ") [";
1340  JavaScriptFrame::PrintTop(GetIsolate(), file, false, true);
1341  os << "]\n";
1342 }
static void PrintTop(Isolate *isolate, FILE *file, bool print_args, bool print_line_number)
Definition: frames.cc:811
String * constructor_name()
Definition: objects.cc:1689
void PrintOn(FILE *out)
Definition: objects.cc:9005
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 only print modified registers Trace simulator debug messages Implied by trace sim abort randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot A filename with extra code to be included in the A file to write the raw snapshot bytes A file to write the raw context snapshot bytes Write V8 startup blob file(mksnapshot only)") DEFINE_BOOL(profile_hydrogen_code_stub_compilation

References constructor_name(), file(), v8::internal::HeapObject::GetIsolate(), v8::internal::Representation::Mnemonic(), name, v8::internal::String::PrintOn(), v8::internal::TypeImpl< Config >::PrintTo(), v8::internal::JavaScriptFrame::PrintTop(), and v8::internal::TypeImpl< Config >::SEMANTIC_DIM.

Referenced by CopyGeneralizeAllRepresentations(), and GeneralizeFieldType().

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

◆ PutPrototypeTransition()

Handle< Map > v8::internal::Map::PutPrototypeTransition ( Handle< Map map,
Handle< Object prototype,
Handle< Map target_map 
)
staticprivate

Definition at line 11285 of file objects.cc.

11287  {
11288  DCHECK(target_map->IsMap());
11289  DCHECK(HeapObject::cast(*prototype)->map()->IsMap());
11290  // Don't cache prototype transition if this map is either shared, or a map of
11291  // a prototype.
11292  if (map->is_prototype_map()) return map;
11293  if (map->is_dictionary_map() || !FLAG_cache_prototype_transitions) return map;
11294 
11295  const int step = kProtoTransitionElementsPerEntry;
11296  const int header = kProtoTransitionHeaderSize;
11297 
11298  Handle<FixedArray> cache(map->GetPrototypeTransitions());
11299  int capacity = (cache->length() - header) / step;
11300  int transitions = map->NumberOfProtoTransitions() + 1;
11301 
11302  if (transitions > capacity) {
11303  if (capacity > kMaxCachedPrototypeTransitions) return map;
11304 
11305  // Grow array by factor 2 over and above what we need.
11306  cache = FixedArray::CopySize(cache, transitions * 2 * step + header);
11307 
11308  SetPrototypeTransitions(map, cache);
11309  }
11310 
11311  // Reload number of transitions as GC might shrink them.
11312  int last = map->NumberOfProtoTransitions();
11313  int entry = header + last * step;
11314 
11315  cache->set(entry + kProtoTransitionPrototypeOffset, *prototype);
11316  cache->set(entry + kProtoTransitionMapOffset, *target_map);
11317  map->SetNumberOfProtoTransitions(last + 1);
11318 
11319  return map;
11320 }
static Handle< FixedArray > CopySize(Handle< FixedArray > array, int new_length, PretenureFlag pretenure=NOT_TENURED)
Definition: objects.cc:7749
void SetNumberOfProtoTransitions(int value)
Definition: objects.h:5914
static const int kMaxCachedPrototypeTransitions
Definition: objects.h:6180
static void SetPrototypeTransitions(Handle< Map > map, Handle< FixedArray > prototype_transitions)
Definition: objects-inl.h:5190

References v8::internal::FixedArray::CopySize(), DCHECK, GetPrototypeTransitions(), is_dictionary_map(), is_prototype_map(), kMaxCachedPrototypeTransitions, kProtoTransitionElementsPerEntry, kProtoTransitionHeaderSize, kProtoTransitionMapOffset, kProtoTransitionPrototypeOffset, v8::internal::HeapObject::map(), NumberOfProtoTransitions(), SetNumberOfProtoTransitions(), and SetPrototypeTransitions().

+ Here is the call graph for this function:

◆ RawCopy()

Handle< Map > v8::internal::Map::RawCopy ( Handle< Map map,
int  instance_size 
)
staticprivate

Definition at line 6375 of file objects.cc.

6375  {
6376  Handle<Map> result = map->GetIsolate()->factory()->NewMap(
6378  result->set_prototype(map->prototype());
6379  result->set_constructor(map->constructor());
6380  result->set_bit_field(map->bit_field());
6381  result->set_bit_field2(map->bit_field2());
6382  int new_bit_field3 = map->bit_field3();
6383  new_bit_field3 = OwnsDescriptors::update(new_bit_field3, true);
6384  new_bit_field3 = NumberOfOwnDescriptorsBits::update(new_bit_field3, 0);
6385  new_bit_field3 = EnumLengthBits::update(new_bit_field3,
6387  new_bit_field3 = Deprecated::update(new_bit_field3, false);
6388  if (!map->is_dictionary_map()) {
6389  new_bit_field3 = IsUnstable::update(new_bit_field3, false);
6390  }
6391  new_bit_field3 = ConstructionCount::update(new_bit_field3,
6393  result->set_bit_field3(new_bit_field3);
6394  return result;
6395 }
Factory * factory()
Definition: isolate.h:982
static const int kNoSlackTracking
Definition: objects.h:7263

References bit_field(), bit_field2(), bit_field3(), v8::internal::Isolate::factory(), v8::internal::HeapObject::GetIsolate(), instance_type(), is_dictionary_map(), v8::internal::kInvalidEnumCacheSentinel, v8::internal::JSFunction::kNoSlackTracking, and v8::internal::HeapObject::map().

+ Here is the call graph for this function:

◆ ReconfigureDataProperty()

Handle< Map > v8::internal::Map::ReconfigureDataProperty ( Handle< Map map,
int  descriptor,
PropertyAttributes  attributes 
)
static

Definition at line 6804 of file objects.cc.

6805  {
6806  // Dictionaries have to be reconfigured in-place.
6808 
6809  // For now, give up on transitioning and just create a unique map.
6810  // TODO(verwaest/ishell): Cache transitions with different attributes.
6811  return CopyGeneralizeAllRepresentations(map, descriptor, FORCE_FIELD,
6812  attributes, "attributes mismatch");
6813 }

References DCHECK, v8::internal::FORCE_FIELD, is_dictionary_map(), and v8::internal::HeapObject::map().

+ Here is the call graph for this function:

◆ RemoveFromCodeCache()

void v8::internal::Map::RemoveFromCodeCache ( Name name,
Code code,
int  index 
)

Definition at line 7066 of file objects.cc.

7066  {
7067  // No GC is supposed to happen between a call to IndexInCodeCache and
7068  // RemoveFromCodeCache so the code cache must be there.
7069  DCHECK(!code_cache()->IsFixedArray());
7070  CodeCache::cast(code_cache())->RemoveByIndex(name, code, index);
7071 }

References DCHECK, and name.

◆ RetrieveDescriptorsPointer()

Cell* v8::internal::Map::RetrieveDescriptorsPointer ( )
inline

◆ SearchTransition()

int v8::internal::Map::SearchTransition ( Name name)
inline

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

5175  {
5176  if (HasTransitionArray()) return transitions()->Search(name);
5178 }

References HasTransitionArray(), v8::internal::TransitionArray::kNotFound, and name.

Referenced by LookupTransition(), TransitionToAccessorProperty(), TransitionToDataProperty(), and TryUpdateInternal().

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

◆ set_bit_field()

void v8::internal::Map::set_bit_field ( byte  value)
inline

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

4348  {
4349  WRITE_BYTE_FIELD(this, kBitFieldOffset, value);
4350 }
#define WRITE_BYTE_FIELD(p, offset, value)
Definition: objects-inl.h:1303

References kBitFieldOffset, and WRITE_BYTE_FIELD.

Referenced by set_function_with_prototype(), set_is_access_check_needed(), and set_non_instance_prototype().

+ Here is the caller graph for this function:

◆ set_bit_field2()

void v8::internal::Map::set_bit_field2 ( byte  value)
inline

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

4358  {
4359  WRITE_BYTE_FIELD(this, kBitField2Offset, value);
4360 }

References kBitField2Offset, and WRITE_BYTE_FIELD.

Referenced by set_is_extensible(), and set_is_prototype_map().

+ Here is the caller graph for this function:

◆ set_bit_field3()

void v8::internal::Map::set_bit_field3 ( uint32_t  bits)
inline

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

5112  {
5113  if (kInt32Size != kPointerSize) {
5115  }
5116  WRITE_UINT32_FIELD(this, kBitField3Offset, bits);
5117 }
const int kInt32Size
Definition: globals.h:125
#define WRITE_UINT32_FIELD(p, offset, value)
Definition: objects-inl.h:1275

References v8::internal::kInt32Size, v8::internal::kPointerSize, and WRITE_UINT32_FIELD.

Referenced by deprecate(), freeze(), mark_unstable(), set_construction_count(), set_dictionary_map(), set_done_inobject_slack_tracking(), set_has_instance_call_handler(), set_migration_target(), and set_owns_descriptors().

+ Here is the caller graph for this function:

◆ set_construction_count()

void v8::internal::Map::set_construction_count ( int  value)
inline

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

4490  {
4492 }

References bit_field3(), set_bit_field3(), and v8::internal::BitFieldBase< T, shift, size, U >::update().

Referenced by v8::internal::JSFunction::CompleteInobjectSlackTracking(), and v8::internal::JSFunction::StartInobjectSlackTracking().

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

◆ set_dictionary_map()

void v8::internal::Map::set_dictionary_map ( bool  value)
inline

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

4423  {
4424  uint32_t new_bit_field3 = DictionaryMap::update(bit_field3(), value);
4425  new_bit_field3 = IsUnstable::update(new_bit_field3, value);
4426  set_bit_field3(new_bit_field3);
4427 }

References bit_field3(), set_bit_field3(), and v8::internal::BitFieldBase< T, shift, size, U >::update().

+ Here is the call graph for this function:

◆ set_done_inobject_slack_tracking()

void v8::internal::Map::set_done_inobject_slack_tracking ( bool  value)
inline

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

4480  {
4482 }

References bit_field3(), set_bit_field3(), and v8::internal::BitFieldBase< T, shift, size, U >::update().

Referenced by v8::internal::JSFunction::StartInobjectSlackTracking().

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

◆ set_elements_kind()

void v8::internal::Map::set_elements_kind ( ElementsKind  elements_kind)
inline

Definition at line 5723 of file objects.h.

References DCHECK, v8::internal::kElementsKindCount, v8::internal::BitFieldBase< T, shift, size, U >::kSize, and v8::internal::BitFieldBase< T, shift, size, U >::update().

+ Here is the call graph for this function:

◆ set_function_with_prototype()

void v8::internal::Map::set_function_with_prototype ( bool  value)
inline

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

4377  {
4379 }
void set_bit_field(byte value)
Definition: objects-inl.h:4348

References bit_field(), set_bit_field(), and v8::internal::BitFieldBase< T, shift, size, U >::update().

+ Here is the call graph for this function:

◆ set_has_indexed_interceptor()

void v8::internal::Map::set_has_indexed_interceptor ( )
inline

Definition at line 5687 of file objects.h.

5687  {
5689  }

◆ set_has_instance_call_handler()

void v8::internal::Map::set_has_instance_call_handler ( )
inline

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

4450  {
4452 }

References bit_field3(), set_bit_field3(), and v8::internal::BitFieldBase< T, shift, size, U >::update().

+ Here is the call graph for this function:

◆ set_has_named_interceptor()

void v8::internal::Map::set_has_named_interceptor ( )
inline

Definition at line 5678 of file objects.h.

5678  {
5680  }

◆ set_inobject_properties()

void v8::internal::Map::set_inobject_properties ( int  value)
inline

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

4309  {
4310  DCHECK(0 <= value && value < 256);
4311  WRITE_BYTE_FIELD(this, kInObjectPropertiesOffset, static_cast<byte>(value));
4312 }

References DCHECK, kInObjectPropertiesOffset, and WRITE_BYTE_FIELD.

Referenced by v8::internal::JSFunction::EnsureHasInitialMap().

+ Here is the caller graph for this function:

◆ set_instance_size()

void v8::internal::Map::set_instance_size ( int  value)
inline

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

4300  {
4301  DCHECK_EQ(0, value & (kPointerSize - 1));
4302  value >>= kPointerSizeLog2;
4303  DCHECK(0 <= value && value < 256);
4305  this, kInstanceSizeOffset, static_cast<byte>(value));
4306 }
#define NOBARRIER_WRITE_BYTE_FIELD(p, offset, value)
Definition: objects-inl.h:1306

References DCHECK, DCHECK_EQ, kInstanceSizeOffset, v8::internal::kPointerSize, v8::internal::kPointerSizeLog2, and NOBARRIER_WRITE_BYTE_FIELD.

◆ set_instance_type()

void v8::internal::Map::set_instance_type ( InstanceType  value)
inline

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

4328  {
4329  WRITE_BYTE_FIELD(this, kInstanceTypeOffset, value);
4330 }

References kInstanceTypeOffset, and WRITE_BYTE_FIELD.

◆ set_is_access_check_needed()

void v8::internal::Map::set_is_access_check_needed ( bool  access_check_needed)
inline

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

4387  {
4388  if (access_check_needed) {
4390  } else {
4392  }
4393 }

References bit_field(), kIsAccessCheckNeeded, and set_bit_field().

+ Here is the call graph for this function:

◆ set_is_extensible()

void v8::internal::Map::set_is_extensible ( bool  value)
inline

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

4401  {
4402  if (value) {
4404  } else {
4406  }
4407 }

References bit_field2(), kIsExtensible, and set_bit_field2().

+ Here is the call graph for this function:

◆ set_is_hidden_prototype()

void v8::internal::Map::set_is_hidden_prototype ( )
inline

Definition at line 5669 of file objects.h.

5669  {
5671  }

◆ set_is_observed()

void v8::internal::Map::set_is_observed ( )
inline

Definition at line 5710 of file objects.h.

5710  {
5711  set_bit_field(bit_field() | (1 << kIsObserved));
5712  }

◆ set_is_prototype_map()

void v8::internal::Map::set_is_prototype_map ( bool  value)
inline

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

4414  {
4416 }

References bit_field2(), set_bit_field2(), and v8::internal::BitFieldBase< T, shift, size, U >::update().

+ Here is the call graph for this function:

◆ set_is_undetectable()

void v8::internal::Map::set_is_undetectable ( )
inline

Definition at line 5701 of file objects.h.

5701  {
5703  }

◆ set_migration_target()

void v8::internal::Map::set_migration_target ( bool  value)
inline

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

4470  {
4472 }

References bit_field3(), set_bit_field3(), and v8::internal::BitFieldBase< T, shift, size, U >::update().

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

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

◆ set_non_instance_prototype()

void v8::internal::Map::set_non_instance_prototype ( bool  value)
inline

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

4363  {
4364  if (value) {
4366  } else {
4368  }
4369 }

References bit_field(), kHasNonInstancePrototype, and set_bit_field().

+ Here is the call graph for this function:

◆ set_owns_descriptors()

void v8::internal::Map::set_owns_descriptors ( bool  owns_descriptors)
inline

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

References bit_field3(), owns_descriptors(), set_bit_field3(), and v8::internal::BitFieldBase< T, shift, size, U >::update().

+ Here is the call graph for this function:

◆ set_pre_allocated_property_fields()

void v8::internal::Map::set_pre_allocated_property_fields ( int  value)
inline

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

4315  {
4316  DCHECK(0 <= value && value < 256);
4317  WRITE_BYTE_FIELD(this,
4319  static_cast<byte>(value));
4320 }

References DCHECK, kPreAllocatedPropertyFieldsOffset, and WRITE_BYTE_FIELD.

◆ set_unused_property_fields()

void v8::internal::Map::set_unused_property_fields ( int  value)
inline

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

4338  {
4339  WRITE_BYTE_FIELD(this, kUnusedPropertyFieldsOffset, Min(value, 255));
4340 }
static const int kUnusedPropertyFieldsOffset
Definition: objects.h:6234
static LifetimePosition Min(LifetimePosition a, LifetimePosition b)

References kUnusedPropertyFieldsOffset, v8::internal::Min(), and WRITE_BYTE_FIELD.

Referenced by v8::internal::JSFunction::EnsureHasInitialMap().

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

◆ set_visitor_id()

void v8::internal::Map::set_visitor_id ( int  visitor_id)
inline

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

4229  {
4230  DCHECK(0 <= id && id < 256);
4231  WRITE_BYTE_FIELD(this, kVisitorIdOffset, static_cast<byte>(id));
4232 }
static const int kVisitorIdOffset
Definition: objects.h:6218

References DCHECK, kVisitorIdOffset, and WRITE_BYTE_FIELD.

◆ SetBackPointer()

void v8::internal::Map::SetBackPointer ( Object value,
WriteBarrierMode  mode = UPDATE_WRITE_BARRIER 
)
inline

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

5251  {
5253  DCHECK((value->IsUndefined() && GetBackPointer()->IsMap()) ||
5254  (value->IsMap() && GetBackPointer()->IsUndefined()));
5256  if (object->IsTransitionArray()) {
5258  } else {
5261  GetHeap(), this, kTransitionsOrBackPointerOffset, value, mode);
5262  }
5263 }
void set_back_pointer_storage(Object *back_pointer, WriteBarrierMode mode=UPDATE_WRITE_BARRIER)
@ FIRST_JS_RECEIVER_TYPE
Definition: objects.h:772
#define CONDITIONAL_WRITE_BARRIER(heap, object, offset, value, mode)
Definition: objects-inl.h:1210

References v8::internal::TransitionArray::cast(), CONDITIONAL_WRITE_BARRIER, DCHECK, v8::internal::FIRST_JS_RECEIVER_TYPE, GetBackPointer(), v8::internal::HeapObject::GetHeap(), instance_type(), kTransitionsOrBackPointerOffset, mode(), READ_FIELD, v8::internal::TransitionArray::set_back_pointer_storage(), and WRITE_FIELD.

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

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

◆ SetEnumLength()

void v8::internal::Map::SetEnumLength ( int  length)
inline

Definition at line 5959 of file objects.h.

5959  {
5960  if (length != kInvalidEnumCacheSentinel) {
5961  DCHECK(length >= 0);
5962  DCHECK(length == 0 || instance_descriptors()->HasEnumCache());
5963  DCHECK(length <= NumberOfOwnDescriptors());
5964  }
5966  }

References DCHECK, and v8::internal::kInvalidEnumCacheSentinel.

Referenced by DeprecateTarget(), and v8::internal::GetEnumPropertyKeys().

+ Here is the caller graph for this function:

◆ SetNumberOfOwnDescriptors()

void v8::internal::Map::SetNumberOfOwnDescriptors ( int  number)
inline

Definition at line 5948 of file objects.h.

5948  {
5949  DCHECK(number <= instance_descriptors()->number_of_descriptors());
5951  }

References DCHECK.

Referenced by AppendCallbackDescriptors(), AppendDescriptor(), and InitializeDescriptors().

+ Here is the caller graph for this function:

◆ SetNumberOfProtoTransitions()

void v8::internal::Map::SetNumberOfProtoTransitions ( int  value)
inline

Definition at line 5914 of file objects.h.

5914  {
5915  FixedArray* cache = GetPrototypeTransitions();
5916  DCHECK(cache->length() != 0);
5918  }
static Smi * FromInt(int value)
Definition: objects-inl.h:1321

References DCHECK, v8::internal::Smi::FromInt(), v8::internal::FixedArrayBase::length(), v8::internal::FixedArray::set(), and v8::internal::Smi::value().

Referenced by PutPrototypeTransition(), and SetPrototypeTransitions().

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

◆ SetPrototypeTransitions()

void v8::internal::Map::SetPrototypeTransitions ( Handle< Map map,
Handle< FixedArray prototype_transitions 
)
inlinestaticprivate

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

5191  {
5193  int old_number_of_transitions = map->NumberOfProtoTransitions();
5194 #ifdef DEBUG
5195  if (map->HasPrototypeTransitions()) {
5196  DCHECK(map->GetPrototypeTransitions() != *proto_transitions);
5198  }
5199 #endif
5200  map->transitions()->SetPrototypeTransitions(*proto_transitions);
5201  map->SetNumberOfProtoTransitions(old_number_of_transitions);
5202 }
void ZapPrototypeTransitions()
Definition: objects.cc:11336
static void EnsureHasTransitionArray(Handle< Map > map)
Definition: objects-inl.h:5088

References DCHECK, v8::internal::EnsureHasTransitionArray(), GetPrototypeTransitions(), HasPrototypeTransitions(), v8::internal::HeapObject::map(), NumberOfProtoTransitions(), SetNumberOfProtoTransitions(), SetPrototypeTransitions(), and ZapPrototypeTransitions().

Referenced by PutPrototypeTransition(), and SetPrototypeTransitions().

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

◆ ShareDescriptor()

Handle< Map > v8::internal::Map::ShareDescriptor ( Handle< Map map,
Handle< DescriptorArray descriptors,
Descriptor descriptor 
)
staticprivate

Definition at line 6483 of file objects.cc.

6485  {
6486  // Sanity check. This path is only to be taken if the map owns its descriptor
6487  // array, implying that its NumberOfOwnDescriptors equals the number of
6488  // descriptors in the descriptor array.
6490  map->instance_descriptors()->number_of_descriptors());
6491 
6492  Handle<Map> result = CopyDropDescriptors(map);
6493  Handle<Name> name = descriptor->GetKey();
6494 
6495  // Ensure there's space for the new descriptor in the shared descriptor array.
6496  if (descriptors->NumberOfSlackDescriptors() == 0) {
6497  int old_size = descriptors->number_of_descriptors();
6498  if (old_size == 0) {
6499  descriptors = DescriptorArray::Allocate(map->GetIsolate(), 0, 1);
6500  } else {
6501  EnsureDescriptorSlack(map, old_size < 4 ? 1 : old_size / 2);
6502  descriptors = handle(map->instance_descriptors());
6503  }
6504  }
6505 
6506  {
6507  DisallowHeapAllocation no_gc;
6508  descriptors->Append(descriptor);
6509  result->InitializeDescriptors(*descriptors);
6510  }
6511 
6512  DCHECK(result->NumberOfOwnDescriptors() == map->NumberOfOwnDescriptors() + 1);
6514 
6515  return result;
6516 }
static void EnsureDescriptorSlack(Handle< Map > map, int slack)
Definition: objects.cc:3057

References v8::internal::DescriptorArray::Allocate(), DCHECK, v8::internal::HeapObject::GetIsolate(), v8::internal::handle(), v8::internal::HeapObject::map(), name, NumberOfOwnDescriptors(), and v8::internal::SIMPLE_TRANSITION.

+ Here is the call graph for this function:

◆ STATIC_ASSERT() [1/2]

v8::internal::Map::STATIC_ASSERT ( kDescriptorIndexBitCount kDescriptorIndexBitCount = =20)

◆ STATIC_ASSERT() [2/2]

◆ TooManyFastProperties()

bool v8::internal::Map::TooManyFastProperties ( StoreFromKeyed  store_mode)
inline

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

2098  {
2099  if (unused_property_fields() != 0) return false;
2100  if (is_prototype_map()) return false;
2101  int minimum = store_mode == CERTAINLY_NOT_STORE_FROM_KEYED ? 128 : 12;
2102  int limit = Max(minimum, inobject_properties());
2103  int external = NumberOfFields() - inobject_properties();
2104  return external > limit;
2105 }
@ CERTAINLY_NOT_STORE_FROM_KEYED
Definition: objects.h:1007

References v8::internal::Object::CERTAINLY_NOT_STORE_FROM_KEYED, inobject_properties(), is_prototype_map(), v8::internal::Max(), NumberOfFields(), and unused_property_fields().

Referenced by TransitionToAccessorProperty(), and TransitionToDataProperty().

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

◆ TransitionElementsTo()

Handle< Map > v8::internal::Map::TransitionElementsTo ( Handle< Map map,
ElementsKind  to_kind 
)
static

Definition at line 3321 of file objects.cc.

3322  {
3323  ElementsKind from_kind = map->elements_kind();
3324  if (from_kind == to_kind) return map;
3325 
3326  Isolate* isolate = map->GetIsolate();
3327  Context* native_context = isolate->context()->native_context();
3328  Object* maybe_array_maps = native_context->js_array_maps();
3329  if (maybe_array_maps->IsFixedArray()) {
3330  DisallowHeapAllocation no_gc;
3331  FixedArray* array_maps = FixedArray::cast(maybe_array_maps);
3332  if (array_maps->get(from_kind) == *map) {
3333  Object* maybe_transitioned_map = array_maps->get(to_kind);
3334  if (maybe_transitioned_map->IsMap()) {
3335  return handle(Map::cast(maybe_transitioned_map));
3336  }
3337  }
3338  }
3339 
3340  return TransitionElementsToSlow(map, to_kind);
3341 }
Context * native_context()
Definition: contexts.cc:44
Context * context()
Definition: isolate.h:548
static Handle< Map > TransitionElementsToSlow(Handle< Map > object, ElementsKind to_kind)
Definition: objects.cc:3344

References v8::internal::Isolate::context(), elements_kind(), v8::internal::FixedArray::get(), v8::internal::HeapObject::GetIsolate(), v8::internal::handle(), v8::internal::HeapObject::map(), and v8::internal::Context::native_context().

Referenced by v8::internal::KeyedStoreIC::ComputeTransitionedMap(), v8::internal::JSObject::GetElementsTransitionMap(), and v8::internal::JSTypedArray::MaterializeArrayBuffer().

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

◆ TransitionElementsToSlow()

Handle< Map > v8::internal::Map::TransitionElementsToSlow ( Handle< Map object,
ElementsKind  to_kind 
)
staticprivate

Definition at line 3344 of file objects.cc.

3345  {
3346  ElementsKind from_kind = map->elements_kind();
3347 
3348  if (from_kind == to_kind) {
3349  return map;
3350  }
3351 
3352  bool allow_store_transition =
3353  // Only remember the map transition if there is not an already existing
3354  // non-matching element transition.
3355  !map->IsUndefined() && !map->is_dictionary_map() &&
3356  IsTransitionElementsKind(from_kind);
3357 
3358  // Only store fast element maps in ascending generality.
3359  if (IsFastElementsKind(to_kind)) {
3360  allow_store_transition &=
3361  IsTransitionableFastElementsKind(from_kind) &&
3362  IsMoreGeneralElementsKindTransition(from_kind, to_kind);
3363  }
3364 
3365  if (!allow_store_transition) {
3366  return Map::CopyAsElementsKind(map, to_kind, OMIT_TRANSITION);
3367  }
3368 
3369  return Map::AsElementsKind(map, to_kind);
3370 }
static Handle< Map > AsElementsKind(Handle< Map > map, ElementsKind kind)
Definition: objects.cc:3374
static Handle< Map > CopyAsElementsKind(Handle< Map > map, ElementsKind kind, TransitionFlag flag)
Definition: objects.cc:6592
bool IsTransitionElementsKind(ElementsKind kind)

References elements_kind(), and v8::internal::HeapObject::map().

+ Here is the call graph for this function:

◆ TransitionToAccessorProperty()

Handle< Map > v8::internal::Map::TransitionToAccessorProperty ( Handle< Map map,
Handle< Name name,
AccessorComponent  component,
Handle< Object accessor,
PropertyAttributes  attributes 
)
static

Definition at line 6816 of file objects.cc.

6820  {
6821  Isolate* isolate = name->GetIsolate();
6822 
6823  // Dictionary maps can always have additional data properties.
6824  if (map->is_dictionary_map()) {
6825  // For global objects, property cells are inlined. We need to change the
6826  // map.
6827  if (map->IsGlobalObjectMap()) return Copy(map);
6828  return map;
6829  }
6830 
6831  // Migrate to the newest map before transitioning to the new property.
6832  map = Update(map);
6833 
6837 
6838  int index = map->SearchTransition(*name);
6839  if (index != TransitionArray::kNotFound) {
6840  Handle<Map> transition(map->GetTransition(index));
6841  DescriptorArray* descriptors = transition->instance_descriptors();
6842  // Fast path, assume that we're modifying the last added descriptor.
6843  int descriptor = transition->LastAdded();
6844  if (descriptors->GetKey(descriptor) != *name) {
6845  // If not, search for the descriptor.
6846  descriptor = descriptors->SearchWithCache(*name, *transition);
6847  }
6848 
6849  if (descriptors->GetDetails(descriptor).type() != CALLBACKS) {
6850  return Map::Normalize(map, mode);
6851  }
6852 
6853  // TODO(verwaest): Handle attributes better.
6854  if (descriptors->GetDetails(descriptor).attributes() != attributes) {
6855  return Map::Normalize(map, mode);
6856  }
6857 
6858  Handle<Object> maybe_pair(descriptors->GetValue(descriptor), isolate);
6859  if (!maybe_pair->IsAccessorPair()) {
6860  return Map::Normalize(map, mode);
6861  }
6862 
6863  Handle<AccessorPair> pair = Handle<AccessorPair>::cast(maybe_pair);
6864  if (pair->get(component) != *accessor) {
6865  return Map::Normalize(map, mode);
6866  }
6867 
6868  return transition;
6869  }
6870 
6871  Handle<AccessorPair> pair;
6872  DescriptorArray* old_descriptors = map->instance_descriptors();
6873  int descriptor = old_descriptors->SearchWithCache(*name, *map);
6874  if (descriptor != DescriptorArray::kNotFound) {
6875  PropertyDetails old_details = old_descriptors->GetDetails(descriptor);
6876  if (old_details.type() != CALLBACKS) {
6877  return Map::Normalize(map, mode);
6878  }
6879 
6880  if (old_details.attributes() != attributes) {
6881  return Map::Normalize(map, mode);
6882  }
6883 
6884  Handle<Object> maybe_pair(old_descriptors->GetValue(descriptor), isolate);
6885  if (!maybe_pair->IsAccessorPair()) {
6886  return Map::Normalize(map, mode);
6887  }
6888 
6889  Object* current = Handle<AccessorPair>::cast(maybe_pair)->get(component);
6890  if (current == *accessor) return map;
6891 
6892  if (!current->IsTheHole()) {
6893  return Map::Normalize(map, mode);
6894  }
6895 
6896  pair = AccessorPair::Copy(Handle<AccessorPair>::cast(maybe_pair));
6900  } else {
6901  pair = isolate->factory()->NewAccessorPair();
6902  }
6903 
6904  pair->set(component, *accessor);
6906  CallbacksDescriptor new_desc(name, pair, attributes);
6907  return Map::CopyInsertDescriptor(map, &new_desc, flag);
6908 }
static Handle< AccessorPair > Copy(Handle< AccessorPair > pair)
Definition: objects.cc:7904
static Handle< Map > CopyInsertDescriptor(Handle< Map > map, Descriptor *descriptor, TransitionFlag flag)
Definition: objects.cc:6934
static Handle< Map > Normalize(Handle< Map > map, PropertyNormalizationMode mode)
Definition: objects.cc:6398
bool IsGlobalObjectMap()
Definition: objects.h:6138
bool TooManyFastProperties(StoreFromKeyed store_mode)
Definition: objects-inl.h:2098
PropertyNormalizationMode
Definition: objects.h:247
@ KEEP_INOBJECT_PROPERTIES
Definition: objects.h:249

References v8::internal::CALLBACKS, v8::internal::Handle< T >::cast(), v8::internal::Object::CERTAINLY_NOT_STORE_FROM_KEYED, v8::internal::CLEAR_INOBJECT_PROPERTIES, v8::internal::AccessorPair::Copy(), CopyInsertDescriptor(), v8::internal::Isolate::factory(), v8::internal::flag, v8::internal::DescriptorArray::GetDetails(), v8::internal::DescriptorArray::GetKey(), GetTransition(), v8::internal::DescriptorArray::GetValue(), v8::internal::INSERT_TRANSITION, is_dictionary_map(), is_prototype_map(), IsGlobalObjectMap(), v8::internal::KEEP_INOBJECT_PROPERTIES, v8::internal::kMaxNumberOfDescriptors, v8::internal::DescriptorArray::kNotFound, v8::internal::TransitionArray::kNotFound, v8::internal::HeapObject::map(), mode(), name, Normalize(), NumberOfOwnDescriptors(), SearchTransition(), and TooManyFastProperties().

+ Here is the call graph for this function:

◆ TransitionToDataProperty()

Handle< Map > v8::internal::Map::TransitionToDataProperty ( Handle< Map map,
Handle< Name name,
Handle< Object value,
PropertyAttributes  attributes,
StoreFromKeyed  store_mode 
)
static

Definition at line 6759 of file objects.cc.

6762  {
6763  // Dictionary maps can always have additional data properties.
6764  if (map->is_dictionary_map()) return map;
6765 
6766  // Migrate to the newest map before storing the property.
6767  map = Update(map);
6768 
6769  int index = map->SearchTransition(*name);
6770  if (index != TransitionArray::kNotFound) {
6771  Handle<Map> transition(map->GetTransition(index));
6772  int descriptor = transition->LastAdded();
6773 
6774  // TODO(verwaest): Handle attributes better.
6775  DescriptorArray* descriptors = transition->instance_descriptors();
6776  if (descriptors->GetDetails(descriptor).attributes() != attributes) {
6778  }
6779 
6780  return Map::PrepareForDataProperty(transition, descriptor, value);
6781  }
6782 
6784  MaybeHandle<Map> maybe_map;
6785  if (value->IsJSFunction()) {
6786  maybe_map = Map::CopyWithConstant(map, name, value, attributes, flag);
6787  } else if (!map->TooManyFastProperties(store_mode)) {
6788  Isolate* isolate = name->GetIsolate();
6789  Representation representation = value->OptimalRepresentation();
6790  Handle<HeapType> type = value->OptimalType(isolate, representation);
6791  maybe_map =
6792  Map::CopyWithField(map, name, type, attributes, representation, flag);
6793  }
6794 
6795  Handle<Map> result;
6796  if (!maybe_map.ToHandle(&result)) {
6798  }
6799 
6800  return result;
6801 }
static Handle< Map > PrepareForDataProperty(Handle< Map > old_map, int descriptor_number, Handle< Object > value)
Definition: objects.cc:6738
static MUST_USE_RESULT MaybeHandle< Map > CopyWithConstant(Handle< Map > map, Handle< Name > name, Handle< Object > constant, PropertyAttributes attributes, TransitionFlag flag)
Definition: objects.cc:1746
static MUST_USE_RESULT MaybeHandle< Map > CopyWithField(Handle< Map > map, Handle< Name > name, Handle< HeapType > type, PropertyAttributes attributes, Representation representation, TransitionFlag flag)
Definition: objects.cc:1710

References v8::internal::CLEAR_INOBJECT_PROPERTIES, CopyWithConstant(), CopyWithField(), v8::internal::flag, v8::internal::DescriptorArray::GetDetails(), GetTransition(), v8::internal::INSERT_TRANSITION, is_dictionary_map(), v8::internal::TransitionArray::kNotFound, v8::internal::HeapObject::map(), name, Normalize(), PrepareForDataProperty(), SearchTransition(), and TooManyFastProperties().

+ Here is the call graph for this function:

◆ TransitionToPrototype()

Handle< Map > v8::internal::Map::TransitionToPrototype ( Handle< Map map,
Handle< Object prototype 
)
static

Definition at line 11646 of file objects.cc.

11647  {
11648  Handle<Map> new_map = GetPrototypeTransition(map, prototype);
11649  if (new_map.is_null()) {
11650  new_map = Copy(map);
11651  PutPrototypeTransition(map, prototype, new_map);
11652  new_map->set_prototype(*prototype);
11653  }
11654  return new_map;
11655 }
static Handle< Map > GetPrototypeTransition(Handle< Map > map, Handle< Object > prototype)
Definition: objects.cc:11267
static Handle< Map > PutPrototypeTransition(Handle< Map > map, Handle< Object > prototype, Handle< Map > target_map)
Definition: objects.cc:11285

References v8::internal::Handle< T >::is_null(), and v8::internal::HeapObject::map().

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

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

◆ TraverseTransitionTree()

void v8::internal::Map::TraverseTransitionTree ( TraverseCallback  callback,
void *  data 
)

Definition at line 7257 of file objects.cc.

7257  {
7258  // Make sure that we do not allocate in the callback.
7259  DisallowHeapAllocation no_allocation;
7260 
7261  TraversableMap* current = static_cast<TraversableMap*>(this);
7262  // Get the root constructor here to restore it later when finished iterating
7263  // over maps.
7264  Object* root_constructor = constructor();
7265  while (true) {
7266  TraversableMap* child = current->ChildIteratorNext(root_constructor);
7267  if (child != NULL) {
7268  child->SetParent(current);
7269  current = child;
7270  } else {
7271  TraversableMap* parent = current->GetAndResetParent();
7272  callback(current, data);
7273  if (current == this) break;
7274  current = parent;
7275  }
7276  }
7277 }

References v8::internal::TraversableMap::ChildIteratorNext(), v8::internal::TraversableMap::GetAndResetParent(), NULL, and v8::internal::TraversableMap::SetParent().

Referenced by v8::internal::JSFunction::CompleteInobjectSlackTracking().

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

◆ TryUpdate()

MaybeHandle< Map > v8::internal::Map::TryUpdate ( Handle< Map map)
static

Definition at line 2691 of file objects.cc.

2691  {
2692  Handle<Map> proto_map(map);
2693  while (proto_map->prototype()->IsJSObject()) {
2694  Handle<JSObject> holder(JSObject::cast(proto_map->prototype()));
2695  proto_map = Handle<Map>(holder->map());
2696  if (proto_map->is_deprecated() && JSObject::TryMigrateInstance(holder)) {
2697  proto_map = Handle<Map>(holder->map());
2698  }
2699  }
2700  return TryUpdateInternal(map);
2701 }
static bool TryMigrateInstance(Handle< JSObject > instance)
Definition: objects.cc:3740
static MaybeHandle< Map > TryUpdateInternal(Handle< Map > map) WARN_UNUSED_RESULT
Definition: objects.cc:2714

References v8::internal::HeapObject::map(), and v8::internal::JSObject::TryMigrateInstance().

Referenced by v8::internal::FINAL< kOperandKind, kNumCachedOperands >::AddMapIfMissing(), v8::internal::TypeFeedbackOracle::CompareType(), and v8::internal::JSObject::TryMigrateInstance().

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

◆ TryUpdateInternal()

MaybeHandle< Map > v8::internal::Map::TryUpdateInternal ( Handle< Map map)
static

Definition at line 2714 of file objects.cc.

2714  {
2715  DisallowHeapAllocation no_allocation;
2716  DisallowDeoptimization no_deoptimization(old_map->GetIsolate());
2717 
2718  if (!old_map->is_deprecated()) return old_map;
2719 
2720  // Check the state of the root map.
2721  Map* root_map = old_map->FindRootMap();
2722  if (!old_map->EquivalentToForTransition(root_map)) return MaybeHandle<Map>();
2723  int root_nof = root_map->NumberOfOwnDescriptors();
2724 
2725  int old_nof = old_map->NumberOfOwnDescriptors();
2726  DescriptorArray* old_descriptors = old_map->instance_descriptors();
2727 
2728  Map* new_map = root_map;
2729  for (int i = root_nof; i < old_nof; ++i) {
2730  int j = new_map->SearchTransition(old_descriptors->GetKey(i));
2731  if (j == TransitionArray::kNotFound) return MaybeHandle<Map>();
2732  new_map = new_map->GetTransition(j);
2733  DescriptorArray* new_descriptors = new_map->instance_descriptors();
2734 
2735  PropertyDetails new_details = new_descriptors->GetDetails(i);
2736  PropertyDetails old_details = old_descriptors->GetDetails(i);
2737  if (old_details.attributes() != new_details.attributes() ||
2738  !old_details.representation().fits_into(new_details.representation())) {
2739  return MaybeHandle<Map>();
2740  }
2741  PropertyType new_type = new_details.type();
2742  PropertyType old_type = old_details.type();
2743  Object* new_value = new_descriptors->GetValue(i);
2744  Object* old_value = old_descriptors->GetValue(i);
2745  switch (new_type) {
2746  case FIELD:
2747  if ((old_type == FIELD &&
2748  !HeapType::cast(old_value)->NowIs(HeapType::cast(new_value))) ||
2749  (old_type == CONSTANT &&
2750  !HeapType::cast(new_value)->NowContains(old_value)) ||
2751  (old_type == CALLBACKS &&
2752  !HeapType::Any()->Is(HeapType::cast(new_value)))) {
2753  return MaybeHandle<Map>();
2754  }
2755  break;
2756 
2757  case CONSTANT:
2758  case CALLBACKS:
2759  if (old_type != new_type || old_value != new_value) {
2760  return MaybeHandle<Map>();
2761  }
2762  break;
2763 
2764  case NORMAL:
2765  UNREACHABLE();
2766  }
2767  }
2768  if (new_map->NumberOfOwnDescriptors() != old_nof) return MaybeHandle<Map>();
2769  return handle(new_map);
2770 }
static TypeImpl * cast(typename Config::Base *object)
Definition: types-inl.h:20
bool Is(Object *obj)
PerIsolateAssertScopeDebugOnly< DEOPTIMIZATION_ASSERT, false > DisallowDeoptimization
Definition: assert-scope.h:169

References v8::internal::CALLBACKS, v8::internal::TypeImpl< Config >::cast(), v8::internal::CONSTANT, v8::internal::FIELD, v8::internal::DescriptorArray::GetDetails(), v8::internal::DescriptorArray::GetKey(), GetTransition(), v8::internal::DescriptorArray::GetValue(), v8::internal::handle(), v8::internal::Is(), v8::internal::TransitionArray::kNotFound, v8::internal::NORMAL, NumberOfOwnDescriptors(), SearchTransition(), and UNREACHABLE.

+ Here is the call graph for this function:

◆ unused_property_fields()

int v8::internal::Map::unused_property_fields ( )
inline

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

4333  {
4335 }

References kUnusedPropertyFieldsOffset, and READ_BYTE_FIELD.

Referenced by v8::internal::JSFunction::CompleteInobjectSlackTracking(), CopyDropDescriptors(), CopyInstallDescriptors(), v8::internal::JSFunction::StartInobjectSlackTracking(), and TooManyFastProperties().

+ Here is the caller graph for this function:

◆ Update()

Handle< Map > v8::internal::Map::Update ( Handle< Map map)
static

Definition at line 2705 of file objects.cc.

2705  {
2706  if (!map->is_deprecated()) return map;
2710 }
static Representation None()
@ ALLOW_AS_CONSTANT
Definition: objects.h:240

References v8::internal::ALLOW_AS_CONSTANT, v8::internal::HeapObject::GetIsolate(), is_deprecated(), v8::internal::HeapObject::map(), v8::None, and v8::internal::Representation::None().

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

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

◆ UpdateCodeCache()

void v8::internal::Map::UpdateCodeCache ( Handle< Map map,
Handle< Name name,
Handle< Code code 
)
static

Definition at line 7030 of file objects.cc.

7032  {
7033  Isolate* isolate = map->GetIsolate();
7034  HandleScope scope(isolate);
7035  // Allocate the code cache if not present.
7036  if (map->code_cache()->IsFixedArray()) {
7037  Handle<Object> result = isolate->factory()->NewCodeCache();
7038  map->set_code_cache(*result);
7039  }
7040 
7041  // Update the code cache.
7042  Handle<CodeCache> code_cache(CodeCache::cast(map->code_cache()), isolate);
7043  CodeCache::Update(code_cache, name, code);
7044 }
static void Update(Handle< CodeCache > cache, Handle< Name > name, Handle< Code > code)
Definition: objects.cc:7280

References v8::internal::Isolate::factory(), v8::internal::HeapObject::GetIsolate(), v8::internal::HeapObject::map(), name, and v8::internal::CodeCache::Update().

Referenced by v8::internal::CompareICStub::AddToSpecialCache(), v8::internal::LoadIC::CompileHandler(), v8::internal::PropertyICCompiler::ComputeCompareNil(), v8::internal::IC::ComputeHandler(), v8::internal::PropertyICCompiler::ComputeKeyedLoadMonomorphic(), v8::internal::PropertyICCompiler::ComputeKeyedStoreMonomorphic(), v8::internal::NamedLoadHandlerCompiler::ComputeLoadNonexistent(), v8::internal::PropertyICCompiler::ComputeMonomorphic(), and v8::internal::HeapObject::UpdateMapCodeCache().

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

◆ UpdateFieldType()

void v8::internal::Map::UpdateFieldType ( int  descriptor_number,
Handle< Name name,
Handle< HeapType new_type 
)
private

Definition at line 2277 of file objects.cc.

2278  {
2279  DisallowHeapAllocation no_allocation;
2280  PropertyDetails details = instance_descriptors()->GetDetails(descriptor);
2281  if (details.type() != FIELD) return;
2282  if (HasTransitionArray()) {
2283  TransitionArray* transitions = this->transitions();
2284  for (int i = 0; i < transitions->number_of_transitions(); ++i) {
2285  transitions->GetTarget(i)->UpdateFieldType(descriptor, name, new_type);
2286  }
2287  }
2288  // Skip if already updated the shared descriptor.
2289  if (instance_descriptors()->GetFieldType(descriptor) == *new_type) return;
2290  FieldDescriptor d(name, instance_descriptors()->GetFieldIndex(descriptor),
2291  new_type, details.attributes(), details.representation());
2292  instance_descriptors()->Replace(descriptor, &d);
2293 }

References v8::internal::FIELD, v8::internal::TransitionArray::GetTarget(), name, v8::internal::TransitionArray::number_of_transitions(), and UpdateFieldType().

Referenced by UpdateFieldType().

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

◆ visitor_id()

int v8::internal::Map::visitor_id ( )
inline

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

4224  {
4225  return READ_BYTE_FIELD(this, kVisitorIdOffset);
4226 }

References kVisitorIdOffset, and READ_BYTE_FIELD.

◆ ZapPrototypeTransitions()

void v8::internal::Map::ZapPrototypeTransitions ( )
private

Definition at line 11336 of file objects.cc.

11336  {
11337  FixedArray* proto_transitions = GetPrototypeTransitions();
11338  MemsetPointer(proto_transitions->data_start(),
11339  GetHeap()->the_hole_value(),
11340  proto_transitions->length());
11341 }
void MemsetPointer(T **dest, U *value, int counter)
Definition: utils.h:1183

References v8::internal::FixedArray::data_start(), v8::internal::HeapObject::GetHeap(), GetPrototypeTransitions(), v8::internal::FixedArrayBase::length(), and v8::internal::MemsetPointer().

Referenced by SetPrototypeTransitions().

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

◆ ZapTransitions()

void v8::internal::Map::ZapTransitions ( )
private

Definition at line 11323 of file objects.cc.

11323  {
11324  TransitionArray* transition_array = transitions();
11325  // TODO(mstarzinger): Temporarily use a slower version instead of the faster
11326  // MemsetPointer to investigate a crasher. Switch back to MemsetPointer.
11327  Object** data = transition_array->data_start();
11328  Object* the_hole = GetHeap()->the_hole_value();
11329  int length = transition_array->length();
11330  for (int i = 0; i < length; i++) {
11331  data[i] = the_hole;
11332  }
11333 }

References v8::internal::FixedArray::data_start(), v8::internal::HeapObject::GetHeap(), and v8::internal::FixedArrayBase::length().

+ Here is the call graph for this function:

Member Data Documentation

◆ kBitField2Offset

const int v8::internal::Map::kBitField2Offset = kInstanceAttributesOffset + 2
static

◆ kBitField3Offset

const int v8::internal::Map::kBitField3Offset = kInstanceAttributesOffset + kIntSize
static

Definition at line 6189 of file objects.h.

Referenced by bit_field3().

◆ kBitFieldOffset

◆ kCodeCacheOffset

const int v8::internal::Map::kCodeCacheOffset = kDescriptorsOffset + kPointerSize
static

◆ kConstructorOffset

◆ kDependentCodeOffset

◆ kDescriptorsOffset

const int v8::internal::Map::kDescriptorsOffset
static

◆ kFastPropertiesSoftLimit

const int v8::internal::Map::kFastPropertiesSoftLimit = 12
staticprivate

Definition at line 6356 of file objects.h.

◆ kHasIndexedInterceptor

const int v8::internal::Map::kHasIndexedInterceptor = 3
static

◆ kHasNamedInterceptor

const int v8::internal::Map::kHasNamedInterceptor = 2
static

◆ kHasNonInstancePrototype

const int v8::internal::Map::kHasNonInstancePrototype = 0
static

Definition at line 6240 of file objects.h.

Referenced by has_non_instance_prototype(), and set_non_instance_prototype().

◆ kInObjectPropertiesByte

const int v8::internal::Map::kInObjectPropertiesByte = 1
static

Definition at line 6211 of file objects.h.

◆ kInObjectPropertiesOffset

const int v8::internal::Map::kInObjectPropertiesOffset
static

◆ kInstanceAttributesOffset

const int v8::internal::Map::kInstanceAttributesOffset = kInstanceSizesOffset + kIntSize
static

Definition at line 6188 of file objects.h.

◆ kInstanceSizeOffset

const int v8::internal::Map::kInstanceSizeOffset = kInstanceSizesOffset + 0
static

◆ kInstanceSizesOffset

const int v8::internal::Map::kInstanceSizesOffset = HeapObject::kHeaderSize
static

Definition at line 6187 of file objects.h.

◆ kInstanceTypeAndBitFieldOffset

const int v8::internal::Map::kInstanceTypeAndBitFieldOffset
static
Initial value:
=
static const int kInstanceAttributesOffset
Definition: objects.h:6188

Definition at line 6231 of file objects.h.

Referenced by v8::internal::FINAL< kOperandKind, kNumCachedOperands >::ForMapInstanceTypeAndBitField().

◆ kInstanceTypeOffset

◆ kIsAccessCheckNeeded

const int v8::internal::Map::kIsAccessCheckNeeded = 6
static

◆ kIsExtensible

const int v8::internal::Map::kIsExtensible = 0
static

Definition at line 6250 of file objects.h.

Referenced by v8::internal::Heap::AllocateMap(), is_extensible(), and set_is_extensible().

◆ kIsHiddenPrototype

const int v8::internal::Map::kIsHiddenPrototype = 1
static

Definition at line 6241 of file objects.h.

◆ kIsObserved

const int v8::internal::Map::kIsObserved = 5
static

Definition at line 6245 of file objects.h.

◆ kIsUndetectable

const int v8::internal::Map::kIsUndetectable = 4
static

◆ kMaxCachedPrototypeTransitions

const int v8::internal::Map::kMaxCachedPrototypeTransitions = 256
static

Definition at line 6180 of file objects.h.

Referenced by PutPrototypeTransition().

◆ kMaxFastProperties

const int v8::internal::Map::kMaxFastProperties = 128
staticprivate

Definition at line 6357 of file objects.h.

◆ kMaximumBitField2FastElementValue

const int8_t v8::internal::Map::kMaximumBitField2FastElementValue
static
Initial value:
= static_cast<int8_t>(
static const U kShift
Definition: utils.h:204

Definition at line 6256 of file objects.h.

◆ kMaximumBitField2FastHoleyElementValue

const int8_t v8::internal::Map::kMaximumBitField2FastHoleyElementValue
static
Initial value:
=
static_cast<int8_t>((FAST_HOLEY_ELEMENTS + 1) <<

Definition at line 6261 of file objects.h.

◆ kMaximumBitField2FastHoleySmiElementValue

const int8_t v8::internal::Map::kMaximumBitField2FastHoleySmiElementValue
static
Initial value:
=
static_cast<int8_t>((FAST_HOLEY_SMI_ELEMENTS + 1) <<
@ FAST_HOLEY_SMI_ELEMENTS
Definition: elements-kind.h:17

Definition at line 6264 of file objects.h.

◆ kMaximumBitField2FastSmiElementValue

const int8_t v8::internal::Map::kMaximumBitField2FastSmiElementValue
static
Initial value:
=
static_cast<int8_t>((FAST_SMI_ELEMENTS + 1) <<

Definition at line 6258 of file objects.h.

◆ kMaxPreAllocatedPropertyFields

const int v8::internal::Map::kMaxPreAllocatedPropertyFields = 255
static

Definition at line 6184 of file objects.h.

◆ kPointerFieldsBeginOffset

const int v8::internal::Map::kPointerFieldsBeginOffset = Map::kPrototypeOffset
static

◆ kPointerFieldsEndOffset

const int v8::internal::Map::kPointerFieldsEndOffset = kSize
static

◆ kPreAllocatedPropertyFieldsByte

const int v8::internal::Map::kPreAllocatedPropertyFieldsByte = 2
static

Definition at line 6214 of file objects.h.

◆ kPreAllocatedPropertyFieldsOffset

const int v8::internal::Map::kPreAllocatedPropertyFieldsOffset
static
Initial value:

Definition at line 6215 of file objects.h.

Referenced by pre_allocated_property_fields(), and set_pre_allocated_property_fields().

◆ kProtoTransitionElementsPerEntry

◆ kProtoTransitionHeaderSize

◆ kProtoTransitionMapOffset

◆ kProtoTransitionNumberOfEntriesOffset

const int v8::internal::Map::kProtoTransitionNumberOfEntriesOffset = 0
static

◆ kProtoTransitionPrototypeOffset

const int v8::internal::Map::kProtoTransitionPrototypeOffset = 0
static

◆ kPrototypeOffset

const int v8::internal::Map::kPrototypeOffset = kBitField3Offset + kPointerSize
static

Definition at line 6190 of file objects.h.

Referenced by v8::internal::V8HeapExplorer::ExtractMapReferences().

◆ kSize

◆ kStringWrapperSafeForDefaultValueOf

const int v8::internal::Map::kStringWrapperSafeForDefaultValueOf = 1
static

Definition at line 6251 of file objects.h.

◆ kTransitionsOrBackPointerOffset

const int v8::internal::Map::kTransitionsOrBackPointerOffset
static

◆ kUnusedPropertyFieldsOffset

const int v8::internal::Map::kUnusedPropertyFieldsOffset = kInstanceAttributesOffset + 3
static

Definition at line 6234 of file objects.h.

Referenced by set_unused_property_fields(), and unused_property_fields().

◆ kVisitorIdByte

const int v8::internal::Map::kVisitorIdByte = 3
static

Definition at line 6217 of file objects.h.

◆ kVisitorIdOffset

const int v8::internal::Map::kVisitorIdOffset = kInstanceSizesOffset + kVisitorIdByte
static

Definition at line 6218 of file objects.h.

Referenced by set_visitor_id(), and visitor_id().


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