v8  3.14.5(node0.10.28)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Heap Class Reference

#include <heap.h>

Data Structures

class  RelocationLock
 

Public Types

enum  HeapState { NOT_IN_GC, SCAVENGE, MARK_COMPACT }
 
enum  RootListIndex { kSymbolTableRootIndex, kStrongRootListLength = kSymbolTableRootIndex, kRootListLength }
 
enum  { FIRST_CODE_KIND_SUB_TYPE = LAST_TYPE + 1, FIRST_FIXED_ARRAY_SUB_TYPE, OBJECT_STATS_COUNT }
 

Public Member Functions

bool ConfigureHeap (int max_semispace_size, intptr_t max_old_gen_size, intptr_t max_executable_size)
 
bool ConfigureHeapDefault ()
 
bool SetUp (bool create_heap_objects)
 
void TearDown ()
 
void SetStackLimits ()
 
bool HasBeenSetUp ()
 
intptr_t MaxReserved ()
 
int MaxSemiSpaceSize ()
 
int ReservedSemiSpaceSize ()
 
int InitialSemiSpaceSize ()
 
intptr_t MaxOldGenerationSize ()
 
intptr_t MaxExecutableSize ()
 
intptr_t Capacity ()
 
intptr_t CommittedMemory ()
 
intptr_t CommittedMemoryExecutable ()
 
intptr_t Available ()
 
intptr_t SizeOfObjects ()
 
Address NewSpaceStart ()
 
uintptr_t NewSpaceMask ()
 
Address NewSpaceTop ()
 
NewSpacenew_space ()
 
OldSpaceold_pointer_space ()
 
OldSpaceold_data_space ()
 
OldSpacecode_space ()
 
MapSpacemap_space ()
 
CellSpacecell_space ()
 
LargeObjectSpacelo_space ()
 
PagedSpacepaged_space (int idx)
 
bool always_allocate ()
 
Address always_allocate_scope_depth_address ()
 
bool linear_allocation ()
 
AddressNewSpaceAllocationTopAddress ()
 
AddressNewSpaceAllocationLimitAddress ()
 
bool UncommitFromSpace ()
 
MUST_USE_RESULT MaybeObject * AllocateJSObject (JSFunction *constructor, PretenureFlag pretenure=NOT_TENURED)
 
MUST_USE_RESULT MaybeObject * AllocateJSModule (Context *context, ScopeInfo *scope_info)
 
MUST_USE_RESULT MaybeObject * AllocateEmptyJSArray (ElementsKind elements_kind, PretenureFlag pretenure=NOT_TENURED)
 
MUST_USE_RESULT MaybeObject * AllocateJSArrayAndStorage (ElementsKind elements_kind, int length, int capacity, ArrayStorageAllocationMode mode=DONT_INITIALIZE_ARRAY_ELEMENTS, PretenureFlag pretenure=NOT_TENURED)
 
MUST_USE_RESULT MaybeObject * AllocateJSArrayWithElements (FixedArrayBase *array_base, ElementsKind elements_kind, PretenureFlag pretenure=NOT_TENURED)
 
MUST_USE_RESULT MaybeObject * AllocateGlobalObject (JSFunction *constructor)
 
MUST_USE_RESULT MaybeObject * CopyJSObject (JSObject *source)
 
MUST_USE_RESULT MaybeObject * AllocateFunctionPrototype (JSFunction *function)
 
MUST_USE_RESULT MaybeObject * AllocateJSProxy (Object *handler, Object *prototype)
 
MUST_USE_RESULT MaybeObject * AllocateJSFunctionProxy (Object *handler, Object *call_trap, Object *construct_trap, Object *prototype)
 
MUST_USE_RESULT MaybeObject * ReinitializeJSReceiver (JSReceiver *object, InstanceType type, int size)
 
MUST_USE_RESULT MaybeObject * ReinitializeJSGlobalProxy (JSFunction *constructor, JSGlobalProxy *global)
 
MUST_USE_RESULT MaybeObject * AllocateJSObjectFromMap (Map *map, PretenureFlag pretenure=NOT_TENURED)
 
MUST_USE_RESULT MaybeObject * Allocate (Map *map, AllocationSpace space)
 
MUST_USE_RESULT MaybeObject * AllocateMap (InstanceType instance_type, int instance_size, ElementsKind elements_kind=TERMINAL_FAST_ELEMENTS_KIND)
 
MUST_USE_RESULT MaybeObject * AllocatePartialMap (InstanceType instance_type, int instance_size)
 
MUST_USE_RESULT MaybeObject * AllocateInitialMap (JSFunction *fun)
 
MUST_USE_RESULT MaybeObject * AllocateCodeCache ()
 
MUST_USE_RESULT MaybeObject * AllocateScopeInfo (int length)
 
MUST_USE_RESULT MaybeObject * AllocatePolymorphicCodeCache ()
 
MUST_USE_RESULT MaybeObject * AllocateAccessorPair ()
 
MUST_USE_RESULT MaybeObject * AllocateTypeFeedbackInfo ()
 
MUST_USE_RESULT MaybeObject * AllocateAliasedArgumentsEntry (int slot)
 
void ClearInstanceofCache ()
 
void RepairFreeListsAfterBoot ()
 
MUST_USE_RESULT MaybeObject * AllocateStringFromAscii (Vector< const char > str, PretenureFlag pretenure=NOT_TENURED)
 
MUST_USE_RESULT MaybeObject * AllocateStringFromUtf8 (Vector< const char > str, PretenureFlag pretenure=NOT_TENURED)
 
MUST_USE_RESULT MaybeObject * AllocateStringFromUtf8Slow (Vector< const char > str, int non_ascii_start, PretenureFlag pretenure=NOT_TENURED)
 
MUST_USE_RESULT MaybeObject * AllocateStringFromTwoByte (Vector< const uc16 > str, PretenureFlag pretenure=NOT_TENURED)
 
MUST_USE_RESULT MaybeObject * AllocateSymbol (Vector< const char > str, int chars, uint32_t hash_field)
 
MUST_USE_RESULT MaybeObject * AllocateAsciiSymbol (Vector< const char > str, uint32_t hash_field)
 
