V8 API Reference, 7.2.502.16 (for Deno 0.2.4)
v8::internal::Heap Class Reference

Classes

struct  Chunk
 
class  SkipStoreBufferScope
 
struct  StrongRootsList
 

Public Types

enum  FindMementoMode { kForRuntime, kForGC }
 
enum  HeapState {
  NOT_IN_GC, SCAVENGE, MARK_COMPACT, MINOR_MARK_COMPACT,
  TEAR_DOWN
}
 
using PretenuringFeedbackMap = std::unordered_map< AllocationSite *, size_t >
 
typedef std::vector< ChunkReservation
 
typedef v8::Isolate::GetExternallyAllocatedMemoryInBytesCallback GetExternallyAllocatedMemoryInBytesCallback
 

Public Member Functions

base::Mutexrelocation_mutex ()
 
 STATIC_ASSERT (static_cast< int >(RootIndex::kUndefinedValue)==Internals::kUndefinedValueRootIndex)
 
 STATIC_ASSERT (static_cast< int >(RootIndex::kTheHoleValue)==Internals::kTheHoleValueRootIndex)
 
 STATIC_ASSERT (static_cast< int >(RootIndex::kNullValue)==Internals::kNullValueRootIndex)
 
 STATIC_ASSERT (static_cast< int >(RootIndex::kTrueValue)==Internals::kTrueValueRootIndex)
 
 STATIC_ASSERT (static_cast< int >(RootIndex::kFalseValue)==Internals::kFalseValueRootIndex)
 
 STATIC_ASSERT (static_cast< int >(RootIndex::kempty_string)==Internals::kEmptyStringRootIndex)
 
void FatalProcessOutOfMemory (const char *location)
 
void NotifyDeserializationComplete ()
 
AddressNewSpaceAllocationTopAddress ()
 
AddressNewSpaceAllocationLimitAddress ()
 
AddressOldSpaceAllocationTopAddress ()
 
AddressOldSpaceAllocationLimitAddress ()
 
void MoveElements (FixedArray array, int dst_index, int src_index, int len, WriteBarrierMode mode=UPDATE_WRITE_BARRIER)
 
V8_EXPORT_PRIVATE HeapObjectCreateFillerObjectAt (Address addr, int size, ClearRecordedSlots clear_slots_mode, ClearFreedMemoryMode clear_memory_mode=ClearFreedMemoryMode::kDontClearFreedMemory)
 
template<typename T >
void CreateFillerForArray (T object, int elements_to_trim, int bytes_to_trim)
 
bool CanMoveObjectStart (HeapObject *object)
 
bool IsImmovable (HeapObject *object)
 
bool IsLargeObject (HeapObject *object)
 
bool IsWithinLargeObject (Address address)
 
bool IsInYoungGeneration (HeapObject *object)
 
FixedArrayBase LeftTrimFixedArray (FixedArrayBase obj, int elements_to_trim)
 
void RightTrimFixedArray (FixedArrayBase obj, int elements_to_trim)
 
void RightTrimWeakFixedArray (WeakFixedArray *obj, int elements_to_trim)
 
OddballToBoolean (bool condition)
 
int NotifyContextDisposed (bool dependant_context)
 
void set_native_contexts_list (Object *object)
 
Objectnative_contexts_list () const
 
void set_allocation_sites_list (Object *object)
 
Objectallocation_sites_list ()
 
Address allocation_sites_list_address ()
 
void ForeachAllocationSite (Object *list, const std::function< void(AllocationSite *)> &visitor)
 
int ms_count () const
 
bool AllowedToBeMigrated (HeapObject *object, AllocationSpace dest)
 
void CheckHandleCount ()
 
uint32_t allocations_count ()
 
void PrintShortHeapStatistics ()
 
bool write_protect_code_memory () const
 
uintptr_t code_space_memory_modification_scope_depth ()
 
void increment_code_space_memory_modification_scope_depth ()
 
void decrement_code_space_memory_modification_scope_depth ()
 
