Lines Matching defs:Heap
38 #include "heap-profiler.h"
66 Heap::Heap()
140 previous_survival_rate_trend_(Heap::STABLE),
141 survival_rate_trend_(Heap::STABLE),
183 intptr_t Heap::Capacity() {
195 intptr_t Heap::CommittedMemory() {
207 intptr_t Heap::CommittedMemoryExecutable() {
214 intptr_t Heap::Available() {
226 bool Heap::HasBeenSetUp() {
236 int Heap::GcSafeSizeOfOldObject(HeapObject* object) {
244 GarbageCollector Heap::SelectGarbageCollector(AllocationSpace space,
290 // TODO(1238405): Combine the infrastructure for --heap-stats and
292 void Heap::ReportStatisticsBeforeGC() {
293 // Heap::ReportHeapStatistics will also log NewSpace statistics when
314 void Heap::PrintShortHeapStatistics() {
322 Heap::new_space_.Size(),
361 // TODO(1238405): Combine the infrastructure for --heap-stats and
363 void Heap::ReportStatisticsAfterGC() {
379 void Heap::GarbageCollectionPrologue() {
403 intptr_t Heap::SizeOfObjects() {
412 void Heap::GarbageCollectionEpilogue() {
445 void Heap::CollectAllGarbage(int flags, const char* gc_reason) {
455 void Heap::CollectAllAvailableGarbage(const char* gc_reason) {
484 bool Heap::CollectGarbage(AllocationSpace space,
557 void Heap::PerformScavenge() {
587 HEAP->symbol_table()->IterateElements(&verifier);
593 Heap* heap,
596 heap->mark_compact_collector()->SetFlags(Heap::kAbortIncrementalMarkingMask);
597 bool result = heap->CollectGarbage(space, gc_reason);
598 heap->mark_compact_collector()->SetFlags(Heap::kNoGCFlags);
603 void Heap::ReserveSpace(
611 NewSpace* new_space = Heap::new_space();
612 PagedSpace* old_pointer_space = Heap::old_pointer_space();
613 PagedSpace* old_data_space = Heap::old_data_space();
614 PagedSpace* code_space = Heap::code_space();
615 PagedSpace* map_space = Heap::map_space();
616 PagedSpace* cell_space = Heap::cell_space();
617 LargeObjectSpace* lo_space = Heap::lo_space();
624 Heap::CollectGarbage(NEW_SPACE,
670 V8::FatalProcessOutOfMemory("Heap::ReserveSpace");
675 void Heap::EnsureFromSpaceIsCommitted() {
689 void Heap::ClearJSFunctionResultCaches() {
713 void Heap::ClearNormalizedMapCaches() {
733 void Heap::UpdateSurvivalRateTrend(int start_new_space_size) {
763 bool Heap::PerformGarbageCollection(GarbageCollector collector,
791 int start_new_space_size = Heap::new_space()->SizeAsInt();
908 void Heap::MarkCompact(GCTracer* tracer) {
933 void Heap::MarkCompactPrologue() {
954 Object* Heap::FindCodeObject(Address a) {
963 explicit ScavengeVisitor(Heap* heap) : heap_(heap) {}
976 Heap::ScavengeObject(reinterpret_cast<HeapObject**>(p),
980 Heap* heap_;
992 ASSERT(!HEAP->InNewSpace(HeapObject::cast(*current)));
1003 HeapObjectIterator code_it(HEAP->code_space());
1010 if (!HEAP->old_data_space()->was_swept_conservatively()) {
1011 HeapObjectIterator data_it(HEAP->old_data_space());
1020 void Heap::CheckNewSpaceExpansionCriteria() {
1033 static bool IsUnscavengedHeapObject(Heap* heap, Object** p) {
1034 return heap->InNewSpace(*p) &&
1039 void Heap::ScavengeStoreBufferCallback(
1040 Heap* heap,
1043 heap->store_buffer_rebuilder_.Callback(page, event);
1133 void Heap::Scavenge() {
1251 String* Heap::UpdateNewSpaceReferenceInExternalStringTableEntry(Heap* heap,
1257 heap->FinalizeExternalString(String::cast(*p));
1266 void Heap::UpdateNewSpaceReferencesInExternalStringTable(
1301 void Heap::UpdateReferencesInExternalStringTable(
1315 static Object* ProcessFunctionWeakReferences(Heap* heap,
1318 Object* undefined = heap->undefined_value();
1357 void Heap::ProcessWeakReferences(WeakObjectRetainer* retainer) {
1404 Heap::undefined_value(),
1413 void Heap::VisitExternalResources(v8::ExternalResourceVisitor* visitor) {
1437 static inline void VisitPointer(Heap* heap, Object** p) {
1439 if (!heap->InNewSpace(object)) return;
1440 Heap::ScavengeObject(reinterpret_cast<HeapObject**>(p),
1446 Address Heap::DoScavenge(ObjectVisitor* scavenge_visitor,
1567 static void RecordCopiedObject(Heap* heap, HeapObject* obj) {
1574 if (heap->new_space()->Contains(obj)) {
1575 heap->new_space()->RecordAllocation(obj);
1577 heap->new_space()->RecordPromotion(obj);
1585 INLINE(static void MigrateObject(Heap* heap,
1590 heap->CopyBlock(target->address(), source->address(), size);
1597 RecordCopiedObject(heap, target);
1598 HEAP_PROFILE(heap, ObjectMoveEvent(source->address(), target->address()));
1599 Isolate* isolate = heap->isolate();
1625 Heap* heap = map->GetHeap();
1626 if (heap->ShouldBePromoted(object->address(), object_size)) {
1631 maybe_result = heap->lo_space()->AllocateRaw(object_size,
1635 maybe_result = heap->old_data_space()->AllocateRaw(object_size);
1637 maybe_result = heap->old_pointer_space()->AllocateRaw(object_size);
1649 MigrateObject(heap, object, target, object_size);
1652 heap->promotion_queue()->insert(target, object_size);
1655 heap->tracer()->increment_promoted_objects_size(object_size);
1659 MaybeObject* allocation = heap->new_space()->AllocateRaw(object_size);
1660 heap->promotion_queue()->SetNewLimit(heap->new_space()->top());
1668 MigrateObject(heap, object, target, object_size);
1753 Heap* heap = map->GetHeap();
1757 heap->empty_string()) {
1763 if (!heap->InNewSpace(first)) {
1777 heap->DoScavengeObject(first->map(), slot, first);
1824 void Heap::SelectScavengingVisitorsTable() {
1866 void Heap::ScavengeObjectSlow(HeapObject** p, HeapObject* object) {
1867 SLOW_ASSERT(HEAP->InFromSpace(object));
1875 MaybeObject* Heap::AllocatePartialMap(InstanceType instance_type,
1897 MaybeObject* Heap
1933 MaybeObject* Heap::AllocateCodeCache() {
1944 MaybeObject* Heap::AllocatePolymorphicCodeCache() {
1949 MaybeObject* Heap::AllocateAccessorPair() {
1960 MaybeObject* Heap::AllocateTypeFeedbackInfo() {
1973 MaybeObject* Heap::AllocateAliasedArgumentsEntry(int aliased_context_slot) {
1983 const Heap::StringTypeTable Heap::string_type_table[] = {
1991 const Heap::ConstantSymbolTable Heap::constant_symbol_table[] = {
1999 const Heap::StructTable Heap::struct_table[] = {
2007 bool Heap::CreateInitialMaps() {
2293 MaybeObject* Heap::AllocateHeapNumber(double value, PretenureFlag pretenure) {
2294 // Statically ensure that it is safe to allocate heap numbers in paged
2311 MaybeObject* Heap::AllocateHeapNumber(double value) {
2329 MaybeObject* Heap::AllocateJSGlobalPropertyCell(Object* value) {
2341 MaybeObject* Heap::CreateOddball(const char* to_string,
2352 bool Heap::CreateApiObjects() {
2381 void Heap::CreateJSEntryStub() {
2387 void Heap::CreateJSConstructEntryStub() {
2393 void Heap::CreateFixedStubs() {
2407 Heap::CreateJSEntryStub();
2408 Heap::CreateJSConstructEntryStub();
2418 bool Heap::CreateInitialObjects() {
2637 void StringSplitCache::Enter(Heap* heap,
2670 MaybeObject* maybe_symbol = heap->LookupSymbol(str);
2676 array->set_map_no_write_barrier(heap->fixed_cow_array_map());
2687 MaybeObject* Heap::AllocateInitialNumberStringCache() {
2694 int Heap::FullSizeNumberStringCacheLength() {
2707 void Heap::AllocateFullSizeNumberStringCache() {
2725 void Heap::FlushNumberStringCache() {
2745 Object* Heap::GetNumberStringCache(Object* number) {
2765 void Heap::SetNumberStringCache(Object* number, String* string) {
2785 MaybeObject* Heap::NumberToString(Object* number,
2815 MaybeObject* Heap::Uint32ToString(uint32_t value,
2824 Map* Heap::MapForExternalArrayType(ExternalArrayType array_type) {
2829 Heap::RootListIndex Heap::RootIndexForExternalArrayType(
2857 MaybeObject* Heap::NumberFromDouble(double value, PretenureFlag pretenure) {
2873 // Materialize the value in the heap.
2878 MaybeObject* Heap::AllocateForeign(Address address, PretenureFlag pretenure) {
2890 MaybeObject* Heap::AllocateSharedFunctionInfo(Object* name) {
2931 MaybeObject* Heap::AllocateJSMessageObject(String* type,
2943 message->set_properties(Heap::empty_fixed_array(), SKIP_WRITE_BARRIER);
2944 message->set_elements(Heap::empty_fixed_array(), SKIP_WRITE_BARRIER);
2965 Heap* heap,
2972 heap->symbol_table()->LookupTwoCharsSymbolIfExists(c1, c2, &symbol)) {
2979 { MaybeObject* maybe_result = heap->AllocateRawAsciiString(2);
2988 { MaybeObject* maybe_result = heap->AllocateRawTwoByteString(2);
2999 MaybeObject* Heap::AllocateConsString(String* first, String* second) {
3118 MaybeObject* Heap::AllocateSubString(String* buffer,
3212 MaybeObject* Heap::AllocateExternalStringFromAscii(
3235 MaybeObject* Heap::AllocateExternalStringFromTwoByte(
3264 MaybeObject* Heap::LookupSingleCharacterStringFromCode(uint16_t code) {
3289 MaybeObject* Heap::AllocateByteArray(int length, PretenureFlag pretenure) {
3311 MaybeObject* Heap::AllocateByteArray(int length) {
3330 void Heap::CreateFillerObjectAt(Address addr, int size) {
3344 MaybeObject* Heap::AllocateExternalArray(int length,
3366 MaybeObject* Heap::CreateCode(const CodeDesc& desc,
3371 // leaving uninitialized Code object (and breaking the heap).
3415 // that are dereferenced during the copy to point directly to the actual heap
3429 MaybeObject* Heap::CopyCode(Code* code) {
3455 MaybeObject* Heap::CopyCode(Code* code, Vector<byte> reloc_info) {
3457 // leaving uninitialized Code object (and breaking the heap).
3511 MaybeObject* Heap::Allocate(Map* map, AllocationSpace space) {
3529 void Heap::InitializeFunction(JSFunction* function,
3544 MaybeObject* Heap::AllocateFunctionPrototype(JSFunction* function) {
3576 MaybeObject* Heap::AllocateFunction(Map* function_map,
3591 MaybeObject* Heap::AllocateArgumentsObject(Object* callee, int length) {
3610 // This calls Copy directly rather than using Heap::AllocateRaw so we
3665 MaybeObject* Heap::AllocateInitialMap(JSFunction* fun) {
3741 void Heap::InitializeJSObjectFromMap(JSObject* obj,
3750 // fixed array (e.g. Heap::empty_fixed_array()). Currently, the object
3765 filler = Heap::one_pointer_filler_map();
3767 filler = Heap::undefined_value();
3769 obj->InitializeBody(map, Heap::undefined_value(), filler);
3773 MaybeObject* Heap::AllocateJSObjectFromMap(Map* map, PretenureFlag pretenure) {
3813 MaybeObject* Heap::AllocateJSObject(JSFunction* constructor,
3836 MaybeObject* Heap::AllocateJSArrayAndStorage(
3880 MaybeObject* Heap::AllocateJSArrayWithElements(
3894 MaybeObject* Heap::AllocateJSProxy(Object* handler, Object* prototype) {
3914 MaybeObject* Heap::AllocateJSFunctionProxy(Object* handler,
3940 MaybeObject* Heap::AllocateGlobalObject(JSFunction* constructor) {
4013 MaybeObject* Heap::CopyJSObject(JSObject* source) {
4085 MaybeObject* Heap::ReinitializeJSReceiver(
4145 MaybeObject* Heap::ReinitializeJSGlobalProxy(JSFunction* constructor,
4171 MaybeObject* Heap::AllocateStringFromAscii(Vector<const char> string,
4174 return Heap::LookupSingleCharacterStringFromCode(string[0]);
4191 MaybeObject* Heap::AllocateStringFromUtf8Slow(Vector<const char> string,
4230 MaybeObject* Heap::AllocateStringFromTwoByte(Vector<const uc16> string,
4252 Map* Heap::SymbolMapForString(String* string) {
4276 MaybeObject* Heap::AllocateInternalSymbol(unibrow::CharacterStream* buffer,
4341 MaybeObject* Heap::AllocateRawAsciiString(int length, PretenureFlag pretenure) {
4378 MaybeObject* Heap::AllocateRawTwoByteString(int length,
4414 MaybeObject* Heap::AllocateJSArray(
4433 MaybeObject* Heap::AllocateEmptyFixedArray() {
4448 MaybeObject* Heap::AllocateRawFixedArray(int length) {
4463 MaybeObject* Heap::CopyFixedArrayWithMap(FixedArray* src, Map* map) {
4489 MaybeObject* Heap::CopyFixedDoubleArrayWithMap(FixedDoubleArray* src,
4506 MaybeObject* Heap::AllocateFixedArray(int length) {
4524 MaybeObject* Heap::AllocateRawFixedArray(int length, PretenureFlag pretenure) {
4549 Heap* heap,
4554 ASSERT(heap->empty_fixed_array()->IsFixedArray());
4555 if (length == 0) return heap->empty_fixed_array();
4557 ASSERT(!heap->InNewSpace(filler));
4559 { MaybeObject* maybe_result = heap->AllocateRawFixedArray(length, pretenure);
4563 HeapObject::cast(result)->set_map_no_write_barrier(heap->fixed_array_map());
4571 MaybeObject* Heap::AllocateFixedArray(int length, PretenureFlag pretenure) {
4579 MaybeObject* Heap::AllocateFixedArrayWithHoles(int length,
4588 MaybeObject* Heap::AllocateUninitializedFixedArray(int length) {
4603 MaybeObject* Heap::AllocateEmptyFixedDoubleArray() {
4618 MaybeObject* Heap::AllocateUninitializedFixedDoubleArray(
4635 MaybeObject* Heap::AllocateFixedDoubleArrayWithHoles(
4656 MaybeObject* Heap::AllocateRawFixedDoubleArray(int length,
4681 MaybeObject* Heap::AllocateHashTable(int length, PretenureFlag pretenure) {
4693 MaybeObject* Heap::AllocateGlobalContext() {
4710 MaybeObject* Heap::AllocateFunctionContext(int length, JSFunction* function) {
4726 MaybeObject* Heap::AllocateCatchContext(JSFunction* function,
4747 MaybeObject* Heap::AllocateWithContext(JSFunction* function,
4764 MaybeObject* Heap::AllocateBlockContext(JSFunction* function,
4782 MaybeObject* Heap::AllocateScopeInfo(int length) {
4791 MaybeObject* Heap::AllocateStruct(InstanceType type) {
4814 bool Heap::IsHeapIterable() {
4820 void Heap::EnsureHeapIsIterable() {
4823 CollectAllGarbage(kMakeHeapIterableMask, "Heap::EnsureHeapIsIterable");
4829 void Heap::AdvanceIdleIncrementalMarking(intptr_t step_size) {
4850 bool Heap::IdleNotification(int hint) {
4932 bool Heap::IdleGlobalGC() {
4994 void Heap::Print() {
5003 void Heap::ReportCodeStatistics(const char* title) {
5017 void Heap::ReportHeapStatistics(const char* title) {
5032 PrintF("Heap statistics : ");
5053 bool Heap::Contains(HeapObject* value) {
5058 bool Heap::Contains(Address addr) {
5071 bool Heap::InSpace(HeapObject* value, AllocationSpace space) {
5076 bool Heap::InSpace(Address addr, AllocationSpace space) {
5102 void Heap::Verify() {
5126 void Heap::VerifyNoAccessorPairSharing() {
5155 MaybeObject* Heap::LookupSymbol(Vector<const char> string) {
5170 MaybeObject* Heap::LookupAsciiSymbol(Vector<const char> string) {
5185 MaybeObject* Heap::LookupAsciiSymbol(Handle<SeqAsciiString> string,
5205 MaybeObject* Heap::LookupTwoByteSymbol(Vector<const uc16> string) {
5220 MaybeObject* Heap::LookupSymbol(String* string) {
5236 bool Heap::LookupSymbolIfExists(String* string, String** symbol) {
5246 void Heap::ZapFromSpace() {
5261 void Heap::IterateAndMarkPointersToFromSpace(Address start,
5286 if (Heap::InFromSpace(object)) {
5291 SLOW_ASSERT(Heap::InToSpace(new_object));
5324 static void CheckStoreBuffer(Heap* heap,
5332 Map* free_space_map = heap->free_space_map();
5361 // without trying to cast it to a heap object since the hash field of
5364 if (!heap->InNewSpace(o)) continue;
5382 void Heap::OldPointerSpaceCheckStoreBuffer() {
5410 void Heap::MapSpaceCheckStoreBuffer() {
5438 void Heap::LargeObjectSpaceCheckStoreBuffer() {
5464 void Heap::IterateRoots(ObjectVisitor* v, VisitMode mode) {
5470 void Heap::IterateWeakRoots(ObjectVisitor* v, VisitMode mode) {
5482 void Heap::IterateStrongRoots(ObjectVisitor* v, VisitMode mode) {
5511 // heap. Note that it is not necessary to iterate over code objects
5553 // TODO(1236194): Since the heap size is configurable on the command line
5554 // and through the API, we should gracefully handle the case that the heap
5556 bool Heap::ConfigureHeap(int max_semispace_size,
5621 bool Heap::ConfigureHeapDefault() {
5628 void Heap::RecordStats(HeapStats* stats, bool take_snapshot) {
5665 intptr_t Heap::PromotedSpaceSize() {
5675 intptr_t Heap::PromotedSpaceSizeOfObjects() {
5685 int Heap::PromotedExternalMemorySize() {
5700 explicit HeapDebugUtils(Heap* heap)
5705 heap_(heap) {
5851 Heap* heap_;
5853 friend class Heap;
5858 bool Heap::SetUp(bool create_heap_objects) {
5864 // Initialize heap spaces and initial maps and objects. Whenever something
5866 // call Heap::TearDown() to release allocated memory.
5868 // If the heap is not yet configured (e.g. through the API), configure it.
5969 LOG(isolate_, IntPtrTEvent("heap-capacity", Capacity()));
5970 LOG(isolate_, IntPtrTEvent("heap-available", Available()));
5978 void Heap::SetStackLimits() {
5995 void Heap::TearDown() {
6061 void Heap::Shrink() {
6072 void Heap::AddGCPrologueCallback(GCPrologueCallback callback, GCType gc_type) {
6080 void Heap::RemoveGCPrologueCallback(GCPrologueCallback callback) {
6092 void Heap::AddGCEpilogueCallback(GCEpilogueCallback callback, GCType gc_type) {
6100 void Heap::RemoveGCEpilogueCallback(GCEpilogueCallback callback) {
6124 void Heap::PrintHandles() {
6136 return HEAP->new_space();
6138 return HEAP->old_pointer_space();
6140 return HEAP->old_data_space();
6142 return HEAP->code_space();
6144 return HEAP->map_space();
6146 return HEAP->cell_space();
6148 return HEAP
6158 return HEAP->old_pointer_space();
6160 return HEAP->old_data_space();
6162 return HEAP->code_space();
6164 return HEAP->map_space();
6166 return HEAP->cell_space();
6177 return HEAP->old_pointer_space();
6179 return HEAP->old_data_space();
6181 return HEAP->code_space();
6236 iterator_ = new SemiSpaceIterator(HEAP->new_space(), size_func_);
6239 iterator_ = new HeapObjectIterator(HEAP->old_pointer_space(), size_func_);
6242 iterator_ = new HeapObjectIterator(HEAP->old_data_space(), size_func_);
6245 iterator_ = new HeapObjectIterator(HEAP->code_space(), size_func_);
6248 iterator_ = new HeapObjectIterator(HEAP->map_space(), size_func_);
6251 iterator_ = new HeapObjectIterator(HEAP->cell_space(), size_func_);
6254 iterator_ = new LargeObjectIterator(HEAP->lo_space(), size_func_);
6278 Isolate::Current()->heap()->mark_compact_collector()->ClearMarkbits();
6315 Heap* heap = Isolate::Current()->heap();
6317 heap->IterateRoots(&visitor, VISIT_ALL);
6361 // objects. Otherwise, heap will be left in an inconsistent state.
6589 // and finds a path to a specific heap object and prints it.
6590 void Heap::TracePathToObject(Object* target) {
6599 void Heap::TracePathToGlobal() {
6620 GCTracer::GCTracer(Heap* heap,
6631 heap_(heap),
6817 if (HEAP->LookupSymbolIfExists(name, &symbol)) {
6860 void Heap::GarbageCollectionGreedyCheck() {
6926 void Heap::QueueMemoryChunkForFree(MemoryChunk* chunk) {
6932 void Heap::FreeQueuedChunks() {
6970 isolate_->heap()->store_buffer()->Compact();
6971 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED);
6980 void Heap::RememberUnmappedPage(Address page, bool compacted) {