MUST_USE_RESULT MaybeObject * AllocateTwoByteSymbol (Vector< const uc16 > str, uint32_t hash_field)
 
MUST_USE_RESULT MaybeObject * AllocateInternalSymbol (unibrow::CharacterStream *buffer, int chars, uint32_t hash_field)
 
MUST_USE_RESULT MaybeObject * AllocateExternalSymbol (Vector< const char > str, int chars)
 
MUST_USE_RESULT MaybeObject * AllocateRawAsciiString (int length, PretenureFlag pretenure=NOT_TENURED)
 
MUST_USE_RESULT MaybeObject * AllocateRawTwoByteString (int length, PretenureFlag pretenure=NOT_TENURED)
 
MUST_USE_RESULT MaybeObject * LookupSingleCharacterStringFromCode (uint16_t code)
 
MUST_USE_RESULT MaybeObject * AllocateByteArray (int length, PretenureFlag pretenure)
 
MUST_USE_RESULT MaybeObject * AllocateByteArray (int length)
 
MUST_USE_RESULT MaybeObject * AllocateExternalArray (int length, ExternalArrayType array_type, void *external_pointer, PretenureFlag pretenure)
 
MUST_USE_RESULT MaybeObject * AllocateJSGlobalPropertyCell (Object *value)
 
MUST_USE_RESULT MaybeObject * AllocateFixedArray (int length, PretenureFlag pretenure)
 
MUST_USE_RESULT MaybeObject * AllocateFixedArray (int length)
 
MUST_USE_RESULT MaybeObject * AllocateUninitializedFixedArray (int length)
 
MUST_USE_RESULT MaybeObject * CopyFixedArray (FixedArray *src)
 
MUST_USE_RESULT MaybeObject * CopyFixedArrayWithMap (FixedArray *src, Map *map)
 
MUST_USE_RESULT MaybeObject * CopyFixedDoubleArray (FixedDoubleArray *src)
 
MUST_USE_RESULT MaybeObject * CopyFixedDoubleArrayWithMap (FixedDoubleArray *src, Map *map)
 
MUST_USE_RESULT MaybeObject * AllocateFixedArrayWithHoles (int length, PretenureFlag pretenure=NOT_TENURED)
 
MUST_USE_RESULT MaybeObject * AllocateRawFixedDoubleArray (int length, PretenureFlag pretenure)
 
MUST_USE_RESULT MaybeObject * AllocateUninitializedFixedDoubleArray (int length, PretenureFlag pretenure=NOT_TENURED)
 
MUST_USE_RESULT MaybeObject * AllocateFixedDoubleArrayWithHoles (int length, PretenureFlag pretenure=NOT_TENURED)
 
MUST_USE_RESULT MaybeObject * AllocateHashTable (int length, PretenureFlag pretenure=NOT_TENURED)
 
MUST_USE_RESULT MaybeObject * AllocateNativeContext ()
 
MUST_USE_RESULT MaybeObject * AllocateGlobalContext (JSFunction *function, ScopeInfo *scope_info)
 
MUST_USE_RESULT MaybeObject * AllocateModuleContext (ScopeInfo *scope_info)
 
MUST_USE_RESULT MaybeObject * AllocateFunctionContext (int length, JSFunction *function)
 
MUST_USE_RESULT MaybeObject * AllocateCatchContext (JSFunction *function, Context *previous, String *name, Object *thrown_object)
 
MUST_USE_RESULT MaybeObject * AllocateWithContext (JSFunction *function, Context *previous, JSObject *extension)
 
MUST_USE_RESULT MaybeObject * AllocateBlockContext (JSFunction *function, Context *previous, ScopeInfo *info)
 
MUST_USE_RESULT MaybeObject * AllocateStruct (InstanceType type)
 
MUST_USE_RESULT MaybeObject * AllocateFunction (Map *function_map, SharedFunctionInfo *shared, Object *prototype, PretenureFlag pretenure=TENURED)
 
MUST_USE_RESULT MaybeObject * AllocateArgumentsObject (Object *callee, int length)
 
MUST_USE_RESULT MaybeObject * NumberFromDouble (double value, PretenureFlag pretenure=NOT_TENURED)
 
MUST_USE_RESULT MaybeObject * AllocateHeapNumber (double value, PretenureFlag pretenure)
 
MUST_USE_RESULT MaybeObject * AllocateHeapNumber (double value)
 
MUST_USE_RESULT MaybeObject * NumberFromInt32 (int32_t value, PretenureFlag pretenure=NOT_TENURED)
 
MUST_USE_RESULT MaybeObject * NumberFromUint32 (uint32_t value, PretenureFlag pretenure=NOT_TENURED)
 
MUST_USE_RESULT MaybeObject * AllocateForeign (Address address, PretenureFlag pretenure=NOT_TENURED)
 
MUST_USE_RESULT MaybeObject * AllocateSharedFunctionInfo (Object *name)
 
MUST_USE_RESULT MaybeObject * AllocateJSMessageObject (String *type, JSArray *arguments, int start_position, int end_position, Object *script, Object *stack_trace, Object *stack_frames)
 
MUST_USE_RESULT MaybeObject * AllocateConsString (String *first, String *second)
 
MUST_USE_RESULT MaybeObject * AllocateSubString (String *buffer, int start, int end, PretenureFlag pretenure=NOT_TENURED)
 
MUST_USE_RESULT MaybeObject * AllocateExternalStringFromAscii (const ExternalAsciiString::Resource *resource)
 
MUST_USE_RESULT MaybeObject * AllocateExternalStringFromTwoByte (const ExternalTwoByteString::Resource *resource)
 
void FinalizeExternalString (String *string)
 
MUST_USE_RESULT MaybeObject * AllocateRaw (int size_in_bytes, AllocationSpace space, AllocationSpace retry_space)
 
void CreateFillerObjectAt (Address addr, int size)
 
MUST_USE_RESULT MaybeObject * CreateCode (const CodeDesc &desc, Code::Flags flags, Handle< Object > self_reference, bool immovable=false)
 
MUST_USE_RESULT MaybeObject * CopyCode (Code *code)
 
MUST_USE_RESULT MaybeObject * CopyCode (Code *code, Vector< byte > reloc_info)
 