void UnprotectAndRegisterMemoryChunk (MemoryChunk *chunk)
 
void UnprotectAndRegisterMemoryChunk (HeapObject *object)
 
void UnregisterUnprotectedMemoryChunk (MemoryChunk *chunk)
 
V8_EXPORT_PRIVATE void ProtectUnprotectedMemoryChunks ()
 
void EnableUnprotectedMemoryChunksRegistry ()
 
void DisableUnprotectedMemoryChunksRegistry ()
 
bool unprotected_memory_chunks_registry_enabled ()
 
HeapState gc_state ()
 
void SetGCState (HeapState state)
 
bool IsTearingDown () const
 
bool IsInGCPostProcessing ()
 
template<FindMementoMode mode>
AllocationMementoFindAllocationMemento (Map map, HeapObject *object)
 
bool ReserveSpace (Reservation *reservations, std::vector< Address > *maps)
 
void CreateApiObjects ()
 
bool IdleNotification (double deadline_in_seconds)
 
bool IdleNotification (int idle_time_in_ms)
 
void MemoryPressureNotification (MemoryPressureLevel level, bool is_isolate_locked)
 
void CheckMemoryPressure ()
 
void AddNearHeapLimitCallback (v8::NearHeapLimitCallback, void *data)
 
void RemoveNearHeapLimitCallback (v8::NearHeapLimitCallback callback, size_t heap_limit)
 
double MonotonicallyIncreasingTimeInMs ()
 
void RecordStats (HeapStats *stats, bool take_snapshot=false)
 
void CheckNewSpaceExpansionCriteria ()
 
void VisitExternalResources (v8::ExternalResourceVisitor *visitor)
 
bool ShouldBePromoted (Address old_address)
 
void IncrementDeferredCount (v8::Isolate::UseCounterFeature feature)
 
uint64_t HashSeed ()
 
int NextScriptId ()
 
int NextDebuggingId ()
 
int GetNextTemplateSerialNumber ()
 
void SetSerializedObjects (FixedArray objects)
 
void SetSerializedGlobalProxySizes (FixedArray sizes)
 
void RememberUnmappedPage (Address page, bool compacted)
 
int64_t external_memory_hard_limit ()
 
V8_INLINE int64_t external_memory ()
 
V8_INLINE void update_external_memory (int64_t delta)
 
V8_INLINE void update_external_memory_concurrently_freed (intptr_t freed)
 
V8_INLINE void account_external_memory_concurrently_freed ()
 
size_t backing_store_bytes () const
 
void CompactWeakArrayLists (PretenureFlag pretenure)
 
void AddRetainedMap (Handle< Map > map)
 
void OnAllocationEvent (HeapObject *object, int size_in_bytes)
 
void OnMoveEvent (HeapObject *target, HeapObject *source, int size_in_bytes)
 
bool CanAllocateInReadOnlySpace ()
 
bool deserialization_complete () const
 
bool HasLowAllocationRate ()
 
bool HasHighFragmentation ()
 
bool HasHighFragmentation (size_t used, size_t committed)
 
void ActivateMemoryReducerIfNeeded ()
 
bool ShouldOptimizeForMemoryUsage ()
 
bool HighMemoryPressure ()
 
void RestoreHeapLimit (size_t heap_limit)
 
void ConfigureHeap (size_t max_semi_space_size_in_kb, size_t max_old_generation_size_in_mb, size_t code_range_size_in_mb)
 
void ConfigureHeapDefault ()
 
void SetUp ()
 
void InitializeHashSeed ()
 
bool CreateHeapObjects ()
 
void CreateObjectStats ()
 
void StartTearDown ()
 
void TearDown ()
 
bool HasBeenSetUp ()
 
Address NewSpaceTop ()
 
NewSpacenew_space ()
 
OldSpaceold_space ()
 
CodeSpacecode_space ()
 
MapSpacemap_space ()
 
LargeObjectSpacelo_space ()
 
CodeLargeObjectSpacecode_lo_space ()
 
NewLargeObjectSpacenew_lo_space ()
 
