V8 Project
v8::internal::AllocationSite Class Reference

#include <objects.h>

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

Classes

class  DeoptDependentCodeBit
 
class  DoNotInlineBit
 
class  ElementsKindBits
 
class  MementoFoundCountBits
 
class  PretenureDecisionBits
 
class  UnusedBits
 

Public Types

enum  PretenureDecision {
  kUndecided = 0 , kDontTenure = 1 , kMaybeTenure = 2 , kTenure = 3 ,
  kZombie = 4 , kLastPretenureDecisionValue = kZombie
}
 
enum  Reason { TENURING , TRANSITIONS }
 
typedef FixedBodyDescriptor< HeapObject::kHeaderSize, kDependentCodeOffset+kPointerSize, 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

const char * PretenureDecisionName (PretenureDecision decision)
 
void Initialize ()
 
bool IsNestedSite ()
 
 STATIC_ASSERT (PretenureDecisionBits::kMax >=kLastPretenureDecisionValue)
 
bool IncrementMementoFoundCount ()
 
void IncrementMementoCreateCount ()
 
PretenureFlag GetPretenureMode ()
 
void ResetPretenureDecision ()
 
PretenureDecision pretenure_decision ()
 
void set_pretenure_decision (PretenureDecision decision)
 
bool deopt_dependent_code ()
 
void set_deopt_dependent_code (bool deopt)
 
int memento_found_count ()
 
void set_memento_found_count (int count)
 
int memento_create_count ()
 
void set_memento_create_count (int count)
 
bool IsZombie ()
 
bool IsMaybeTenure ()
 
void MarkZombie ()
 
bool MakePretenureDecision (PretenureDecision current_decision, double ratio, bool maximum_size_scavenge)
 
bool DigestPretenuringFeedback (bool maximum_size_scavenge)
 
ElementsKind GetElementsKind ()
 
void SetElementsKind (ElementsKind kind)
 
bool CanInlineCall ()
 
void SetDoNotInlineCall ()
 
bool SitePointsToLiteral ()
 
- Public Member Functions inherited from v8::internal::Struct
void InitializeBody (int object_size)
 
- 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 void DigestTransitionFeedback (Handle< AllocationSite > site, ElementsKind to_kind)
 
static void AddDependentCompilationInfo (Handle< AllocationSite > site, Reason reason, CompilationInfo *info)
 
static AllocationSiteMode GetMode (ElementsKind boilerplate_elements_kind)
 
static AllocationSiteMode GetMode (ElementsKind from, ElementsKind to)
 
static bool CanTrack (InstanceType type)
 
- 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 uint32_t kMaximumArrayBytesToPretransition = 8 * 1024
 
static const double kPretenureRatio = 0.85
 
static const int kPretenureMinimumCreated = 100
 
static const int kTransitionInfoOffset = HeapObject::kHeaderSize
 
static const int kNestedSiteOffset = kTransitionInfoOffset + kPointerSize
 
static const int kPretenureDataOffset = kNestedSiteOffset + kPointerSize
 
static const int kPretenureCreateCountOffset
 
static const int kDependentCodeOffset
 
static const int kWeakNextOffset = kDependentCodeOffset + kPointerSize
 
static const int kSize = kWeakNextOffset + kPointerSize
 
static const int kPointerFieldsBeginOffset = kTransitionInfoOffset
 
static const int kPointerFieldsEndOffset = kDependentCodeOffset
 
- 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

DependentCode::DependencyGroup ToDependencyGroup (Reason reason)
 
bool PretenuringDecisionMade ()
 
 DISALLOW_IMPLICIT_CONSTRUCTORS (AllocationSite)
 

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 8090 of file objects.h.

Member Typedef Documentation

◆ BodyDescriptor

Member Enumeration Documentation

◆ PretenureDecision

Enumerator
kUndecided 
kDontTenure 
kMaybeTenure 
kTenure 
kZombie 
kLastPretenureDecisionValue 

Definition at line 8097 of file objects.h.

◆ Reason

Enumerator
TENURING 
TRANSITIONS 

Definition at line 8236 of file objects.h.

8236  {
8237  TENURING,
8238  TRANSITIONS
8239  };

Member Function Documentation

◆ AddDependentCompilationInfo()

void v8::internal::AllocationSite::AddDependentCompilationInfo ( Handle< AllocationSite site,
Reason  reason,
CompilationInfo info 
)
static