MUST_USE_RESULT MaybeObject * LookupSymbol (Vector< const char > str)
 
MUST_USE_RESULT MaybeObject * LookupAsciiSymbol (Vector< const char > str)
 
MUST_USE_RESULT MaybeObject * LookupTwoByteSymbol (Vector< const uc16 > str)
 
MUST_USE_RESULT MaybeObject * LookupAsciiSymbol (const char *str)
 
MUST_USE_RESULT MaybeObject * LookupSymbol (String *str)
 
MUST_USE_RESULT MaybeObject * LookupAsciiSymbol (Handle< SeqAsciiString > string, int from, int length)
 
bool LookupSymbolIfExists (String *str, String **symbol)
 
bool LookupTwoCharsSymbolIfExists (String *str, String **symbol)
 
MapSymbolMapForString (String *str)
 
MUST_USE_RESULT MaybeObject * PrepareForCompare (String *str)
 
ObjectToBoolean (bool condition)
 
void GarbageCollectionPrologue ()
 
void GarbageCollectionEpilogue ()
 
bool CollectGarbage (AllocationSpace space, GarbageCollector collector, const char *gc_reason, const char *collector_reason)
 
bool CollectGarbage (AllocationSpace space, const char *gc_reason=NULL)
 
void CollectAllGarbage (int flags, const char *gc_reason=NULL)
 
void CollectAllAvailableGarbage (const char *gc_reason=NULL)
 
bool IsHeapIterable ()
 
void EnsureHeapIsIterable ()
 
int NotifyContextDisposed ()
 
void PerformScavenge ()
 
void increment_scan_on_scavenge_pages ()
 
void decrement_scan_on_scavenge_pages ()
 
PromotionQueuepromotion_queue ()
 
void AddGCPrologueCallback (GCPrologueCallback callback, GCType gc_type_filter)
 
void RemoveGCPrologueCallback (GCPrologueCallback callback)
 
void AddGCEpilogueCallback (GCEpilogueCallback callback, GCType gc_type_filter)
 
void RemoveGCEpilogueCallback (GCEpilogueCallback callback)
 
void SetGlobalGCPrologueCallback (GCCallback callback)
 
void SetGlobalGCEpilogueCallback (GCCallback callback)
 
Stringhidden_symbol ()
 
void set_native_contexts_list (Object *object)
 
Objectnative_contexts_list ()
 
unsigned int ms_count ()
 
void IterateRoots (ObjectVisitor *v, VisitMode mode)
 
void IterateStrongRoots (ObjectVisitor *v, VisitMode mode)
 
void IterateWeakRoots (ObjectVisitor *v, VisitMode mode)
 
void IterateAndMarkPointersToFromSpace (Address start, Address end, ObjectSlotCallback callback)
 
bool InNewSpace (Object *object)
 
bool InNewSpace (Address addr)
 
bool InNewSpacePage (Address addr)
 
bool InFromSpace (Object *object)
 
bool InToSpace (Object *object)
 
bool Contains (Address addr)
 
bool Contains (HeapObject *value)
 
bool InSpace (Address addr, AllocationSpace space)
 
bool InSpace (HeapObject *value, AllocationSpace space)
 
OldSpaceTargetSpace (HeapObject *object)
 
AllocationSpace TargetSpaceId (InstanceType type)
 
void public_set_code_stubs (UnseededNumberDictionary *value)
 
HeapObjectCallback GcSafeSizeOfOldObjectFunction ()
 
void public_set_non_monomorphic_cache (UnseededNumberDictionary *value)
 
void public_set_empty_script (Script *script)
 
void public_set_store_buffer_top (Address *top)
 
void SetLastScriptId (Object *last_script_id)
 
Object ** roots_array_start ()
 
Addressstore_buffer_top_address ()
 
Object ** native_contexts_list_address ()
 
void ZapFromSpace ()
 
void PrintShortHeapStatistics ()
 
MUST_USE_RESULT MaybeObject * CreateSymbol (const char *str, int length, int hash)
 
MUST_USE_RESULT MaybeObject * CreateSymbol (String *str)
 
void RecordWrite (Address address, int offset)
 
void RecordWrites (Address address, int start, int len)
 
ObjectFindCodeObject (Address a)
 
void Shrink ()
 
HeapState gc_state ()
 
bool IsInGCPostProcessing ()
 
void EnsureFromSpaceIsCommitted ()
 
void ReserveSpace (int *sizes, Address *addresses)
 
bool CreateApiObjects ()
 
ObjectGetNumberStringCache (Object *number)
 
void SetNumberStringCache (Object *number, String *str)
 
intptr_t AdjustAmountOfExternalAllocatedMemory (intptr_t change_in_bytes)
 
MUST_USE_RESULT MaybeObject * AllocateRawFixedArray (int length)
 
MUST_USE_RESULT MaybeObject * AllocateRawFixedArray (int length, PretenureFlag pretenure)
 
intptr_t PromotedTotalSize ()
 
bool OldGenerationPromotionLimitReached ()
 
intptr_t OldGenerationSpaceAvailable ()
 
intptr_t OldGenerationCapacityAvailable ()
 
intptr_t OldGenPromotionLimit (intptr_t old_gen_size)
 
intptr_t OldGenAllocationLimit (intptr_t old_gen_size)
 
bool IdleNotification (int hint)
 
 STATIC_CHECK (kUndefinedValueRootIndex==Internals::kUndefinedValueRootIndex)
 
 STATIC_CHECK (kNullValueRootIndex==Internals::kNullValueRootIndex)
 
 STATIC_CHECK (kTrueValueRootIndex==Internals::kTrueValueRootIndex)
 
 STATIC_CHECK (kFalseValueRootIndex==Internals::kFalseValueRootIndex)
 
 STATIC_CHECK (kempty_symbolRootIndex==Internals::kEmptySymbolRootIndex)
 
MUST_USE_RESULT MaybeObject * NumberToString (Object *number, bool check_number_string_cache=true)
 
MUST_USE_RESULT MaybeObject * Uint32ToString (uint32_t value, bool check_number_string_cache=true)
 
MapMapForExternalArrayType (ExternalArrayType array_type)
 
RootListIndex RootIndexForExternalArrayType (ExternalArrayType array_type)
 