ReadOnlySpaceread_only_space ()
 
PagedSpacepaged_space (int idx)
 
Spacespace (int idx)
 
const charGetSpaceName (int idx)
 
GCTracertracer ()
 
MemoryAllocatormemory_allocator ()
 
Isolateisolate ()
 
MarkCompactCollectormark_compact_collector ()
 
MinorMarkCompactCollector * minor_mark_compact_collector ()
 
ArrayBufferCollectorarray_buffer_collector ()
 
V8_INLINE RootsTableroots_table ()
 
V8_INLINE void SetRootCodeStubs (SimpleNumberDictionary value)
 
V8_INLINE void SetRootMaterializedObjects (FixedArray objects)
 
V8_INLINE void SetRootScriptList (Object *value)
 
V8_INLINE void SetRootStringTable (StringTable value)
 
V8_INLINE void SetRootNoScriptSharedFunctionInfos (Object *value)
 
V8_INLINE void SetMessageListeners (TemplateList value)
 
void SetStackLimits ()
 
void ClearStackLimits ()
 
void RegisterStrongRoots (ObjectSlot start, ObjectSlot end)
 
void UnregisterStrongRoots (ObjectSlot start)
 
void SetBuiltinsConstantsTable (FixedArray cache)
 
void SetInterpreterEntryTrampolineForProfiling (Code code)
 
void AddDirtyJSWeakFactory (JSWeakFactory *weak_factory, std::function< void(HeapObject *object, ObjectSlot slot, Object *target)> gc_notify_updated_slot)
 
void AddKeepDuringJobTarget (Handle< JSReceiver > target)
 
void ClearKeepDuringJobSet ()
 
bool inline_allocation_disabled ()
 
void EnableInlineAllocation ()
 
void DisableInlineAllocation ()
 
V8_EXPORT_PRIVATE bool CollectGarbage (AllocationSpace space, GarbageCollectionReason gc_reason, const GCCallbackFlags gc_callback_flags=kNoGCCallbackFlags)
 
V8_EXPORT_PRIVATE void CollectAllGarbage (int flags, GarbageCollectionReason gc_reason, const GCCallbackFlags gc_callback_flags=kNoGCCallbackFlags)
 
void CollectAllAvailableGarbage (GarbageCollectionReason gc_reason)
 
void PreciseCollectAllGarbage (int flags, GarbageCollectionReason gc_reason, const GCCallbackFlags gc_callback_flags=kNoGCCallbackFlags)
 
void ReportExternalMemoryPressure ()
 
void SetGetExternallyAllocatedMemoryInBytesCallback (GetExternallyAllocatedMemoryInBytesCallback callback)
 
void HandleGCRequest ()
 
Code builtin (int index)
 
Address builtin_address (int index)
 
void set_builtin (int index, Code builtin)
 
void IterateRoots (RootVisitor *v, VisitMode mode)
 
void IterateStrongRoots (RootVisitor *v, VisitMode mode)
 
void IterateSmiRoots (RootVisitor *v)
 
void IterateWeakRoots (RootVisitor *v, VisitMode mode)
 
void IterateWeakGlobalHandles (RootVisitor *v)
 
void IterateBuiltins (RootVisitor *v)
 
AddressIsMarkingFlagAddress ()
 
void SetIsMarkingFlag (uint8_t flag)
 
Addressstore_buffer_top_address ()
 
void ClearRecordedSlot (HeapObject *object, ObjectSlot slot)
 
void ClearRecordedSlotRange (Address start, Address end)
 
int GCFlagsForIncrementalMarking ()
 
void StartIdleIncrementalMarking (GarbageCollectionReason gc_reason, GCCallbackFlags gc_callback_flags=GCCallbackFlags::kNoGCCallbackFlags)
 
void StartIncrementalMarking (int gc_flags, GarbageCollectionReason gc_reason, GCCallbackFlags gc_callback_flags=GCCallbackFlags::kNoGCCallbackFlags)
 
