v8  3.11.10(node0.8.26)
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>

Public Types

enum  HeapState { NOT_IN_GC, SCAVENGE, MARK_COMPACT }
 
enum  RootListIndex { kSymbolTableRootIndex, kStrongRootListLength = kSymbolTableRootIndex, kRootListLength }
 

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 ()
 
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 ()
 
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 ()
 
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, 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 * AllocateGlobalContext ()
 
MUST_USE_RESULT MaybeObject * AllocateModuleContext (Context *previous, 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 (GCEpilogueCallback callback, GCType gc_type_filter)
 
void RemoveGCPrologueCallback (GCEpilogueCallback 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_global_contexts_list (Object *object)
 
Objectglobal_contexts_list ()
 
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 ** global_contexts_list_address ()
 
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 new_space_size, int pointer_space_size, int data_space_size, int code_space_size, int map_space_size, int cell_space_size, int large_object_size)
 
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 ()
 
void ClearCacheOnMap (Map *map)
 
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 RememberUnmappedPage (Address page, bool compacted)
 
int global_ic_age ()
 
void AgeInlineCaches ()
 

Static Public Member Functions

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 LinearAllocationScope
 
class Page
 
class Isolate
 
class MarkCompactCollector
 
class StaticMarkingVisitor
 
class MapCompact
 

Detailed Description

Definition at line 435 of file heap.h.

Member Enumeration Documentation

enum HeapState
Enumerator
NOT_IN_GC 
SCAVENGE 
MARK_COMPACT 

Definition at line 1279 of file heap.h.

Enumerator
kSymbolTableRootIndex 
kStrongRootListLength 
kRootListLength 

Definition at line 1390 of file heap.h.

Member Function Documentation

void AddGCEpilogueCallback ( GCEpilogueCallback  callback,
GCType  gc_type_filter 
)

Definition at line 6259 of file heap.cc.

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

Referenced by V8::AddGCEpilogueCallback().

void AddGCPrologueCallback ( GCEpilogueCallback  callback,
GCType  gc_type_filter 
)

Definition at line 6239 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 1599 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 * AllocateGlobalContext ( )
MaybeObject * AllocateHashTable ( int  length,
PretenureFlag  pretenure = NOT_TENURED 
)

Definition at line 4832 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 ( )
MaybeObject * AllocatePartialMap ( InstanceType  instance_type,
int  instance_size 
)

Definition at line 1989 of file heap.cc.

References StaticVisitorBase::GetVisitorId().

MaybeObject * AllocatePolymorphicCodeCache ( )

Definition at line 2058 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 508 of file heap.h.

intptr_t Available ( )

Definition at line 216 of file heap.cc.

References PagedSpace::Available(), NewSpace::Available(), and Heap::HasBeenSetUp().

Referenced by Heap::SetUp().

void CallGlobalGCEpilogueCallback ( )
inline

Definition at line 1554 of file heap.h.

References v8::internal::NULL.

void CallGlobalGCPrologueCallback ( )
inline

Definition at line 1550 of file heap.h.

References v8::internal::NULL.

intptr_t Capacity ( )
void CheckNewSpaceExpansionCriteria ( )

Definition at line 1027 of file heap.cc.

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

void ClearCacheOnMap ( Map map)
inline

Definition at line 1487 of file heap.h.

References Map::ClearCodeCache().

Referenced by IncrementalMarking::Hurry(), and IncrementalMarking::Step().

void ClearInstanceofCache ( )
inline

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

Referenced by JSReceiver::SetPrototype().

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

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

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

intptr_t CommittedMemory ( )
intptr_t CommittedMemoryExecutable ( )
void CompletelyClearInstanceofCache ( )
inline

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

bool ConfigureHeapDefault ( )

Definition at line 5792 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 5219 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 173 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 1088 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 1560 of file heap.h.

References VisitorDispatchTable< Callback >::GetVisitor().

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

Definition at line 1539 of file heap.h.

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

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

Definition at line 961 of file heap.cc.

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

HeapObjectCallback GcSafeSizeOfOldObjectFunction ( )
inline

Definition at line 1201 of file heap.h.

intptr_t get_max_alive_after_gc ( )
inline

Definition at line 1507 of file heap.h.

Referenced by Heap::TearDown().

int get_max_gc_pause ( )
inline

Definition at line 1504 of file heap.h.

Referenced by Heap::TearDown().

int get_min_in_mutator ( )
inline

Definition at line 1510 of file heap.h.

Referenced by Heap::TearDown().

Object * GetNumberStringCache ( Object number)

Definition at line 2859 of file heap.cc.

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

Referenced by Heap::NumberToString().

Object* global_contexts_list ( )
inline

Definition at line 1154 of file heap.h.

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

Object** global_contexts_list_address ( )
inline

Definition at line 1229 of file heap.h.

uint32_t HashSeed ( )
inline

Definition at line 1574 of file heap.h.

References ASSERT, and seed.

Referenced by StringsStorage::GetName().

String* hidden_symbol ( )
inline

Definition at line 1149 of file heap.h.

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

void IncreaseTotalRegexpCodeGenerated ( int  size)
inline

Definition at line 1499 of file heap.h.

Referenced by RegExpCompiler::Assemble().

void increment_scan_on_scavenge_pages ( )
inline

Definition at line 1081 of file heap.h.

References v8::internal::PrintF().

Referenced by MemoryChunk::set_scan_on_scavenge().

void IncrementYoungSurvivorsCounter ( int  survived)
inline

Definition at line 1437 of file heap.h.

References ASSERT.

int InitialSemiSpaceSize ( )
inline

Definition at line 470 of file heap.h.

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

bool InNewSpace ( Address  addr)
inline

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

References NewSpace::Contains().

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

Definition at line 5237 of file heap.cc.

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

bool InToSpace ( Object object)
inline

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

References NewSpace::ToSpaceContains().

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

bool IsHeapIterable ( )

Definition at line 4979 of file heap.cc.

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

Referenced by Heap::EnsureHeapIsIterable().

bool IsInGCPostProcessing ( )
inline

Definition at line 1282 of file heap.h.

Referenced by String::MakeExternal().

Isolate * isolate ( )
inline

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

Referenced by IncrementalMarking::Abort(), JSObject::AddConstantFunctionProperty(), JSObject::AddFastProperty(), JSObject::AddProperty(), Heap::AllocateArgumentsObject(), Heap::AllocateConsString(), Heap::AllocateExternalStringFromAscii(), Heap::AllocateExternalStringFromTwoByte(), LargeObjectSpace::AllocateRaw(), RegExpCompiler::Assemble(), SharedFunctionInfo::AttachInitialMap(), SharedFunctionInfo::CanGenerateInlineConstructor(), 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(), Map::LookupInDescriptors(), IncrementalMarking::MarkingComplete(), JSObject::NormalizeElements(), JSObject::NormalizeProperties(), PagedSpace::PagedSpace(), IC::PostPatching(), MarkCompactCollector::Prepare(), IncrementalMarking::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 StaticMarkingVisitor::VisitUnmarkedObjects().

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

Definition at line 511 of file heap.h.

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

Definition at line 1003 of file heap.h.

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

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

Definition at line 5351 of file heap.cc.

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

MaybeObject * LookupSingleCharacterStringFromCode ( uint16_t  code)
MaybeObject * LookupSymbol ( String str)

Definition at line 5386 of file heap.cc.

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

bool LookupSymbolIfExists ( String str,
String **  symbol 
)

Definition at line 5402 of file heap.cc.

MaybeObject * LookupTwoByteSymbol ( Vector< const uc16 str)

Definition at line 5371 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 2938 of file heap.cc.

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

Referenced by Heap::AllocateExternalArray().

Marking* marking ( )
inline

Definition at line 1520 of file heap.h.

intptr_t MaxExecutableSize ( )
inline

Definition at line 472 of file heap.h.

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

int MaxObjectSizeInNewSpace ( )
inline

Definition at line 1480 of file heap.h.

intptr_t MaxOldGenerationSize ( )
inline

Definition at line 471 of file heap.h.

Referenced by TEST().

intptr_t MaxReserved ( )
inline

Definition at line 465 of file heap.h.

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

int MaxSemiSpaceSize ( )
inline

Definition at line 468 of file heap.h.

Referenced by IncrementalMarking::Step().

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

Definition at line 1157 of file heap.h.

Referenced by MarkCompactCollector::CollectEvacuationCandidates().

Address* NewSpaceAllocationLimitAddress ( )
inline

Definition at line 518 of file heap.h.

References NewSpace::allocation_limit_address().

Address* NewSpaceAllocationTopAddress ( )
inline

Definition at line 515 of file heap.h.

References NewSpace::allocation_top_address().

uintptr_t NewSpaceMask ( )
inline

Definition at line 496 of file heap.h.

References NewSpace::mask().

Address NewSpaceStart ( )
inline

Definition at line 495 of file heap.h.

References NewSpace::start().

Address NewSpaceTop ( )
inline

Definition at line 497 of file heap.h.

References NewSpace::top().

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

bool NextGCIsLikelyToBeFull ( )
inline
int NotifyContextDisposed ( )
inline

Definition at line 1075 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 316 of file heap-inl.h.

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

intptr_t OldGenerationCapacityAvailable ( )
inline

Definition at line 1358 of file heap.h.

References Heap::PromotedTotalSize().

Referenced by LargeObjectSpace::ReserveSpace().

bool OldGenerationPromotionLimitReached ( )
inline

Definition at line 1350 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 444 of file heap-inl.h.

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

PromotionQueue* promotion_queue ( )
inline

Definition at line 1095 of file heap.h.

Referenced by NewSpace::AddFreshPage().

void public_set_code_stubs ( UnseededNumberDictionary value)
inline

Definition at line 1194 of file heap.h.

void public_set_empty_script ( Script script)
inline

Definition at line 1210 of file heap.h.

void public_set_non_monomorphic_cache ( UnseededNumberDictionary value)
inline

Definition at line 1206 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 335 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 7147 of file heap.cc.

References Page::kPageSize.

Referenced by MemoryAllocator::Free().

void RemoveGCEpilogueCallback ( GCEpilogueCallback  callback)

Definition at line 6267 of file heap.cc.

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

Referenced by V8::RemoveGCEpilogueCallback().

void RemoveGCPrologueCallback ( GCEpilogueCallback  callback)

Definition at line 6247 of file heap.cc.

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

Referenced by V8::RemoveGCPrologueCallback().

int ReservedSemiSpaceSize ( )
inline

Definition at line 469 of file heap.h.

Object** roots_array_start ( )
inline

Definition at line 1222 of file heap.h.

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

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

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

References ASSERT, and HEAP.

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

void ScavengePointer ( HeapObject **  p)
inlinestatic

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

References Heap::ScavengeObject().

void set_global_contexts_list ( Object object)
inline

Definition at line 1151 of file heap.h.

Referenced by Deserializer::Deserialize().

void SetArgumentsAdaptorDeoptPCOffset ( int  pc_offset)
inline

Definition at line 1580 of file heap.h.

References ASSERT, and Smi::FromInt().

void SetConstructStubDeoptPCOffset ( int  pc_offset)
inline

Definition at line 1585 of file heap.h.

References ASSERT, and Smi::FromInt().

void SetGlobalGCEpilogueCallback ( GCCallback  callback)
inline

Definition at line 1114 of file heap.h.

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

Referenced by V8::SetGlobalGCEpilogueCallback().

void SetGlobalGCPrologueCallback ( GCCallback  callback)
inline

Definition at line 1110 of file heap.h.

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

Referenced by V8::SetGlobalGCPrologueCallback().

void SetLastScriptId ( Object last_script_id)
inline

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

Referenced by Factory::NewScript().

void SetNumberStringCache ( Object number,
String str 
)

Definition at line 2879 of file heap.cc.

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

Referenced by Heap::NumberToString().

void Shrink ( )

Definition at line 6228 of file heap.cc.

References v8::internal::NULL.

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

intptr_t SizeOfObjects ( )

Definition at line 410 of file heap.cc.

References v8::internal::NULL.

Referenced by Heap::GarbageCollectionEpilogue(), and V8::GetHeapStatistics().

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 1224 of file heap.h.

Referenced by StoreBuffer::TopAddress().

int sweep_generation ( )
inline

Definition at line 1544 of file heap.h.

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

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

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

double total_regexp_code_generated ( )
inline

Definition at line 1498 of file heap.h.

Referenced by RegExpCompiler::Assemble().

GCTracer* tracer ( )
inline

Definition at line 1493 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 523 of file heap.h.

References NewSpace::UncommitFromSpace().

Referenced by Heap::CollectAllAvailableGarbage().

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

Definition at line 1332 of file heap.cc.

References Heap::UpdateNewSpaceReferencesInExternalStringTable().

void VisitExternalResources ( v8::ExternalResourceVisitor visitor)

Definition at line 1476 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 2051 of file heap.h.

friend class DisallowAllocationFailure
friend

Definition at line 2050 of file heap.h.

friend class Factory
friend

Definition at line 2048 of file heap.h.

friend class GCTracer
friend

Definition at line 2049 of file heap.h.

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

friend class Isolate
friend

Definition at line 2054 of file heap.h.

friend class LinearAllocationScope
friend

Definition at line 2052 of file heap.h.

friend class MapCompact
friend

Definition at line 2057 of file heap.h.

friend class MarkCompactCollector
friend

Definition at line 2055 of file heap.h.

friend class Page
friend

Definition at line 2053 of file heap.h.

friend class StaticMarkingVisitor
friend

Definition at line 2056 of file heap.h.

Field Documentation

const int kAbortIncrementalMarkingMask = 4
static

Definition at line 1052 of file heap.h.

Referenced by MarkCompactCollector::SetFlags(), TEST(), and THREADED_TEST().

const int kArgumentsCalleeIndex = 1
static

Definition at line 871 of file heap.h.

Referenced by Heap::AllocateArgumentsObject().

const int kArgumentsLengthIndex = 0
static

Definition at line 869 of file heap.h.

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

const int kArgumentsObjectSize
static
Initial value:

Definition at line 863 of file heap.h.

Referenced by Heap::AllocateArgumentsObject().

const int kArgumentsObjectSizeStrict
static
Initial value:

Definition at line 866 of file heap.h.

Referenced by Heap::AllocateArgumentsObject().

const intptr_t kMinimumAllocationLimit
static
Initial value:

Definition at line 1363 of file heap.h.

Referenced by Heap::OldGenAllocationLimit().

const intptr_t kMinimumPromotionLimit = 5 * Page::kPageSize
static

Definition at line 1362 of file heap.h.

Referenced by Heap::OldGenPromotionLimit().

const int kOldSpaceRoots = 0x20
static

Definition at line 1572 of file heap.h.

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

Definition at line 1050 of file heap.h.

Referenced by MarkCompactCollector::SetFlags().


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