void RecordStats (HeapStats *stats, bool take_snapshot=false)
 
void CheckNewSpaceExpansionCriteria ()
 
void IncrementYoungSurvivorsCounter (int survived)
 
bool NextGCIsLikelyToBeFull ()
 
void UpdateNewSpaceReferencesInExternalStringTable (ExternalStringTableUpdaterCallback updater_func)
 
void UpdateReferencesInExternalStringTable (ExternalStringTableUpdaterCallback updater_func)
 
void ProcessWeakReferences (WeakObjectRetainer *retainer)
 
void VisitExternalResources (v8::ExternalResourceVisitor *visitor)
 
bool ShouldBePromoted (Address old_address, int object_size)
 
int MaxObjectSizeInNewSpace ()
 
void ClearJSFunctionResultCaches ()
 
void ClearNormalizedMapCaches ()
 
GCTracertracer ()
 
intptr_t PromotedSpaceSizeOfObjects ()
 
double total_regexp_code_generated ()
 
void IncreaseTotalRegexpCodeGenerated (int size)
 
int get_max_gc_pause ()
 
intptr_t get_max_alive_after_gc ()
 
int get_min_in_mutator ()
 
MarkCompactCollectormark_compact_collector ()
 
StoreBufferstore_buffer ()
 
Markingmarking ()
 
IncrementalMarkingincremental_marking ()
 
bool IsSweepingComplete ()
 
bool AdvanceSweepers (int step_size)
 
ExternalStringTableexternal_string_table ()
 
int sweep_generation ()
 
Isolateisolate ()
 
void CallGlobalGCPrologueCallback ()
 
void CallGlobalGCEpilogueCallback ()
 
bool OldGenerationAllocationLimitReached ()
 
void DoScavengeObject (Map *map, HeapObject **slot, HeapObject *obj)
 
void QueueMemoryChunkForFree (MemoryChunk *chunk)
 
void FreeQueuedChunks ()
 
void CompletelyClearInstanceofCache ()
 
uint32_t HashSeed ()
 
void SetArgumentsAdaptorDeoptPCOffset (int pc_offset)
 
void SetConstructStubDeoptPCOffset (int pc_offset)
 
void SetGetterStubDeoptPCOffset (int pc_offset)
 
void SetSetterStubDeoptPCOffset (int pc_offset)
 
void RememberUnmappedPage (Address page, bool compacted)
 
int global_ic_age ()
 
void AgeInlineCaches ()
 
bool flush_monomorphic_ics ()
 
intptr_t amount_of_external_allocated_memory ()
 
void RecordObjectStats (InstanceType type, int sub_type, size_t size)
 
void CheckpointObjectStats ()
 

Static Public Member Functions

static bool ShouldZapGarbage ()
 
static void ScavengePointer (HeapObject **p)
 
static void ScavengeObject (HeapObject **p, HeapObject *object)
 
static void CopyBlock (Address dst, Address src, int byte_size)
 
static void MoveBlock (Address dst, Address src, int byte_size)
 

Static Public Attributes

static const int kArgumentsObjectSize
 
static const int kArgumentsObjectSizeStrict
 
static const int kArgumentsLengthIndex = 0
 
static const int kArgumentsCalleeIndex = 1
 
static const int kNoGCFlags = 0
 
static const int kSweepPreciselyMask = 1
 
static const int kReduceMemoryFootprintMask = 2
 
static const int kAbortIncrementalMarkingMask = 4
 
static const int kMakeHeapIterableMask
 
static const intptr_t kMinimumPromotionLimit = 5 * Page::kPageSize
 
static const intptr_t kMinimumAllocationLimit
 
static const int kOldSpaceRoots = 0x20
 

Friends

class Factory
 
class GCTracer
 
class DisallowAllocationFailure
 
class AlwaysAllocateScope
 
class Page
 
class Isolate
 
class MarkCompactCollector
 
class MarkCompactMarkingVisitor
 
class MapCompact
 

Detailed Description

Definition at line 441 of file heap.h.

Member Enumeration Documentation

anonymous enum
Enumerator
FIRST_CODE_KIND_SUB_TYPE 
FIRST_FIXED_ARRAY_SUB_TYPE 
OBJECT_STATS_COUNT 

Definition at line 1651 of file heap.h.

enum HeapState
Enumerator
NOT_IN_GC 
SCAVENGE 
MARK_COMPACT 

Definition at line 1325 of file heap.h.

Enumerator
kSymbolTableRootIndex 
kStrongRootListLength 
kRootListLength 

Definition at line 1426 of file heap.h.

Member Function Documentation

void AddGCEpilogueCallback ( GCEpilogueCallback  callback,
GCType  gc_type_filter 
)

Definition at line 6376 of file heap.cc.

References List< T, P >::Add(), ASSERT, List< T, P >::Contains(), and v8::internal::NULL.

Referenced by V8::AddGCEpilogueCallback().

void AddGCPrologueCallback ( GCPrologueCallback  callback,
GCType  gc_type_filter 
)

Definition at line 6356 of file heap.cc.

References List< T, P >::Add(), ASSERT, List< T, P >::Contains(), and v8::internal::NULL.

Referenced by V8::AddGCPrologueCallback().

intptr_t AdjustAmountOfExternalAllocatedMemory ( intptr_t  change_in_bytes)
inline
bool AdvanceSweepers ( int  step_size)
inline
void AgeInlineCaches ( )
inline

Definition at line 1638 of file heap.h.

References BitField< int, 22, 8 >::kMax.

Referenced by Heap::IdleNotification().

MaybeObject * AllocateAccessorPair ( )
MaybeObject * AllocateAliasedArgumentsEntry ( int  slot)
MaybeObject * AllocateCodeCache ( )
MUST_USE_RESULT MaybeObject* AllocateEmptyJSArray ( ElementsKind  elements_kind,
PretenureFlag  pretenure = NOT_TENURED 
)
inline
MaybeObject * AllocateExternalArray ( int  length,
ExternalArrayType  array_type,
void *  external_pointer,
PretenureFlag  pretenure 
)
MUST_USE_RESULT MaybeObject* AllocateExternalSymbol ( Vector< const char >  str,
int  chars 
)
MaybeObject * AllocateFixedDoubleArrayWithHoles ( int  length,
PretenureFlag  pretenure = NOT_TENURED 
)
MaybeObject * AllocateFunction ( Map function_map,
SharedFunctionInfo shared,
Object prototype,
PretenureFlag  pretenure = TENURED 
)
MaybeObject * AllocateHashTable ( int  length,
PretenureFlag  pretenure = NOT_TENURED 
)