Definition at line 12660 of file objects.cc.

12662  {
12663  DependentCode::DependencyGroup group = site->ToDependencyGroup(reason);
12664  Handle<DependentCode> dep(site->dependent_code());
12665  Handle<DependentCode> codes =
12666  DependentCode::Insert(dep, group, info->object_wrapper());
12667  if (*codes != site->dependent_code()) site->set_dependent_code(*codes);
12668  info->dependencies(group)->Add(Handle<HeapObject>(*site), info->zone());
12669 }
static Handle< DependentCode > Insert(Handle< DependentCode > entries, DependencyGroup group, Handle< Object > object)
Definition: objects.cc:11410

References v8::internal::CompilationInfo::dependencies(), v8::internal::DependentCode::Insert(), v8::internal::CompilationInfo::object_wrapper(), and v8::internal::CompilationInfo::zone().

Referenced by v8::internal::HGraphBuilder::BuildBinaryOperation(), v8::internal::HOptimizedGraphBuilder::BuildFastLiteral(), and v8::internal::HOptimizedGraphBuilder::BuildInlinedCallArray().

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

◆ CanInlineCall()

bool v8::internal::AllocationSite::CanInlineCall ( )
inline

Definition at line 8215 of file objects.h.

8215  {
8216  int value = Smi::cast(transition_info())->value();
8217  return DoNotInlineBit::decode(value) == 0;
8218  }
static T decode(U value)
Definition: utils.h:228

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

+ Here is the call graph for this function:

◆ CanTrack()

bool v8::internal::AllocationSite::CanTrack ( InstanceType  type)
inlinestatic

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

1614  {
1615  if (FLAG_allocation_site_pretenuring) {
1616  return type == JS_ARRAY_TYPE ||
1617  type == JS_OBJECT_TYPE ||
1618  type < FIRST_NONSTRING_TYPE;
1619  }
1620  return type == JS_ARRAY_TYPE;
1621 }
@ JS_ARRAY_TYPE
Definition: objects.h:738
@ JS_OBJECT_TYPE
Definition: objects.h:731
@ FIRST_NONSTRING_TYPE
Definition: objects.h:758

References v8::internal::FIRST_NONSTRING_TYPE, v8::internal::JS_ARRAY_TYPE, and v8::internal::JS_OBJECT_TYPE.

Referenced by v8::internal::FINAL< kOperandKind, kNumCachedOperands >::ComputeFlags(), v8::internal::Heap::CopyJSObject(), v8::internal::AllocationSiteUsageContext::ShouldCreateMemento(), and v8::internal::Heap::UpdateAllocationSiteFeedback().

+ Here is the caller graph for this function:

◆ deopt_dependent_code()

bool v8::internal::AllocationSite::deopt_dependent_code ( )
inline

Definition at line 8156 of file objects.h.

8156  {
8157  int value = pretenure_data()->value();
8158  return DeoptDependentCodeBit::decode(value);
8159  }

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

Referenced by v8::internal::Heap::DeoptMarkedAllocationSites().

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

◆ DigestPretenuringFeedback()

bool v8::internal::AllocationSite::DigestPretenuringFeedback ( bool  maximum_size_scavenge)
inline

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

