Home | History | Annotate | Download | only in src

Lines Matching full:heap

36 #include "heap-profiler.h"
53 String* Heap::hidden_symbol_;
54 Object* Heap::roots_[Heap::kRootListLength];
57 NewSpace Heap::new_space_;
58 OldSpace* Heap::old_pointer_space_ = NULL;
59 OldSpace* Heap::old_data_space_ = NULL;
60 OldSpace* Heap::code_space_ = NULL;
61 MapSpace* Heap::map_space_ = NULL;
62 CellSpace* Heap::cell_space_ = NULL;
63 LargeObjectSpace* Heap::lo_space_ = NULL;
68 int Heap::old_gen_promotion_limit_ = kMinimumPromotionLimit;
69 int Heap::old_gen_allocation_limit_ = kMinimumAllocationLimit;
71 int Heap::old_gen_exhausted_ = false;
73 int Heap::amount_of_external_allocated_memory_ = 0;
74 int Heap::amount_of_external_allocated_memory_at_last_global_gc_ = 0;
79 int Heap::max_semispace_size_ = 2*MB;
80 int Heap::max_old_generation_size_ = 192*MB;
81 int Heap::initial_semispace_size_ = 128*KB;
82 size_t Heap::code_range_size_ = 0;
84 int Heap::max_semispace_size_ = 16*MB;
85 int Heap::max_old_generation_size_ = 1*GB;
86 int Heap::initial_semispace_size_ = 1*MB;
87 size_t Heap::code_range_size_ = 512*MB;
89 int Heap::max_semispace_size_ = 8*MB;
90 int Heap::max_old_generation_size_ = 512*MB;
91 int Heap::initial_semispace_size_ = 512*KB;
92 size_t Heap::code_range_size_ = 0;
98 int Heap::reserved_semispace_size_ = Heap::max_semispace_size_;
100 GCCallback Heap::global_gc_prologue_callback_ = NULL;
101 GCCallback Heap::global_gc_epilogue_callback_ = NULL;
108 int Heap::survived_since_last_expansion_ = 0;
109 int Heap::external_allocation_limit_ = 0;
111 Heap::HeapState Heap::gc_state_ = NOT_IN_GC;
113 int Heap::mc_count_ = 0;
114 int Heap::gc_count_ = 0;
116 int Heap::always_allocate_scope_depth_ = 0;
117 int Heap::linear_allocation_scope_depth_ = 0;
118 bool Heap::context_disposed_pending_ = false;
121 bool Heap::allocation_allowed_ = true;
123 int Heap::allocation_timeout_ = 0;
124 bool Heap::disallow_allocation_failure_ = false;
128 int Heap::Capacity() {
140 int Heap::CommittedMemory() {
153 int Heap::Available() {
165 bool Heap::HasBeenSetup() {
175 GarbageCollector Heap::SelectGarbageCollector(AllocationSpace space) {
213 // TODO(1238405): Combine the infrastructure for --heap-stats and
216 void Heap::ReportStatisticsBeforeGC() {
217 // Heap::ReportHeapStatistics will also log NewSpace statistics when
245 void Heap::PrintShortHeapStatistics() {
251 Heap::new_space_.Size(),
280 // TODO(1238405): Combine the infrastructure for --heap-stats and
282 void Heap::ReportStatisticsAfterGC() {
301 void Heap::GarbageCollectionPrologue() {
327 int Heap::SizeOfObjects() {
336 void Heap::GarbageCollectionEpilogue() {
364 void Heap::CollectAllGarbage(bool force_compaction) {
374 void Heap::CollectAllGarbageIfContextDisposed() {
387 void Heap::NotifyContextDisposed() {
392 bool Heap::CollectGarbage(int requested_size, AllocationSpace space) {
450 void Heap::PerformScavenge() {
477 Heap::symbol_table()->IterateElements(&verifier);
482 void Heap::ReserveSpace(
490 NewSpace* new_space = Heap::new_space();
491 PagedSpace* old_pointer_space = Heap::old_pointer_space();
492 PagedSpace* old_data_space = Heap::old_data_space();
493 PagedSpace* code_space = Heap::code_space();
494 PagedSpace* map_space = Heap::map_space();
495 PagedSpace* cell_space = Heap::cell_space();
496 LargeObjectSpace* lo_space = Heap::lo_space();
501 Heap::CollectGarbage(new_space_size, NEW_SPACE);
505 Heap::CollectGarbage(pointer_space_size, OLD_POINTER_SPACE);
509 Heap::CollectGarbage(data_space_size, OLD_DATA_SPACE);
513 Heap::CollectGarbage(code_space_size, CODE_SPACE);
517 Heap::CollectGarbage(map_space_size, MAP_SPACE);
521 Heap::CollectGarbage(cell_space_size, CELL_SPACE);
534 Heap::CollectGarbage(large_object_size, LO_SPACE);
541 void Heap::EnsureFromSpaceIsCommitted() {
555 void Heap::PerformGarbageCollection(AllocationSpace space,
600 void Heap::MarkCompact(GCTracer* tracer) {
627 void Heap::MarkCompactPrologue(bool is_compacting) {
643 void Heap::MarkCompactEpilogue(bool is_compacting) {
649 Object* Heap::FindCodeObject(Address a) {
673 if (!Heap::InNewSpace(object)) return;
674 Heap::ScavengeObject(reinterpret_cast<HeapObject**>(p),
694 ASSERT(reinterpret_cast<Address>(rear_) >= Heap::new_space()->top());
723 ASSERT(!Heap::InNewSpace(HeapObject::cast(*current)));
734 HeapObjectIterator code_it(Heap::code_space());
739 HeapObjectIterator data_it(Heap::old_data_space());
747 void Heap::Scavenge() {
836 void Heap::ScavengeExternalStringTable() {
846 ASSERT(Heap::InFromSpace(*p));
859 if (Heap::InNewSpace(target)) {
874 Address Heap::DoScavenge(ObjectVisitor* scavenge_visitor,
918 void Heap::ClearRSetRange(Address start, int size_in_bytes) {
968 if (Heap::InNewSpace(*p)) {
975 int Heap::UpdateRSet(HeapObject* obj) {
987 if (Heap::InNewSpace(array->get(i))) {
1001 void Heap::RebuildRSets() {
1010 Heap::lo_space_->ClearRSet();
1015 void Heap::RebuildRSets(PagedSpace* space) {
1018 Heap::UpdateRSet(obj);
1022 void Heap::RebuildRSets(LargeObjectSpace* space) {
1025 Heap::UpdateRSet(obj);
1030 void Heap::RecordCopiedObject(HeapObject* obj) {
1050 HeapObject* Heap::MigrateObject(HeapObject* source,
1076 return ConsString::cast(object)->unchecked_second() == Heap::empty_string();
1080 void Heap::ScavengeObjectSlow(HeapObject** p, HeapObject* object) {
1129 OldSpace* target_space = Heap::TargetSpace(object);
1130 ASSERT(target_space == Heap::old_pointer_space_ ||
1131 target_space == Heap::old_data_space_);
1135 if (target_space == Heap::old_pointer_space_) {
1173 void Heap::ScavengePointer(HeapObject** p) {
1178 Object* Heap::AllocatePartialMap(InstanceType instance_type,
1196 Object* Heap::AllocateMap(InstanceType instance_type, int instance_size) {
1224 const Heap::StringTypeTable Heap::string_type_table[] = {
1232 const Heap::ConstantSymbolTable Heap::constant_symbol_table[] = {
1240 const Heap::StructTable Heap::struct_table[] = {
1248 bool Heap::CreateInitialMaps() {
1414 ASSERT(!Heap::InNewSpace(Heap::empty_fixed_array()));
1419 Object* Heap::AllocateHeapNumber(double value, PretenureFlag pretenure) {
1420 // Statically ensure that it is safe to allocate heap numbers in paged
1434 Object* Heap::AllocateHeapNumber(double value) {
1450 Object* Heap::AllocateJSGlobalPropertyCell(Object* value) {
1459 Object* Heap::CreateOddball(Map* map,
1468 bool Heap::CreateApiObjects() {
1475 obj = Heap::AllocateJSObjectFromMap(neander_map());
1487 void Heap::CreateCEntryStub() {
1494 void Heap::CreateRegExpCEntryStub() {
1501 void Heap::CreateJSEntryStub() {
1507 void Heap::CreateJSConstructEntryStub() {
1513 void Heap::CreateFixedStubs() {
1527 Heap::CreateCEntryStub();
1528 Heap::CreateJSEntryStub();
1529 Heap::CreateJSConstructEntryStub();
1531 Heap::CreateRegExpCEntryStub();
1536 bool Heap::CreateInitialObjects() {
1668 Object* Heap::InitializeNumberStringCache() {
1669 // Compute the size of the number string cache based on the max heap size.
1680 void Heap::FlushNumberStringCache() {
1700 Object* Heap::GetNumberStringCache(Object* number) {
1720 void Heap::SetNumberStringCache(Object* number, String* string) {
1734 Object* Heap::SmiOrNumberFromDouble(double value,
1764 // Materialize the value in the heap.
1769 Object* Heap::NumberToString(Object* number) {
1795 Map* Heap::MapForExternalArrayType(ExternalArrayType array_type) {
1800 Heap::RootListIndex Heap::RootIndexForExternalArrayType(
1824 Object* Heap::NewNumberFromDouble(double value, PretenureFlag pretenure) {
1831 Object* Heap::NumberFromDouble(double value, PretenureFlag pretenure) {
1838 Object* Heap::AllocateProxy(Address proxy, PretenureFlag pretenure) {
1850 Object* Heap::AllocateSharedFunctionInfo(Object* name) {
1888 Heap::symbol_table()->LookupTwoCharsSymbolIfExists(c1, c2, &symbol)) {
1894 Object* result = Heap::AllocateRawAsciiString(2);
1901 Object* result = Heap::AllocateRawTwoByteString(2);
1911 Object* Heap::AllocateConsString(String* first, String* second) {
1995 Object* Heap::AllocateSubString(String* buffer,
2001 return Heap::LookupSingleCharacterStringFromCode(
2038 Object* Heap::AllocateExternalStringFromAscii(
2059 Object* Heap::AllocateExternalStringFromTwoByte(
2067 Map* map = Heap::external_string_map();
2080 Object* Heap::LookupSingleCharacterStringFromCode(uint16_t code) {
2082 Object* value = Heap::single_character_string_cache()->get(code);
2083 if (value != Heap::undefined_value()) return value;
2090 Heap::single_character_string_cache()->set(code, result);
2094 Object* result = Heap::AllocateRawTwoByteString(1);
2102 Object* Heap::AllocateByteArray(int length, PretenureFlag pretenure) {
2121 Object* Heap::AllocateByteArray(int length) {
2137 void Heap::CreateFillerObjectAt(Address addr, int size) {
2141 filler->set_map(Heap::one_pointer_filler_map());
2143 filler->set_map(Heap::byte_array_map());
2149 Object* Heap::AllocatePixelArray(int length,
2164 Object* Heap::AllocateExternalArray(int length,
2184 Object* Heap::CreateCode(const CodeDesc& desc,
2218 // that are dereferenced during the copy to point directly to the actual heap
2231 Object* Heap::CopyCode(Code* code) {
2257 Object* Heap::Allocate(Map* map, AllocationSpace space) {
2275 Object* Heap::InitializeFunction(JSFunction* function,
2289 Object* Heap::AllocateFunctionPrototype(JSFunction* function) {
2308 Object* Heap::AllocateFunction(Map* function_map,
2320 Object* Heap::AllocateArgumentsObject(Object* callee, int length) {
2324 // This calls Copy directly rather than using Heap::AllocateRaw so we
2363 Object* Heap::AllocateInitialMap(JSFunction* fun) {
2370 Object* map_obj = Heap::AllocateMap(JS_OBJECT_TYPE, instance_size);
2417 void Heap::InitializeJSObjectFromMap(JSObject* obj,
2426 // fixed array (eg, Heap::empty_fixed_array()). Currently, the object
2433 Object* Heap::AllocateJSObjectFromMap(Map* map, PretenureFlag pretenure) {
2467 Object* Heap::AllocateJSObject(JSFunction* constructor,
2485 Object* Heap::AllocateGlobalObject(JSFunction* constructor) {
2520 value = Heap::AllocateJSGlobalPropertyCell(value);
2541 global->map()->set_instance_descriptors(Heap::empty_descriptor_array());
2551 Object* Heap::CopyJSObject(JSObject* source) {
2579 ASSERT(Heap::InNewSpace(clone));
2609 Object* Heap::ReinitializeJSGlobalProxy(JSFunction* constructor,
2639 Object* Heap::AllocateStringFromAscii(Vector<const char> string,
2653 Object* Heap::AllocateStringFromUtf8(Vector<const char> string,
2685 Object* Heap::AllocateStringFromTwoByte(Vector<const uc16> string,
2709 Map* Heap::SymbolMapForString(String* string) {
2727 Object* Heap::AllocateInternalSymbol(unibrow::CharacterStream* buffer,
2783 Object* Heap::AllocateRawAsciiString(int length, PretenureFlag pretenure) {
2817 Object* Heap::AllocateRawTwoByteString(int length, PretenureFlag pretenure) {
2849 Object* Heap::AllocateEmptyFixedArray() {
2860 Object* Heap::AllocateRawFixedArray(int length) {
2874 Object* Heap::CopyFixedArray(FixedArray* src) {
2878 if (Heap::InNewSpace(obj)) {
2897 Object* Heap::AllocateFixedArray(int length) {
2909 ASSERT(!Heap::InNewSpace(value)); // value = undefined
2917 Object* Heap::AllocateFixedArray(int length, PretenureFlag pretenure) {
2940 // We cannot use Heap::AllocateRaw() because it will not properly
2965 ASSERT(!Heap::InNewSpace(value)); // value = undefined
2972 Object* Heap::AllocateFixedArrayWithHoles(int length) {
2983 ASSERT(!Heap::InNewSpace(value)); // value = the hole
2991 Object* Heap::AllocateHashTable(int length) {
2992 Object* result = Heap::AllocateFixedArray(length);
3000 Object* Heap::AllocateGlobalContext() {
3001 Object* result = Heap::AllocateFixedArray(Context::GLOBAL_CONTEXT_SLOTS);
3011 Object* Heap::AllocateFunctionContext(int length, JSFunction* function) {
3013 Object* result = Heap::AllocateFixedArray(length);
3029 Object* Heap::AllocateWithContext(Context* previous,
3032 Object* result = Heap::AllocateFixedArray(Context::MIN_CONTEXT_SLOTS);
3048 Object* Heap::AllocateStruct(InstanceType type) {
3061 Object* result = Heap::Allocate(map, space);
3068 bool Heap::IdleNotification() {
3108 Heap::UncommitFromSpace();
3115 void Heap::Print() {
3124 void Heap::ReportCodeStatistics(const char* title) {
3138 void Heap::ReportHeapStatistics(const char* title) {
3151 PrintF("Heap statistics : ");
3172 bool Heap::Contains(HeapObject* value) {
3177 bool Heap::Contains(Address addr) {
3190 bool Heap::InSpace(HeapObject* value, AllocationSpace space) {
3195 bool Heap::InSpace(Address addr, AllocationSpace space) {
3221 void Heap::Verify() {
3243 Object* Heap::LookupSymbol(Vector<const char> string) {
3255 Object* Heap::LookupSymbol(String* string) {
3268 bool Heap::LookupSymbolIfExists(String* string, String** symbol) {
3278 void Heap::ZapFromSpace() {
3289 int Heap::IterateRSetRange(Address object_start,
3306 if (Heap::InNewSpace(*object_p)) {
3311 if (!Heap::InNewSpace(*object_p)) result_rset &= ~bitmask;
3330 void Heap::IterateRSet(PagedSpace* space, ObjectSlotCallback copy_object_func) {
3352 void Heap::IterateRoots(ObjectVisitor* v, VisitMode mode) {
3358 void Heap::IterateWeakRoots(ObjectVisitor* v, VisitMode mode) {
3369 void Heap::IterateStrongRoots(ObjectVisitor* v, VisitMode mode) {
3395 // heap. Note that it is not necessary to iterate over code objects
3430 // Flag is set when the heap has been configured. The heap can be repeatedly
3434 // TODO(1236194): Since the heap size is configurable on the command line
3435 // and through the API, we should gracefully handle the case that the heap
3437 bool Heap::ConfigureHeap(int max_semispace_size, int max_old_gen_size) {
3474 bool Heap::ConfigureHeapDefault() {
3479 void Heap::RecordStats(HeapStats* stats) {
3499 int Heap::PromotedSpaceSize() {
3509 int Heap::PromotedExternalMemorySize() {
3517 bool Heap::Setup(bool create_heap_objects) {
3518 // Initialize heap spaces and initial maps and objects. Whenever something
3520 // call Heap::TearDown() to release allocated memory.
3522 // If the heap is not yet configured (eg, through the API), configure it.
3604 LOG(IntEvent("heap-capacity", Capacity()));
3605 LOG(IntEvent("heap-available", Available()));
3616 void Heap::SetStackLimits() {
3631 void Heap::TearDown() {
3678 void Heap::Shrink() {
3688 void Heap::Protect() {
3697 void Heap::Unprotect() {
3718 void Heap::PrintHandles() {
3730 return Heap::new_space();
3732 return Heap::old_pointer_space();
3734 return Heap::old_data_space();
3736 return Heap::code_space();
3738 return Heap::map_space();
3740 return Heap::cell_space();
3742 return Heap::lo_space();
3752 return Heap::old_pointer_space();
3754 return Heap::old_data_space();
3756 return Heap::code_space();
3758 return Heap::map_space();
3760 return Heap::cell_space();
3771 return Heap::old_pointer_space();
3773 return Heap::old_data_space();
3775 return Heap::code_space();
3820 iterator_ = new SemiSpaceIterator(Heap::new_space());
3823 iterator_ = new HeapObjectIterator(Heap::old_pointer_space());
3826 iterator_ = new HeapObjectIterator(Heap::old_data_space());
3829 iterator_ = new HeapObjectIterator(Heap::code_space());
3832 iterator_ = new HeapObjectIterator(Heap::map_space());
3835 iterator_ = new HeapObjectIterator(Heap::cell_space());
3838 iterator_ = new LargeObjectIterator(Heap::lo_space());
4044 // and finds a path to a specific heap object and prints it.
4045 void Heap::TracePathToObject(Object* target) {
4057 void Heap::TracePathToGlobal() {
4093 Heap::PrintShortHeapStatistics();
4130 if (Heap::LookupSymbolIfExists(name, &symbol)) {
4163 bool Heap::GarbageCollectionGreedyCheck() {
4200 if (new_space_strings_[i] == Heap::raw_unchecked_null_value()) continue;
4201 if (Heap::InNewSpace(new_space_strings_[i])) {
4210 if (old_space_strings_[i] == Heap::raw_unchecked_null_value()) continue;
4211 ASSERT(!Heap::InNewSpace(old_space_strings_[i]));