Definition at line 4939 of file heap.cc.

References Heap::AllocateFixedArray(), and ASSERT.

MaybeObject * AllocateJSArrayWithElements ( FixedArrayBase array_base,
ElementsKind  elements_kind,
PretenureFlag  pretenure = NOT_TENURED 
)
MaybeObject * AllocateJSFunctionProxy ( Object handler,
Object call_trap,
Object construct_trap,
Object prototype 
)
MaybeObject * AllocateJSMessageObject ( String type,
JSArray arguments,
int  start_position,
int  end_position,
Object script,
Object stack_trace,
Object stack_frames 
)
MaybeObject * AllocateJSModule ( Context context,
ScopeInfo scope_info 
)
MaybeObject * AllocateModuleContext ( ScopeInfo scope_info)
MaybeObject * AllocateNativeContext ( )
MaybeObject * AllocatePartialMap ( InstanceType  instance_type,
int  instance_size 
)
MaybeObject * AllocatePolymorphicCodeCache ( )

Definition at line 2128 of file heap.cc.

References Heap::AllocateStruct(), and v8::internal::POLYMORPHIC_CODE_CACHE_TYPE.

MaybeObject * AllocateScopeInfo ( int  length)
MaybeObject * AllocateStringFromAscii ( Vector< const char >  str,
PretenureFlag  pretenure = NOT_TENURED 
)
MaybeObject * AllocateStringFromTwoByte ( Vector< const uc16 str,
PretenureFlag  pretenure = NOT_TENURED 
)
MaybeObject * AllocateStringFromUtf8 ( Vector< const char >  str,
PretenureFlag  pretenure = NOT_TENURED 
)
inline
MaybeObject * AllocateSymbol ( Vector< const char >  str,
int  chars,
uint32_t  hash_field 
)
inline
MaybeObject * AllocateUninitializedFixedArray ( int  length)
MaybeObject * AllocateUninitializedFixedDoubleArray ( int  length,
PretenureFlag  pretenure = NOT_TENURED 
)
bool always_allocate ( )
inline
Address always_allocate_scope_depth_address ( )
inline

Definition at line 532 of file heap.h.

intptr_t amount_of_external_allocated_memory ( )
inline

Definition at line 1644 of file heap.h.

Referenced by StatisticsExtension::GetCounters().

intptr_t Available ( )
void CallGlobalGCEpilogueCallback ( )
inline

Definition at line 1583 of file heap.h.

References v8::internal::NULL.

void CallGlobalGCPrologueCallback ( )
inline

Definition at line 1579 of file heap.h.

References v8::internal::NULL.

intptr_t Capacity ( )
void CheckNewSpaceExpansionCriteria ( )

Definition at line 1095 of file heap.cc.

References NewSpace::Capacity(), NewSpace::Grow(), and NewSpace::MaximumCapacity().

void ClearInstanceofCache ( )
inline

Definition at line 647 of file heap-inl.h.

Referenced by JSReceiver::SetPrototype().

bool CollectGarbage ( AllocationSpace  space,
const char *  gc_reason = NULL 
)
inline

Definition at line 433 of file heap-inl.h.

References Heap::CollectGarbage(), and v8::internal::NULL.

intptr_t CommittedMemoryExecutable ( )
void CompletelyClearInstanceofCache ( )
inline

Definition at line 657 of file heap-inl.h.

bool ConfigureHeapDefault ( )

Definition at line 5903 of file heap.cc.

References Heap::ConfigureHeap(), v8::internal::KB, and v8::internal::MB.

Referenced by Heap::SetUp(), and TEST().

bool Contains ( HeapObject value)

Definition at line 5362 of file heap.cc.

References HeapObject::address(), and Heap::Contains().

void CopyBlock ( Address  dst,
Address  src,
int  byte_size 
)
inlinestatic
MaybeObject * CopyFixedArray ( FixedArray src)
inline

Definition at line 176 of file heap-inl.h.

References Heap::CopyFixedArrayWithMap(), and HeapObject::map().

Referenced by FixedArray::Copy(), and Heap::CopyJSObject().

MaybeObject * CopyFixedDoubleArray ( FixedDoubleArray src)
inline
MUST_USE_RESULT MaybeObject* CreateSymbol ( const char *  str,
int  length,
int  hash 
)
MUST_USE_RESULT MaybeObject* CreateSymbol ( String str)
void decrement_scan_on_scavenge_pages ( )
inline

Definition at line 1123 of file heap.h.

References v8::internal::PrintF().

Referenced by MemoryChunk::set_scan_on_scavenge(), and MemoryChunk::Unlink().

void DoScavengeObject ( Map map,
HeapObject **  slot,
HeapObject obj 
)
inline

Definition at line 1589 of file heap.h.

References VisitorDispatchTable< Callback >::GetVisitor().

void EnsureFromSpaceIsCommitted ( )
void EnsureHeapIsIterable ( )
ExternalStringTable* external_string_table ( )
inline

Definition at line 1568 of file heap.h.

Referenced by String::MakeExternal(), and String::NewExternal().

void FinalizeExternalString ( String string)
inline
Object * FindCodeObject ( Address  a)

Definition at line 1029 of file heap.cc.

References Isolate::inner_pointer_to_code_cache(), and Heap::isolate().

bool flush_monomorphic_ics ( )
inline

Definition at line 1642 of file heap.h.

Referenced by StaticMarkingVisitor< StaticVisitor >::VisitCodeTarget().

HeapObjectCallback GcSafeSizeOfOldObjectFunction ( )
inline

Definition at line 1236 of file heap.h.

intptr_t get_max_alive_after_gc ( )
inline

Definition at line 1536 of file heap.h.

Referenced by Heap::TearDown().

int get_max_gc_pause ( )
inline

Definition at line 1533 of file heap.h.

Referenced by Heap::TearDown().