1695  {
1696  bool deopt = false;
1697  int create_count = memento_create_count();
1698  int found_count = memento_found_count();
1699  bool minimum_mementos_created = create_count >= kPretenureMinimumCreated;
1700  double ratio =
1701  minimum_mementos_created || FLAG_trace_pretenuring_statistics ?
1702  static_cast<double>(found_count) / create_count : 0.0;
1703  PretenureDecision current_decision = pretenure_decision();
1704 
1705  if (minimum_mementos_created) {
1706  deopt = MakePretenureDecision(
1707  current_decision, ratio, maximum_size_scavenge);
1708  }
1709 
1710  if (FLAG_trace_pretenuring_statistics) {
1711  PrintF(
1712  "AllocationSite(%p): (created, found, ratio) (%d, %d, %f) %s => %s\n",
1713  static_cast<void*>(this), create_count, found_count, ratio,
1714  PretenureDecisionName(current_decision),
1716  }
1717 
1718  // Clear feedback calculation fields until the next gc.
1721  return deopt;
1722 }
const char * PretenureDecisionName(PretenureDecision decision)
Definition: objects.cc:12672
static const int kPretenureMinimumCreated
Definition: objects.h:8094
PretenureDecision pretenure_decision()
Definition: objects.h:8144
void set_memento_create_count(int count)
Definition: objects.h:8179
bool MakePretenureDecision(PretenureDecision current_decision, double ratio, bool maximum_size_scavenge)
Definition: objects-inl.h:1668
void set_memento_found_count(int count)
Definition: objects-inl.h:1639
void PrintF(const char *format,...)
Definition: utils.cc:80

References kPretenureMinimumCreated, MakePretenureDecision(), memento_create_count(), memento_found_count(), pretenure_decision(), PretenureDecisionName(), v8::internal::PrintF(), set_memento_create_count(), and set_memento_found_count().

Referenced by v8::internal::Heap::ProcessPretenuringFeedback().

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

◆ DigestTransitionFeedback()

void v8::internal::AllocationSite::DigestTransitionFeedback ( Handle< AllocationSite site,
ElementsKind  to_kind 
)
static

Definition at line 12606 of file objects.cc.

12607  {
12608  Isolate* isolate = site->GetIsolate();
12609 
12610  if (site->SitePointsToLiteral() && site->transition_info()->IsJSArray()) {
12611  Handle<JSArray> transition_info =
12612  handle(JSArray::cast(site->transition_info()));
12613  ElementsKind kind = transition_info->GetElementsKind();
12614  // if kind is holey ensure that to_kind is as well.
12615  if (IsHoleyElementsKind(kind)) {
12616  to_kind = GetHoleyElementsKind(to_kind);
12617  }
12618  if (IsMoreGeneralElementsKindTransition(kind, to_kind)) {
12619  // If the array is huge, it's not likely to be defined in a local
12620  // function, so we shouldn't make new instances of it very often.
12621  uint32_t length = 0;
12622  CHECK(transition_info->length()->ToArrayIndex(&length));
12623  if (length <= kMaximumArrayBytesToPretransition) {
12624  if (FLAG_trace_track_allocation_sites) {
12625  bool is_nested = site->IsNestedSite();
12626  PrintF(
12627  "AllocationSite: JSArray %p boilerplate %s updated %s->%s\n",
12628  reinterpret_cast<void*>(*site),
12629  is_nested ? "(nested)" : "",
12630  ElementsKindToString(kind),
12631  ElementsKindToString(to_kind));
12632  }
12633  JSObject::TransitionElementsKind(transition_info, to_kind);
12634  site->dependent_code()->DeoptimizeDependentCodeGroup(
12636  }
12637  }
12638  } else {
12639  ElementsKind kind = site->GetElementsKind();
12640  // if kind is holey ensure that to_kind is as well.
12641  if (IsHoleyElementsKind(kind)) {
12642  to_kind = GetHoleyElementsKind(to_kind);
12643  }
12644  if (IsMoreGeneralElementsKindTransition(kind, to_kind)) {
12645  if (FLAG_trace_track_allocation_sites) {
12646  PrintF("AllocationSite: JSArray %p site updated %s->%s\n",
12647  reinterpret_cast<void*>(*site),
12648  ElementsKindToString(kind),
12649  ElementsKindToString(to_kind));
12650  }
12651  site->SetElementsKind(to_kind);
12652  site->dependent_code()->DeoptimizeDependentCodeGroup(
12654  }
12655  }
12656 }
static const uint32_t kMaximumArrayBytesToPretransition
Definition: objects.h:8092
static void TransitionElementsKind(Handle< JSObject > object, ElementsKind to_kind)
Definition: objects.cc:12706
#define CHECK(condition)
Definition: logging.h:36
bool IsMoreGeneralElementsKindTransition(ElementsKind from_kind, ElementsKind to_kind)
bool IsHoleyElementsKind(ElementsKind kind)
const char * ElementsKindToString(ElementsKind kind)
Handle< T > handle(T *t, Isolate *isolate)
Definition: handles.h:146
ElementsKind GetHoleyElementsKind(ElementsKind packed_kind)

References CHECK, v8::internal::ElementsKindToString(), v8::internal::GetHoleyElementsKind(), v8::internal::handle(), v8::internal::IsHoleyElementsKind(), v8::internal::IsMoreGeneralElementsKindTransition(), v8::internal::DependentCode::kAllocationSiteTransitionChangedGroup, v8::internal::FixedArrayBase::length(), v8::internal::PrintF(), and v8::internal::JSObject::TransitionElementsKind().

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

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

◆ DISALLOW_IMPLICIT_CONSTRUCTORS()

v8::internal::AllocationSite::DISALLOW_IMPLICIT_CONSTRUCTORS ( AllocationSite  )
private

◆ GetElementsKind()

ElementsKind v8::internal::AllocationSite::GetElementsKind ( )
inline

Definition at line 8203 of file objects.h.

8203  {
8205  int value = Smi::cast(transition_info())->value();
8206  return ElementsKindBits::decode(value);
8207  }
#define DCHECK(condition)
Definition: logging.h:205

References DCHECK, and v8::internal::Smi::value().

+ Here is the call graph for this function:

◆ GetMode() [1/2]

AllocationSiteMode v8::internal::AllocationSite::GetMode ( ElementsKind  boilerplate_elements_kind)
inlinestatic

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

1592  {
1593  if (FLAG_pretenuring_call_new ||
1594  IsFastSmiElementsKind(boilerplate_elements_kind)) {
1595  return TRACK_ALLOCATION_SITE;
1596  }
1597 
1599 }
@ TRACK_ALLOCATION_SITE
Definition: objects.h:8085
@ DONT_TRACK_ALLOCATION_SITE
Definition: objects.h:8084
bool IsFastSmiElementsKind(ElementsKind kind)

References v8::internal::DONT_TRACK_ALLOCATION_SITE, v8::internal::IsFastSmiElementsKind(), and v8::internal::TRACK_ALLOCATION_SITE.

Referenced by v8::internal::ArrayConstructorCommon(), v8::internal::ArrayConstructorStubBase::ArrayConstructorStubBase(), and v8::internal::AllocationSiteUsageContext::ShouldCreateMemento().

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

◆ GetMode() [2/2]

AllocationSiteMode v8::internal::AllocationSite::GetMode ( ElementsKind  from,
ElementsKind  to 
)
inlinestatic

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

1603  {
1604  if (FLAG_pretenuring_call_new ||
1605  (IsFastSmiElementsKind(from) &&
1607  return TRACK_ALLOCATION_SITE;
1608  }
1609 
1611 }
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 to(mksnapshot only)") DEFINE_STRING(raw_context_file

References v8::internal::DONT_TRACK_ALLOCATION_SITE, v8::internal::IsFastSmiElementsKind(), v8::internal::IsMoreGeneralElementsKindTransition(), to(), and v8::internal::TRACK_ALLOCATION_SITE.

+ Here is the call graph for this function:

◆ GetPretenureMode()

PretenureFlag v8::internal::AllocationSite::GetPretenureMode ( )

Definition at line 12585 of file objects.cc.

12585  {
12587  // Zombie objects "decide" to be untenured.
12588  return mode == kTenure ? TENURED : NOT_TENURED;
12589 }
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

References mode(), v8::internal::NOT_TENURED, and v8::internal::TENURED.

Referenced by v8::internal::Heap::ProcessPretenuringFeedback(), and v8::internal::Heap::ResetAllAllocationSitesDependentCode().

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

◆ IncrementMementoCreateCount()

void v8::internal::AllocationSite::IncrementMementoCreateCount ( )
inline

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

1661  {
1662  DCHECK(FLAG_allocation_site_pretenuring);
1663  int value = memento_create_count();
1664  set_memento_create_count(value + 1);
1665 }

References DCHECK, memento_create_count(), and set_memento_create_count().

Referenced by v8::internal::Heap::InitializeAllocationMemento().

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

◆ IncrementMementoFoundCount()

bool v8::internal::AllocationSite::IncrementMementoFoundCount ( )
inline

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

1652  {
1653  if (IsZombie()) return false;
1654 
1655  int value = memento_found_count();
1656  set_memento_found_count(value + 1);
1658 }

References IsZombie(), kPretenureMinimumCreated, memento_found_count(), and set_memento_found_count().

Referenced by v8::internal::Heap::UpdateAllocationSiteFeedback().

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

◆ Initialize()

void v8::internal::AllocationSite::Initialize ( )
inline

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

1571  {
1572  set_transition_info(Smi::FromInt(0));
1574  set_nested_site(Smi::FromInt(0));
1575  set_pretenure_data(Smi::FromInt(0));
1576  set_pretenure_create_count(Smi::FromInt(0));
1577  set_dependent_code(DependentCode::cast(GetHeap()->empty_fixed_array()),
1579 }
void SetElementsKind(ElementsKind kind)
Definition: objects.h:8209
Heap * GetHeap() const
Definition: objects-inl.h:1379
static Smi * FromInt(int value)
Definition: objects-inl.h:1321
@ SKIP_WRITE_BARRIER
Definition: objects.h:235
ElementsKind GetInitialFastElementsKind()
Definition: elements-kind.h:78

References v8::internal::Smi::FromInt(), v8::internal::HeapObject::GetHeap(), v8::internal::GetInitialFastElementsKind(), SetElementsKind(), and v8::internal::SKIP_WRITE_BARRIER.

Referenced by MarkZombie().

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

◆ IsMaybeTenure()

bool v8::internal::AllocationSite::IsMaybeTenure ( )
inline

Definition at line 8191 of file objects.h.

8191  {
8192  return pretenure_decision() == kMaybeTenure;
8193  }

Referenced by v8::internal::Heap::ProcessPretenuringFeedback().

+ Here is the caller graph for this function:

◆ IsNestedSite()

bool v8::internal::AllocationSite::IsNestedSite ( )

Definition at line 12592 of file objects.cc.

12592  {
12593  DCHECK(FLAG_trace_track_allocation_sites);
12594  Object* current = GetHeap()->allocation_sites_list();
12595  while (current->IsAllocationSite()) {
12596  AllocationSite* current_site = AllocationSite::cast(current);
12597  if (current_site->nested_site() == this) {
12598  return true;
12599  }
12600  current = current_site->weak_next();
12601  }
12602  return false;
12603 }
Object * allocation_sites_list()
Definition: heap.h:801
kSerializedDataOffset Object
Definition: objects-inl.h:5322

References v8::internal::Heap::allocation_sites_list(), DCHECK, and v8::internal::HeapObject::GetHeap().

+ Here is the call graph for this function:

◆ IsZombie()

bool v8::internal::AllocationSite::IsZombie ( )
inline

Definition at line 8187 of file objects.h.

8187  {
8188  return pretenure_decision() == kZombie;
8189  }

Referenced by IncrementMementoFoundCount(), and MarkZombie().

+ Here is the caller graph for this function:

◆ MakePretenureDecision()

bool v8::internal::AllocationSite::MakePretenureDecision ( PretenureDecision  current_decision,
double  ratio,
bool  maximum_size_scavenge 
)
inline

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

1671  {
1672  // Here we just allow state transitions from undecided or maybe tenure
1673  // to don't tenure, maybe tenure, or tenure.
1674  if ((current_decision == kUndecided || current_decision == kMaybeTenure)) {
1675  if (ratio >= kPretenureRatio) {
1676  // We just transition into tenure state when the semi-space was at
1677  // maximum capacity.
1678  if (maximum_size_scavenge) {
1681  // Currently we just need to deopt when we make a state transition to
1682  // tenure.
1683  return true;
1684  }
1686  } else {
1688  }
1689  }
1690  return false;
1691 }
void set_pretenure_decision(PretenureDecision decision)
Definition: objects.h:8149
static const double kPretenureRatio
Definition: objects.h:8093
void set_deopt_dependent_code(bool deopt)
Definition: objects.h:8161

References kDontTenure, kMaybeTenure, kPretenureRatio, kTenure, kUndecided, set_deopt_dependent_code(), and set_pretenure_decision().

Referenced by DigestPretenuringFeedback().

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

◆ MarkZombie()

void v8::internal::AllocationSite::MarkZombie ( )
inline

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

1582  {
1583  DCHECK(!IsZombie());
1584  Initialize();
1586 }

References DCHECK, Initialize(), IsZombie(), kZombie, and set_pretenure_decision().

Referenced by v8::internal::MarkCompactWeakObjectRetainer::RetainAs().

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

◆ memento_create_count()

int v8::internal::AllocationSite::memento_create_count ( )
inline

Definition at line 8175 of file objects.h.

8175  {
8176  return pretenure_create_count()->value();
8177  }

Referenced by DigestPretenuringFeedback(), and IncrementMementoCreateCount().

+ Here is the caller graph for this function:

◆ memento_found_count()

int v8::internal::AllocationSite::memento_found_count ( )
inline

Definition at line 8168 of file objects.h.

8168  {
8169  int value = pretenure_data()->value();
8170  return MementoFoundCountBits::decode(value);
8171  }

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

Referenced by DigestPretenuringFeedback(), IncrementMementoFoundCount(), and v8::internal::Heap::ProcessPretenuringFeedback().

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

◆ pretenure_decision()

PretenureDecision v8::internal::AllocationSite::pretenure_decision ( )
inline

Definition at line 8144 of file objects.h.

8144  {
8145  int value = pretenure_data()->value();
8146  return PretenureDecisionBits::decode(value);
8147  }

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

Referenced by DigestPretenuringFeedback().

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

◆ PretenureDecisionName()

const char * v8::internal::AllocationSite::PretenureDecisionName ( PretenureDecision  decision)

Definition at line 12672 of file objects.cc.

12672  {
12673  switch (decision) {
12674  case kUndecided: return "undecided";
12675  case kDontTenure: return "don't tenure";
12676  case kMaybeTenure: return "maybe tenure";
12677  case kTenure: return "tenure";
12678  case kZombie: return "zombie";
12679  default: UNREACHABLE();
12680  }
12681  return NULL;
12682 }
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
#define UNREACHABLE()
Definition: logging.h:30

References NULL, and UNREACHABLE.

Referenced by DigestPretenuringFeedback().

+ Here is the caller graph for this function:

◆ PretenuringDecisionMade()

bool v8::internal::AllocationSite::PretenuringDecisionMade ( )
inlineprivate

Definition at line 8276 of file objects.h.

8276  {
8277  return pretenure_decision() != kUndecided;
8278  }

◆ ResetPretenureDecision()

void v8::internal::AllocationSite::ResetPretenureDecision ( )

Definition at line 12578 of file objects.cc.

12578  {
12582 }

Referenced by v8::internal::Heap::ResetAllAllocationSitesDependentCode().

+ Here is the caller graph for this function:

◆ set_deopt_dependent_code()

void v8::internal::AllocationSite::set_deopt_dependent_code ( bool  deopt)
inline

Definition at line 8161 of file objects.h.

8161  {
8162  int value = pretenure_data()->value();
8163  set_pretenure_data(
8166  }
static U update(U previous, T value)
Definition: utils.h:223

References v8::internal::Smi::FromInt(), v8::internal::SKIP_WRITE_BARRIER, and v8::internal::Smi::value().

Referenced by v8::internal::Heap::DeoptMarkedAllocationSites(), MakePretenureDecision(), v8::internal::Heap::ProcessPretenuringFeedback(), and v8::internal::Heap::ResetAllAllocationSitesDependentCode().

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

◆ set_memento_create_count()

void v8::internal::AllocationSite::set_memento_create_count ( int  count)
inline

Definition at line 8179 of file objects.h.

8179  {
8180  set_pretenure_create_count(Smi::FromInt(count), SKIP_WRITE_BARRIER);
8181  }

References v8::internal::Smi::FromInt(), and v8::internal::SKIP_WRITE_BARRIER.

Referenced by DigestPretenuringFeedback(), and IncrementMementoCreateCount().

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

◆ set_memento_found_count()

void v8::internal::AllocationSite::set_memento_found_count ( int  count)
inline

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

1639  {
1640  int value = pretenure_data()->value();
1641  // Verify that we can count more mementos than we can possibly find in one
1642  // new space collection.
1643  DCHECK((GetHeap()->MaxSemiSpaceSize() /
1647  set_pretenure_data(
1650 }
static const T kMax
Definition: utils.h:209
const int kPointerSize
Definition: globals.h:129

References DCHECK, v8::internal::Smi::FromInt(), v8::internal::HeapObject::GetHeap(), v8::internal::BitFieldBase< T, shift, size, U >::kMax, v8::internal::StaticVisitorBase::kMinObjectSizeInWords, v8::internal::kPointerSize, v8::internal::AllocationMemento::kSize, v8::internal::SKIP_WRITE_BARRIER, and v8::internal::BitFieldBase< T, shift, size, U >::update().

Referenced by DigestPretenuringFeedback(), and IncrementMementoFoundCount().

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

◆ set_pretenure_decision()

void v8::internal::AllocationSite::set_pretenure_decision ( PretenureDecision  decision)
inline

Definition at line 8149 of file objects.h.

8149  {
8150  int value = pretenure_data()->value();
8151  set_pretenure_data(
8152  Smi::FromInt(PretenureDecisionBits::update(value, decision)),
8154  }

References v8::internal::Smi::FromInt(), v8::internal::SKIP_WRITE_BARRIER, and v8::internal::Smi::value().

Referenced by MakePretenureDecision(), and MarkZombie().

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

◆ SetDoNotInlineCall()

void v8::internal::AllocationSite::SetDoNotInlineCall ( )
inline

Definition at line 8220 of file objects.h.

8220  {
8221  int value = Smi::cast(transition_info())->value();
8222  set_transition_info(Smi::FromInt(DoNotInlineBit::update(value, true)),
8224  }

References v8::internal::Smi::FromInt(), v8::internal::SKIP_WRITE_BARRIER, and v8::internal::Smi::value().

+ Here is the call graph for this function:

◆ SetElementsKind()

void v8::internal::AllocationSite::SetElementsKind ( ElementsKind  kind)
inline

Definition at line 8209 of file objects.h.

8209  {
8210  int value = Smi::cast(transition_info())->value();
8211  set_transition_info(Smi::FromInt(ElementsKindBits::update(value, kind)),
8213  }

References v8::internal::Smi::FromInt(), v8::internal::SKIP_WRITE_BARRIER, and v8::internal::Smi::value().

Referenced by Initialize().

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

◆ SitePointsToLiteral()

bool v8::internal::AllocationSite::SitePointsToLiteral ( )
inline

Definition at line 8226 of file objects.h.

8226  {
8227  // If transition_info is a smi, then it represents an ElementsKind
8228  // for a constructed array. Otherwise, it must be a boilerplate
8229  // for an object or array literal.
8230  return transition_info()->IsJSArray() || transition_info()->IsJSObject();
8231  }

◆ STATIC_ASSERT()

v8::internal::AllocationSite::STATIC_ASSERT ( PretenureDecisionBits::kMax >=  kLastPretenureDecisionValue)

◆ ToDependencyGroup()

DependentCode::DependencyGroup v8::internal::AllocationSite::ToDependencyGroup ( Reason  reason)
inlineprivate

Member Data Documentation

◆ kDependentCodeOffset

const int v8::internal::AllocationSite::kDependentCodeOffset
static

◆ kMaximumArrayBytesToPretransition

const uint32_t v8::internal::AllocationSite::kMaximumArrayBytesToPretransition = 8 * 1024
static

Definition at line 8092 of file objects.h.

◆ kNestedSiteOffset

const int v8::internal::AllocationSite::kNestedSiteOffset = kTransitionInfoOffset + kPointerSize
static

◆ kPointerFieldsBeginOffset

const int v8::internal::AllocationSite::kPointerFieldsBeginOffset = kTransitionInfoOffset
static

Definition at line 8266 of file objects.h.

◆ kPointerFieldsEndOffset

const int v8::internal::AllocationSite::kPointerFieldsEndOffset = kDependentCodeOffset
static

Definition at line 8267 of file objects.h.

◆ kPretenureCreateCountOffset

const int v8::internal::AllocationSite::kPretenureCreateCountOffset
static
Initial value:

Definition at line 8257 of file objects.h.

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

◆ kPretenureDataOffset

const int v8::internal::AllocationSite::kPretenureDataOffset = kNestedSiteOffset + kPointerSize
static

◆ kPretenureMinimumCreated

const int v8::internal::AllocationSite::kPretenureMinimumCreated = 100
static

Definition at line 8094 of file objects.h.

Referenced by DigestPretenuringFeedback(), and IncrementMementoFoundCount().

◆ kPretenureRatio

const double v8::internal::AllocationSite::kPretenureRatio = 0.85
static

Definition at line 8093 of file objects.h.

Referenced by MakePretenureDecision().

◆ kSize

const int v8::internal::AllocationSite::kSize = kWeakNextOffset + kPointerSize
static

◆ kTransitionInfoOffset

const int v8::internal::AllocationSite::kTransitionInfoOffset = HeapObject::kHeaderSize
static

◆ kWeakNextOffset


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