void StartIncrementalMarkingIfAllocationLimitIsReached (int gc_flags, GCCallbackFlags gc_callback_flags=GCCallbackFlags::kNoGCCallbackFlags)
 
void FinalizeIncrementalMarkingIfComplete (GarbageCollectionReason gc_reason)
 
void FinalizeIncrementalMarkingAtomically (GarbageCollectionReason gc_reason)
 
void RegisterDeserializedObjectsForBlackAllocation (Reservation *reservations, const std::vector< HeapObject *> &large_objects, const std::vector< Address > &maps)
 
IncrementalMarkingincremental_marking ()
 
ConcurrentMarkingconcurrent_marking ()
 
void NotifyObjectLayoutChange (HeapObject *object, int old_size, const DisallowHeapAllocation &)
 
void SetArgumentsAdaptorDeoptPCOffset (int pc_offset)
 
void SetConstructStubCreateDeoptPCOffset (int pc_offset)
 
void SetConstructStubInvokeDeoptPCOffset (int pc_offset)
 
void SetInterpreterEntryReturnPCOffset (int pc_offset)
 
void InvalidateCodeDeoptimizationData (Code code)
 
void DeoptMarkedAllocationSites ()
 
bool DeoptMaybeTenuredAllocationSites ()
 
LocalEmbedderHeapTracerlocal_embedder_heap_tracer () const
 
void SetEmbedderHeapTracer (EmbedderHeapTracer *tracer)
 
EmbedderHeapTracer * GetEmbedderHeapTracer () const
 
void RegisterExternallyReferencedObject (Address *location)
 
void SetEmbedderStackStateForNextFinalizaton (EmbedderHeapTracer::EmbedderStackState stack_state)
 
void RegisterExternalString (String string)
 
void UpdateExternalString (String string, size_t old_payload, size_t new_payload)
 
void FinalizeExternalString (String string)
 
bool InOldSpace (Object *object)
 
bool InReadOnlySpace (Object *object)
 
bool Contains (HeapObject *value)
 
bool InSpace (HeapObject *value, AllocationSpace space)
 
bool InSpaceSlow (Address addr, AllocationSpace space)
 
size_t NumberOfTrackedHeapObjectTypes ()
 
size_t ObjectCountAtLastGC (size_t index)
 
size_t ObjectSizeAtLastGC (size_t index)
 
bool GetObjectTypeName (size_t index, const char **object_type, const char **object_sub_type)
 
size_t NumberOfNativeContexts ()
 
size_t NumberOfDetachedContexts ()
 
void CollectCodeStatistics ()
 
size_t MaxReserved ()
 
size_t MaxSemiSpaceSize ()
 
size_t InitialSemiSpaceSize ()
 
size_t MaxOldGenerationSize ()
 
size_t Capacity ()
 
size_t OldGenerationCapacity ()
 
size_t CommittedMemoryOfUnmapper ()
 
size_t CommittedMemory ()
 
size_t CommittedOldGenerationMemory ()
 
size_t CommittedMemoryExecutable ()
 
size_t CommittedPhysicalMemory ()
 
size_t MaximumCommittedMemory ()
 
void UpdateMaximumCommitted ()
 
size_t Available ()
 
size_t SizeOfObjects ()
 
void UpdateSurvivalStatistics (int start_new_space_size)
 
void IncrementPromotedObjectsSize (size_t object_size)
 
size_t promoted_objects_size ()
 
void IncrementSemiSpaceCopiedObjectSize (size_t object_size)
 
size_t semi_space_copied_object_size ()
 
size_t SurvivedNewSpaceObjectSize ()
 
void IncrementNodesDiedInNewSpace ()
 
void IncrementNodesCopiedInNewSpace ()
 
void IncrementNodesPromoted ()
 
void IncrementYoungSurvivorsCounter (size_t survived)
 
uint64_t OldGenerationObjectsAndPromotedExternalMemorySize ()
 
void UpdateNewSpaceAllocationCounter ()
 
size_t NewSpaceAllocationCounter ()
 