int get_min_in_mutator ( )
inline

Definition at line 1539 of file heap.h.

Referenced by Heap::TearDown().

Object * GetNumberStringCache ( Object number)

Definition at line 2969 of file heap.cc.

References Smi::cast(), String::cast(), and Object::Number().

Referenced by Heap::NumberToString().

uint32_t HashSeed ( )
inline

Definition at line 1603 of file heap.h.

References ASSERT, and seed.

Referenced by StringsStorage::GetName().

String* hidden_symbol ( )
inline

Definition at line 1184 of file heap.h.

Referenced by JSObject::AddFastProperty(), and Isolate::MayNamedAccess().

void IncreaseTotalRegexpCodeGenerated ( int  size)
inline

Definition at line 1528 of file heap.h.

Referenced by RegExpCompiler::Assemble().

void increment_scan_on_scavenge_pages ( )
inline

Definition at line 1116 of file heap.h.

References v8::internal::PrintF().

Referenced by MemoryChunk::set_scan_on_scavenge().

void IncrementYoungSurvivorsCounter ( int  survived)
inline

Definition at line 1473 of file heap.h.

References ASSERT.

int InitialSemiSpaceSize ( )
inline

Definition at line 476 of file heap.h.

Referenced by v8::internal::RUNTIME_FUNCTION(), and NewSpace::SetUp().

bool InNewSpace ( Address  addr)
inline

Definition at line 297 of file heap-inl.h.

References NewSpace::Contains().

bool InNewSpacePage ( Address  addr)
inline
bool InSpace ( HeapObject value,
AllocationSpace  space 
)

Definition at line 5380 of file heap.cc.

References HeapObject::address(), and Heap::InSpace().

bool InToSpace ( Object object)
inline

Definition at line 307 of file heap-inl.h.

References NewSpace::ToSpaceContains().

Referenced by Heap::InNewSpace(), and Heap::IterateAndMarkPointersToFromSpace().

bool IsHeapIterable ( )

Definition at line 5103 of file heap.cc.

References Heap::old_data_space(), and Heap::old_pointer_space().

Referenced by Heap::EnsureHeapIsIterable().

bool IsInGCPostProcessing ( )
inline

Definition at line 1328 of file heap.h.

Referenced by String::MakeExternal().

Isolate * isolate ( )
inline

Definition at line 503 of file heap-inl.h.

Referenced by IncrementalMarking::Abort(), JSObject::AddConstantFunctionProperty(), JSObject::AddFastProperty(), JSObject::AddProperty(), Heap::AdjustAmountOfExternalAllocatedMemory(), Heap::AllocateArgumentsObject(), Heap::AllocateConsString(), Heap::AllocateExternalStringFromAscii(), Heap::AllocateExternalStringFromTwoByte(), LargeObjectSpace::AllocateRaw(), RegExpCompiler::Assemble(), SharedFunctionInfo::AttachInitialMap(), SharedFunctionInfo::CanGenerateInlineConstructor(), Heap::CheckpointObjectStats(), Heap::CommittedMemoryExecutable(), StoreBuffer::Compact(), SharedFunctionInfo::CompleteInobjectSlackTracking(), SharedFunctionInfo::DetachInitialMap(), PagedSpace::Expand(), IncrementalMarking::Finalize(), Heap::FindCodeObject(), LargeObjectSpace::FreeUnmarkedObjects(), V8HeapExplorer::GetConstructorName(), Object::GetElementWithReceiver(), HeapObject::GetHeap(), HeapObject::GetIsolate(), Object::GetProperty(), JSObject::GetPropertyWithFailedAccessCheck(), Object::GetPrototype(), JSObject::HasElementWithReceiver(), JSObject::HasLocalElement(), JSObject::HasRealElementProperty(), JSObject::LookupAccessor(), IncrementalMarking::MarkingComplete(), JSObject::NormalizeElements(), JSObject::NormalizeProperties(), PagedSpace::PagedSpace(), IC::PostPatching(), IncrementalMarking::RecordCodeTargetPatch(), MarkCompactCollector::RecordCodeTargetPatch(), Heap::RecordStats(), JSObject::ReferencesObject(), Heap::ReinitializeJSReceiver(), PagedSpace::ReleasePage(), JSObject::SetElement(), JSObject::SetFastDoubleElementsCapacityAndLength(), JSObject::SetPropertyForResult(), JSReceiver::SetPrototype(), JSFunction::SetPrototype(), Heap::SetStackLimits(), Heap::SetUp(), NewSpace::SetUp(), SemiSpace::ShrinkTo(), SharedFunctionInfo::StartInobjectSlackTracking(), PagedSpace::TearDown(), NewSpace::TearDown(), LargeObjectSpace::TearDown(), String::ToCString(), ReplacementStringBuilder::ToString(), String::ToWideCString(), and MarkCompactMarkingVisitor::VisitUnmarkedObjects().

bool IsSweepingComplete ( )
inline
void IterateRoots ( ObjectVisitor *  v,
VisitMode  mode 
)
bool linear_allocation ( )
inline

Definition at line 535 of file heap.h.

MaybeObject * LookupAsciiSymbol ( Vector< const char >  str)
MUST_USE_RESULT MaybeObject* LookupAsciiSymbol ( const char *  str)
inline

Definition at line 1035 of file heap.h.

References v8::internal::CStrVector(), and Heap::LookupSymbol().

MaybeObject * LookupAsciiSymbol ( Handle< SeqAsciiString string,
int  from,
int  length 
)

Definition at line 5464 of file heap.cc.

References ASSERT, Heap::kSymbolTableRootIndex, and v8::internal::NULL.

MaybeObject * LookupSymbol ( String str)

Definition at line 5499 of file heap.cc.

References ASSERT, Heap::kSymbolTableRootIndex, and v8::internal::NULL.

bool LookupSymbolIfExists ( String str,
String **  symbol 
)

Definition at line 5515 of file heap.cc.

MaybeObject * LookupTwoByteSymbol ( Vector< const uc16 str)

Definition at line 5484 of file heap.cc.

References ASSERT, Heap::kSymbolTableRootIndex, and v8::internal::NULL.

bool LookupTwoCharsSymbolIfExists ( String str,
String **  symbol 
)
Map * MapForExternalArrayType ( ExternalArrayType  array_type)

Definition at line 3048 of file heap.cc.

References Map::cast(), and Heap::RootIndexForExternalArrayType().

Referenced by Heap::AllocateExternalArray().

Marking* marking ( )
inline

Definition at line 1549 of file heap.h.

intptr_t MaxExecutableSize ( )
inline

Definition at line 478 of file heap.h.

Referenced by Heap::SetUp(), and TEST().

int MaxObjectSizeInNewSpace ( )
inline

Definition at line 1516 of file heap.h.

intptr_t MaxOldGenerationSize ( )
inline

Definition at line 477 of file heap.h.

Referenced by TEST().

intptr_t MaxReserved ( )
inline

Definition at line 471 of file heap.h.

Referenced by V8::GetHeapStatistics(), Heap::SetUp(), and TEST().

int MaxSemiSpaceSize ( )
inline

Definition at line 474 of file heap.h.

Referenced by IncrementalMarking::Step().

void MoveBlock ( Address  dst,
Address  src,
int  byte_size 
)
inlinestatic
unsigned int ms_count ( )
inline

Definition at line 1192 of file heap.h.

Referenced by MarkCompactCollector::CollectEvacuationCandidates().

Object* native_contexts_list ( )
inline

Definition at line 1189 of file heap.h.

Referenced by Context::AddOptimizedFunction(), and IncrementalMarking::Hurry().

Object** native_contexts_list_address ( )
inline

Definition at line 1264 of file heap.h.

Address* NewSpaceAllocationLimitAddress ( )
inline

Definition at line 542 of file heap.h.

References NewSpace::allocation_limit_address().

Address* NewSpaceAllocationTopAddress ( )
inline

Definition at line 539 of file heap.h.

References NewSpace::allocation_top_address().

uintptr_t NewSpaceMask ( )
inline

Definition at line 502 of file heap.h.

References NewSpace::mask().

Address NewSpaceStart ( )
inline

Definition at line 501 of file heap.h.

References NewSpace::start().

Address NewSpaceTop ( )
inline

Definition at line 503 of file heap.h.

References NewSpace::top().

Referenced by StringTracker::IsFreshUnusedString(), and StringTracker::RecordWrite().

bool NextGCIsLikelyToBeFull ( )
inline
int NotifyContextDisposed ( )
inline

Definition at line 1107 of file heap.h.

Referenced by V8::ContextDisposedNotification().

MaybeObject * NumberFromInt32 ( int32_t  value,
PretenureFlag  pretenure = NOT_TENURED 
)
inline
intptr_t OldGenAllocationLimit ( intptr_t  old_gen_size)
inline
bool OldGenerationAllocationLimitReached ( )
inline

Definition at line 312 of file heap-inl.h.

References Heap::incremental_marking(), and Heap::OldGenerationSpaceAvailable().

intptr_t OldGenerationCapacityAvailable ( )
inline

Definition at line 1394 of file heap.h.

References Heap::PromotedTotalSize().

Referenced by LargeObjectSpace::ReserveSpace().

bool OldGenerationPromotionLimitReached ( )
inline

Definition at line 1386 of file heap.h.

References Heap::PromotedTotalSize().

intptr_t OldGenerationSpaceAvailable ( )
inline
intptr_t OldGenPromotionLimit ( intptr_t  old_gen_size)
inline
MaybeObject * PrepareForCompare ( String str)
inline

Definition at line 440 of file heap-inl.h.

References v8::internal::KB, String::length(), and String::TryFlatten().

PromotionQueue* promotion_queue ( )
inline

Definition at line 1130 of file heap.h.

Referenced by NewSpace::AddFreshPage().

void public_set_code_stubs ( UnseededNumberDictionary value)
inline

Definition at line 1229 of file heap.h.

void public_set_empty_script ( Script script)
inline

Definition at line 1245 of file heap.h.

void public_set_non_monomorphic_cache ( UnseededNumberDictionary value)
inline

Definition at line 1241 of file heap.h.

void public_set_store_buffer_top ( Address top)
inline
void QueueMemoryChunkForFree ( MemoryChunk chunk)
void RecordWrite ( Address  address,
int  offset 
)
inline

Definition at line 331 of file heap-inl.h.

References Heap::InNewSpace(), and StoreBuffer::Mark().

Referenced by FixedArray::NoIncrementalWriteBarrierSet().

void RecordWrites ( Address  address,
int  start,
int  len 
)
inline
MaybeObject * ReinitializeJSGlobalProxy ( JSFunction constructor,
JSGlobalProxy global 
)
void RememberUnmappedPage ( Address  page,
bool  compacted 
)

Definition at line 7274 of file heap.cc.

References Page::kPageSize.

Referenced by MemoryAllocator::Free().

void RemoveGCEpilogueCallback ( GCEpilogueCallback  callback)

Definition at line 6384 of file heap.cc.

References ASSERT, v8::internal::NULL, List< T, P >::Remove(), and UNREACHABLE.

Referenced by V8::RemoveGCEpilogueCallback().

void RemoveGCPrologueCallback ( GCPrologueCallback  callback)

Definition at line 6364 of file heap.cc.

References ASSERT, v8::internal::NULL, List< T, P >::Remove(), and UNREACHABLE.

Referenced by V8::RemoveGCPrologueCallback().

void RepairFreeListsAfterBoot ( )

Definition at line 439 of file heap.cc.

References v8::internal::NULL.

Referenced by Deserializer::Deserialize().

int ReservedSemiSpaceSize ( )
inline

Definition at line 475 of file heap.h.

Object** roots_array_start ( )
inline

Definition at line 1257 of file heap.h.

Referenced by Serializer::RootIndex(), and Serializer::VisitPointers().

void ScavengeObject ( HeapObject **  p,
HeapObject object 
)
inlinestatic

Definition at line 410 of file heap-inl.h.

References ASSERT, and HEAP.

Referenced by Heap::ScavengePointer(), and NewSpaceScavenger::VisitPointer().

void ScavengePointer ( HeapObject **  p)
inlinestatic

Definition at line 405 of file heap-inl.h.

References Heap::ScavengeObject().

void set_native_contexts_list ( Object object)
inline