void set_new_space_allocation_counter (size_t new_value)
 
void UpdateOldGenerationAllocationCounter ()
 
size_t OldGenerationAllocationCounter ()
 
void set_old_generation_allocation_counter_at_last_gc (size_t new_value)
 
size_t PromotedSinceLastGC ()
 
void NotifyRefinedOldGenerationSize (size_t decreased_bytes)
 
int gc_count () const
 
size_t OldGenerationSizeOfObjects ()
 
void AddGCPrologueCallback (v8::Isolate::GCCallbackWithData callback, GCType gc_type_filter, void *data)
 
void RemoveGCPrologueCallback (v8::Isolate::GCCallbackWithData callback, void *data)
 
void AddGCEpilogueCallback (v8::Isolate::GCCallbackWithData callback, GCType gc_type_filter, void *data)
 
void RemoveGCEpilogueCallback (v8::Isolate::GCCallbackWithData callback, void *data)
 
void CallGCPrologueCallbacks (GCType gc_type, GCCallbackFlags flags)
 
void CallGCEpilogueCallbacks (GCType gc_type, GCCallbackFlags flags)
 
V8_WARN_UNUSED_RESULT HeapObjectPrecedeWithFiller (HeapObject *object, int filler_size)
 
V8_WARN_UNUSED_RESULT HeapObjectAlignWithFiller (HeapObject *object, int object_size, int allocation_size, AllocationAlignment alignment)
 
void RegisterNewArrayBuffer (JSArrayBuffer *buffer)
 
void UnregisterArrayBuffer (JSArrayBuffer *buffer)
 
void UpdateAllocationSite (Map map, HeapObject *object, PretenuringFeedbackMap *pretenuring_feedback)
 
void MergeAllocationSitePretenuringFeedback (const PretenuringFeedbackMap &local_pretenuring_feedback)
 
void AddAllocationObserversToAllSpaces (AllocationObserver *observer, AllocationObserver *new_space_observer)
 
void RemoveAllocationObserversFromAllSpaces (AllocationObserver *observer, AllocationObserver *new_space_observer)
 
bool allocation_step_in_progress ()
 
void set_allocation_step_in_progress (bool val)
 
void AddHeapObjectAllocationTracker (HeapObjectAllocationTracker *tracker)
 
void RemoveHeapObjectAllocationTracker (HeapObjectAllocationTracker *tracker)
 
bool has_heap_object_allocation_tracker () const
 
void AddRetainingPathTarget (Handle< HeapObject > object, RetainingPathOption option)
 
Code GcSafeFindCodeForInnerPointer (Address inner_pointer)
 
bool GcSafeCodeContains (Code code, Address addr)
 
void * GetRandomMmapAddr ()
 
int MaxNumberToStringCacheSize () const
 

Static Public Member Functions

static int GetMaximumFillToAlign (AllocationAlignment alignment)
 
static int GetFillToAlign (Address address, AllocationAlignment alignment)
 
static bool IsValidAllocationSpace (AllocationSpace space)
 
static bool ShouldZapGarbage ()
 
static uintptr_t ZapValue ()
 
static bool IsYoungGenerationCollector (GarbageCollector collector)
 
static GarbageCollector YoungGenerationCollector ()
 
static const charCollectorName (GarbageCollector collector)
 
static void CopyBlock (Address dst, Address src, int byte_size)
 
static V8_EXPORT_PRIVATE void WriteBarrierForCodeSlow (Code host)
 
static V8_EXPORT_PRIVATE void GenerationalBarrierSlow (HeapObject *object, Address slot, HeapObject *value)
 
static V8_EXPORT_PRIVATE void GenerationalBarrierForElementsSlow (Heap *heap, FixedArray array, int offset, int length)
 
static V8_EXPORT_PRIVATE void GenerationalBarrierForCodeSlow (Code host, RelocInfo *rinfo, HeapObject *value)
 
static V8_EXPORT_PRIVATE void MarkingBarrierSlow (HeapObject *object, Address slot, HeapObject *value)
 
static V8_EXPORT_PRIVATE void MarkingBarrierForElementsSlow (Heap *heap, HeapObject *object)
 
static V8_EXPORT_PRIVATE void MarkingBarrierForCodeSlow (Code host, RelocInfo *rinfo, HeapObject *value)
 
static V8_EXPORT_PRIVATE bool PageFlagsAreConsistent (HeapObject *object)
 
static intptr_t store_buffer_mask_constant ()
 
static Address store_buffer_overflow_function_address ()
 
static String UpdateNewSpaceReferenceInExternalStringTableEntry (Heap *heap, ObjectSlot pointer)
 
static bool InNewSpace (Object *object)
 
static bool InNewSpace (MaybeObject object)
 
static bool InNewSpace (HeapObject *heap_object)
 
static bool InNewSpace (HeapObjectPtr heap_object)
 
static bool InFromSpace (Object *object)
 
static bool InFromSpace (MaybeObject object)
 
static bool InFromSpace (HeapObject *heap_object)
 
static bool InToSpace (Object *object)
 
static bool InToSpace (MaybeObject object)
 
static bool InToSpace (HeapObject *heap_object)
 
static bool InToSpace (HeapObjectPtr heap_object)
 
static HeapFromWritableHeapObject (const HeapObject *obj)
 
static HeapFromWritableHeapObject (const HeapObjectPtr *obj)
 
static V8_EXPORT_PRIVATE size_t ComputeMaxOldGenerationSize (uint64_t physical_memory)
 
static size_t ComputeMaxSemiSpaceSize (uint64_t physical_memory)
 
static const charGarbageCollectionReasonToString (GarbageCollectionReason gc_reason)
 

Static Public Attributes

static const int kInitalOldGenerationLimitFactor = 2
 
static const int kPointerMultiplier = i::kPointerSize / 4
 
static const size_t kMinSemiSpaceSizeInKB
 
static const size_t kMaxSemiSpaceSizeInKB
 
static const int kTraceRingBufferSize = 512
 
static const int kStacktraceBufferSize = 512
 
static const int kNoGCFlags = 0
 
static const int kReduceMemoryFootprintMask = 1
 
static const int kMinObjectSizeInTaggedWords = 2
 
static const int kMinPromotedPercentForFastPromotionMode = 90
 

Friends

class AlwaysAllocateScope
 
class ArrayBufferCollector
 
class ConcurrentMarking
 
class EphemeronHashTableMarkingTask
 
class GCCallbacksScope
 
class GCTracer
 
class MemoryController
 
class HeapIterator
 
class IdleScavengeObserver
 
class IncrementalMarking
 
class IncrementalMarkingJob
 
class LargeObjectSpace
 
template<FixedArrayVisitationMode fixed_array_mode, TraceRetainingPathMode retaining_path_mode, typename MarkingState >
class MarkingVisitor
 
class MarkCompactCollector
 
class MarkCompactCollectorBase
 
class MinorMarkCompactCollector
 
class NewSpace
 
class ObjectStatsCollector
 
class Page
 
class PagedSpace
 
class ReadOnlyRoots
 
class Scavenger
 
class ScavengerCollector
 
class Space
 
class StoreBuffer
 
class Sweeper
 
class heap::TestMemoryAllocatorScope
 
class Factory
 
class Isolate
 
class heap::HeapTester
 

Detailed Description

Definition at line 217 of file heap.h.

Member Data Documentation

◆ kMaxSemiSpaceSizeInKB

const size_t v8::internal::Heap::kMaxSemiSpaceSizeInKB
static
Initial value:
=
16 * kPointerMultiplier * ((1 << kPageSizeBits) / KB)

Definition at line 257 of file heap.h.

◆ kMinSemiSpaceSizeInKB

const size_t v8::internal::Heap::kMinSemiSpaceSizeInKB
static
Initial value:
=
1 * kPointerMultiplier * ((1 << kPageSizeBits) / KB)

Definition at line 255 of file heap.h.


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