Definition at line 1186 of file heap.h.

Referenced by Deserializer::Deserialize().

void SetArgumentsAdaptorDeoptPCOffset ( int  pc_offset)
inline

Definition at line 1609 of file heap.h.

References ASSERT, and Smi::FromInt().

void SetConstructStubDeoptPCOffset ( int  pc_offset)
inline

Definition at line 1614 of file heap.h.

References ASSERT, and Smi::FromInt().

void SetGetterStubDeoptPCOffset ( int  pc_offset)
inline

Definition at line 1619 of file heap.h.

References ASSERT, and Smi::FromInt().

void SetGlobalGCEpilogueCallback ( GCCallback  callback)
inline

Definition at line 1149 of file heap.h.

References ASSERT, and v8::internal::NULL.

Referenced by V8::SetGlobalGCEpilogueCallback().

void SetGlobalGCPrologueCallback ( GCCallback  callback)
inline

Definition at line 1145 of file heap.h.

References ASSERT, and v8::internal::NULL.

Referenced by V8::SetGlobalGCPrologueCallback().

void SetLastScriptId ( Object last_script_id)
inline

Definition at line 498 of file heap-inl.h.

Referenced by Factory::NewScript().

void SetNumberStringCache ( Object number,
String str 
)

Definition at line 2989 of file heap.cc.

References Smi::cast(), and Object::Number().

Referenced by Heap::NumberToString().

void SetSetterStubDeoptPCOffset ( int  pc_offset)
inline

Definition at line 1624 of file heap.h.

References ASSERT, and Smi::FromInt().

void Shrink ( )

Definition at line 6345 of file heap.cc.

References v8::internal::NULL.

Referenced by Heap::CollectAllAvailableGarbage(), and Heap::EnsureFromSpaceIsCommitted().

intptr_t SizeOfObjects ( )
STATIC_CHECK ( kUndefinedValueRootIndex  = =Internals::kUndefinedValueRootIndex)
STATIC_CHECK ( kNullValueRootIndex  = =Internals::kNullValueRootIndex)
STATIC_CHECK ( kTrueValueRootIndex  = =Internals::kTrueValueRootIndex)
STATIC_CHECK ( kFalseValueRootIndex  = =Internals::kFalseValueRootIndex)
STATIC_CHECK ( kempty_symbolRootIndex  = =Internals::kEmptySymbolRootIndex)
Address* store_buffer_top_address ( )
inline

Definition at line 1259 of file heap.h.

Referenced by StoreBuffer::TopAddress().

int sweep_generation ( )
inline

Definition at line 1573 of file heap.h.

OldSpace * TargetSpace ( HeapObject object)
inline
Object * ToBoolean ( bool  condition)
inline

Definition at line 652 of file heap-inl.h.

Referenced by v8::internal::RUNTIME_FUNCTION(), and Object::ToBoolean().

double total_regexp_code_generated ( )
inline

Definition at line 1527 of file heap.h.

Referenced by RegExpCompiler::Assemble().

GCTracer* tracer ( )
inline

Definition at line 1522 of file heap.h.

Referenced by Heap::CollectGarbage(), and Heap::PerformScavenge().

MaybeObject * Uint32ToString ( uint32_t  value,
bool  check_number_string_cache = true 
)
bool UncommitFromSpace ( )
inline

Definition at line 547 of file heap.h.

References NewSpace::UncommitFromSpace().

Referenced by Heap::CollectAllAvailableGarbage().

void UpdateNewSpaceReferencesInExternalStringTable ( ExternalStringTableUpdaterCallback  updater_func)
void UpdateReferencesInExternalStringTable ( ExternalStringTableUpdaterCallback  updater_func)

Definition at line 1404 of file heap.cc.

References Heap::UpdateNewSpaceReferencesInExternalStringTable().

void VisitExternalResources ( v8::ExternalResourceVisitor visitor)

Definition at line 1548 of file heap.cc.

References String::cast(), ExternalStringTable::Iterate(), and Utils::ToLocal().

Referenced by V8::VisitExternalResources().

Friends And Related Function Documentation

friend class AlwaysAllocateScope
friend

Definition at line 2160 of file heap.h.

friend class DisallowAllocationFailure
friend

Definition at line 2159 of file heap.h.

friend class Factory
friend

Definition at line 2157 of file heap.h.

friend class GCTracer
friend

Definition at line 2158 of file heap.h.

Referenced by Heap::CollectGarbage(), and Heap::PerformScavenge().

friend class Isolate
friend

Definition at line 2162 of file heap.h.

friend class MapCompact
friend

Definition at line 2165 of file heap.h.

friend class MarkCompactCollector
friend

Definition at line 2163 of file heap.h.

friend class MarkCompactMarkingVisitor
friend

Definition at line 2164 of file heap.h.

friend class Page
friend

Definition at line 2161 of file heap.h.

Field Documentation

const int kAbortIncrementalMarkingMask = 4
static
const int kArgumentsCalleeIndex = 1
static

Definition at line 903 of file heap.h.

Referenced by Heap::AllocateArgumentsObject().

const int kArgumentsLengthIndex = 0
static

Definition at line 901 of file heap.h.

Referenced by Heap::AllocateArgumentsObject(), and v8::internal::BUILTIN().

const int kArgumentsObjectSize
static
Initial value:

Definition at line 895 of file heap.h.

Referenced by Heap::AllocateArgumentsObject().

const int kArgumentsObjectSizeStrict
static
Initial value:

Definition at line 898 of file heap.h.

Referenced by Heap::AllocateArgumentsObject().

const intptr_t kMinimumAllocationLimit
static
Initial value:

Definition at line 1399 of file heap.h.

Referenced by Heap::OldGenAllocationLimit().

const intptr_t kMinimumPromotionLimit = 5 * Page::kPageSize
static

Definition at line 1398 of file heap.h.

Referenced by Heap::OldGenPromotionLimit().

const int kOldSpaceRoots = 0x20
static

Definition at line 1601 of file heap.h.

const int kReduceMemoryFootprintMask = 2
static
const int kSweepPreciselyMask = 1
static

Definition at line 1082 of file heap.h.

Referenced by MarkCompactCollector::SetFlags().


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