OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/base/once.h" | 9 #include "src/base/once.h" |
10 #include "src/base/utils/random-number-generator.h" | 10 #include "src/base/utils/random-number-generator.h" |
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
827 if (FLAG_trace_incremental_marking) { | 827 if (FLAG_trace_incremental_marking) { |
828 PrintF("[IncrementalMarking] Delaying MarkSweep.\n"); | 828 PrintF("[IncrementalMarking] Delaying MarkSweep.\n"); |
829 } | 829 } |
830 collector = SCAVENGER; | 830 collector = SCAVENGER; |
831 collector_reason = "incremental marking delaying mark-sweep"; | 831 collector_reason = "incremental marking delaying mark-sweep"; |
832 } | 832 } |
833 } | 833 } |
834 | 834 |
835 bool next_gc_likely_to_collect_more = false; | 835 bool next_gc_likely_to_collect_more = false; |
836 | 836 |
837 { GCTracer tracer(this, gc_reason, collector_reason); | 837 { GCTracer tracer(this, collector, gc_reason, collector_reason); |
838 ASSERT(AllowHeapAllocation::IsAllowed()); | 838 ASSERT(AllowHeapAllocation::IsAllowed()); |
839 DisallowHeapAllocation no_allocation_during_gc; | 839 DisallowHeapAllocation no_allocation_during_gc; |
840 GarbageCollectionPrologue(); | 840 GarbageCollectionPrologue(); |
841 // The GC count was incremented in the prologue. Tell the tracer about | |
842 // it. | |
843 tracer.set_gc_count(gc_count_); | |
844 | |
845 // Tell the tracer which collector we've selected. | |
846 tracer.set_collector(collector); | |
847 | 841 |
848 { | 842 { |
849 HistogramTimerScope histogram_timer_scope( | 843 HistogramTimerScope histogram_timer_scope( |
850 (collector == SCAVENGER) ? isolate_->counters()->gc_scavenger() | 844 (collector == SCAVENGER) ? isolate_->counters()->gc_scavenger() |
851 : isolate_->counters()->gc_compactor()); | 845 : isolate_->counters()->gc_compactor()); |
852 next_gc_likely_to_collect_more = | 846 next_gc_likely_to_collect_more = |
853 PerformGarbageCollection(collector, &tracer, gc_callback_flags); | 847 PerformGarbageCollection(collector, &tracer, gc_callback_flags); |
854 } | 848 } |
855 | 849 |
856 GarbageCollectionEpilogue(); | 850 GarbageCollectionEpilogue(); |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1198 | 1192 |
1199 void Heap::MarkCompact(GCTracer* tracer) { | 1193 void Heap::MarkCompact(GCTracer* tracer) { |
1200 gc_state_ = MARK_COMPACT; | 1194 gc_state_ = MARK_COMPACT; |
1201 LOG(isolate_, ResourceEvent("markcompact", "begin")); | 1195 LOG(isolate_, ResourceEvent("markcompact", "begin")); |
1202 | 1196 |
1203 uint64_t size_of_objects_before_gc = SizeOfObjects(); | 1197 uint64_t size_of_objects_before_gc = SizeOfObjects(); |
1204 | 1198 |
1205 mark_compact_collector_.Prepare(tracer); | 1199 mark_compact_collector_.Prepare(tracer); |
1206 | 1200 |
1207 ms_count_++; | 1201 ms_count_++; |
1208 tracer->set_full_gc_count(ms_count_); | |
1209 | 1202 |
1210 MarkCompactPrologue(); | 1203 MarkCompactPrologue(); |
1211 | 1204 |
1212 mark_compact_collector_.CollectGarbage(); | 1205 mark_compact_collector_.CollectGarbage(); |
1213 | 1206 |
1214 LOG(isolate_, ResourceEvent("markcompact", "end")); | 1207 LOG(isolate_, ResourceEvent("markcompact", "end")); |
1215 | 1208 |
1216 gc_state_ = NOT_IN_GC; | 1209 gc_state_ = NOT_IN_GC; |
1217 | 1210 |
1218 isolate_->counters()->objs_since_last_full()->Set(0); | 1211 isolate_->counters()->objs_since_last_full()->Set(0); |
(...skipping 4735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5954 OldSpaces spaces(heap); | 5947 OldSpaces spaces(heap); |
5955 for (OldSpace* space = spaces.next(); | 5948 for (OldSpace* space = spaces.next(); |
5956 space != NULL; | 5949 space != NULL; |
5957 space = spaces.next()) { | 5950 space = spaces.next()) { |
5958 holes_size += space->Waste() + space->Available(); | 5951 holes_size += space->Waste() + space->Available(); |
5959 } | 5952 } |
5960 return holes_size; | 5953 return holes_size; |
5961 } | 5954 } |
5962 | 5955 |
5963 | 5956 |
| 5957 void Heap::UpdateGCStatistics(double start_time, |
| 5958 double end_time, |
| 5959 double spent_in_mutator, |
| 5960 double marking_time) { |
| 5961 double duration = end_time - start_time; |
| 5962 alive_after_last_gc_ = SizeOfObjects(); |
| 5963 bool first_gc = (last_gc_end_timestamp_ == 0); |
| 5964 last_gc_end_timestamp_ = end_time; |
| 5965 |
| 5966 if (FLAG_print_cumulative_gc_stat) { |
| 5967 total_gc_time_ms_ += duration; |
| 5968 max_gc_pause_ = Max(max_gc_pause_, duration); |
| 5969 max_alive_after_gc_ = Max(max_alive_after_gc_, alive_after_last_gc_); |
| 5970 if (!first_gc) |
| 5971 min_in_mutator_ = Min(min_in_mutator_, spent_in_mutator); |
| 5972 } else if (FLAG_trace_gc_verbose) { |
| 5973 total_gc_time_ms_ += duration; |
| 5974 } |
| 5975 |
| 5976 marking_time_ += marking_time; |
| 5977 } |
| 5978 |
| 5979 |
5964 GCTracer::GCTracer(Heap* heap, | 5980 GCTracer::GCTracer(Heap* heap, |
| 5981 GarbageCollector collector, |
5965 const char* gc_reason, | 5982 const char* gc_reason, |
5966 const char* collector_reason) | 5983 const char* collector_reason) |
5967 : start_time_(0.0), | 5984 : start_time_(0.0), |
| 5985 end_time_(0.0), |
5968 start_object_size_(0), | 5986 start_object_size_(0), |
| 5987 end_object_size_(0), |
5969 start_memory_size_(0), | 5988 start_memory_size_(0), |
5970 gc_count_(0), | 5989 end_memory_size_(0), |
5971 full_gc_count_(0), | 5990 collector_(collector), |
5972 allocated_since_last_gc_(0), | 5991 allocated_since_last_gc_(0), |
5973 spent_in_mutator_(0), | 5992 spent_in_mutator_(0), |
5974 nodes_died_in_new_space_(0), | 5993 nodes_died_in_new_space_(0), |
5975 nodes_copied_in_new_space_(0), | 5994 nodes_copied_in_new_space_(0), |
5976 nodes_promoted_(0), | 5995 nodes_promoted_(0), |
5977 heap_(heap), | 5996 heap_(heap), |
5978 gc_reason_(gc_reason), | 5997 gc_reason_(gc_reason), |
5979 collector_reason_(collector_reason) { | 5998 collector_reason_(collector_reason) { |
5980 if (!FLAG_trace_gc && !FLAG_print_cumulative_gc_stat) return; | 5999 if (!FLAG_trace_gc && !FLAG_print_cumulative_gc_stat) return; |
| 6000 |
5981 start_time_ = base::OS::TimeCurrentMillis(); | 6001 start_time_ = base::OS::TimeCurrentMillis(); |
5982 start_object_size_ = heap_->SizeOfObjects(); | 6002 start_object_size_ = heap_->SizeOfObjects(); |
5983 start_memory_size_ = heap_->isolate()->memory_allocator()->Size(); | 6003 start_memory_size_ = heap_->isolate()->memory_allocator()->Size(); |
5984 | 6004 |
5985 for (int i = 0; i < Scope::kNumberOfScopes; i++) { | 6005 for (int i = 0; i < Scope::NUMBER_OF_SCOPES; i++) { |
5986 scopes_[i] = 0; | 6006 scopes_[i] = 0; |
5987 } | 6007 } |
5988 | 6008 |
5989 in_free_list_or_wasted_before_gc_ = CountTotalHolesSize(heap); | 6009 in_free_list_or_wasted_before_gc_ = CountTotalHolesSize(heap); |
5990 | 6010 |
5991 allocated_since_last_gc_ = | 6011 allocated_since_last_gc_ = |
5992 heap_->SizeOfObjects() - heap_->alive_after_last_gc_; | 6012 heap_->SizeOfObjects() - heap_->alive_after_last_gc_; |
5993 | 6013 |
5994 if (heap_->last_gc_end_timestamp_ > 0) { | 6014 if (heap_->last_gc_end_timestamp_ > 0) { |
5995 spent_in_mutator_ = Max(start_time_ - heap_->last_gc_end_timestamp_, 0.0); | 6015 spent_in_mutator_ = Max(start_time_ - heap_->last_gc_end_timestamp_, 0.0); |
5996 } | 6016 } |
5997 | 6017 |
5998 steps_count_ = heap_->incremental_marking()->steps_count(); | 6018 steps_count_ = heap_->incremental_marking()->steps_count(); |
5999 steps_took_ = heap_->incremental_marking()->steps_took(); | 6019 steps_took_ = heap_->incremental_marking()->steps_took(); |
6000 longest_step_ = heap_->incremental_marking()->longest_step(); | 6020 longest_step_ = heap_->incremental_marking()->longest_step(); |
6001 steps_count_since_last_gc_ = | 6021 steps_count_since_last_gc_ = |
6002 heap_->incremental_marking()->steps_count_since_last_gc(); | 6022 heap_->incremental_marking()->steps_count_since_last_gc(); |
6003 steps_took_since_last_gc_ = | 6023 steps_took_since_last_gc_ = |
6004 heap_->incremental_marking()->steps_took_since_last_gc(); | 6024 heap_->incremental_marking()->steps_took_since_last_gc(); |
6005 } | 6025 } |
6006 | 6026 |
6007 | 6027 |
6008 GCTracer::~GCTracer() { | 6028 GCTracer::~GCTracer() { |
6009 // Printf ONE line iff flag is set. | |
6010 if (!FLAG_trace_gc && !FLAG_print_cumulative_gc_stat) return; | 6029 if (!FLAG_trace_gc && !FLAG_print_cumulative_gc_stat) return; |
6011 | 6030 |
6012 bool first_gc = (heap_->last_gc_end_timestamp_ == 0); | 6031 end_time_ = base::OS::TimeCurrentMillis(); |
| 6032 end_object_size_ = heap_->SizeOfObjects(); |
| 6033 end_memory_size_ = heap_->isolate()->memory_allocator()->Size(); |
6013 | 6034 |
6014 heap_->alive_after_last_gc_ = heap_->SizeOfObjects(); | 6035 heap_->UpdateGCStatistics(start_time_, |
6015 heap_->last_gc_end_timestamp_ = base::OS::TimeCurrentMillis(); | 6036 end_time_, |
6016 | 6037 spent_in_mutator_, |
6017 double time = heap_->last_gc_end_timestamp_ - start_time_; | 6038 scopes_[Scope::MC_MARK]); |
6018 | |
6019 // Update cumulative GC statistics if required. | |
6020 if (FLAG_print_cumulative_gc_stat) { | |
6021 heap_->total_gc_time_ms_ += time; | |
6022 heap_->max_gc_pause_ = Max(heap_->max_gc_pause_, time); | |
6023 heap_->max_alive_after_gc_ = Max(heap_->max_alive_after_gc_, | |
6024 heap_->alive_after_last_gc_); | |
6025 if (!first_gc) { | |
6026 heap_->min_in_mutator_ = Min(heap_->min_in_mutator_, | |
6027 spent_in_mutator_); | |
6028 } | |
6029 } else if (FLAG_trace_gc_verbose) { | |
6030 heap_->total_gc_time_ms_ += time; | |
6031 } | |
6032 | 6039 |
6033 if (collector_ == SCAVENGER && FLAG_trace_gc_ignore_scavenger) return; | 6040 if (collector_ == SCAVENGER && FLAG_trace_gc_ignore_scavenger) return; |
6034 | 6041 |
6035 heap_->AddMarkingTime(scopes_[Scope::MC_MARK]); | 6042 if (FLAG_trace_gc) { |
| 6043 if (FLAG_trace_gc_nvp) |
| 6044 PrintNVP(); |
| 6045 else |
| 6046 Print(); |
6036 | 6047 |
6037 if (FLAG_print_cumulative_gc_stat && !FLAG_trace_gc) return; | 6048 heap_->PrintShortHeapStatistics(); |
6038 PrintPID("%8.0f ms: ", heap_->isolate()->time_millis_since_init()); | |
6039 | |
6040 if (!FLAG_trace_gc_nvp) { | |
6041 int external_time = static_cast<int>(scopes_[Scope::EXTERNAL]); | |
6042 | |
6043 double end_memory_size_mb = | |
6044 static_cast<double>(heap_->isolate()->memory_allocator()->Size()) / MB; | |
6045 | |
6046 PrintF("%s %.1f (%.1f) -> %.1f (%.1f) MB, ", | |
6047 CollectorString(), | |
6048 static_cast<double>(start_object_size_) / MB, | |
6049 static_cast<double>(start_memory_size_) / MB, | |
6050 SizeOfHeapObjects(), | |
6051 end_memory_size_mb); | |
6052 | |
6053 if (external_time > 0) PrintF("%d / ", external_time); | |
6054 PrintF("%.1f ms", time); | |
6055 if (steps_count_ > 0) { | |
6056 if (collector_ == SCAVENGER) { | |
6057 PrintF(" (+ %.1f ms in %d steps since last GC)", | |
6058 steps_took_since_last_gc_, | |
6059 steps_count_since_last_gc_); | |
6060 } else { | |
6061 PrintF(" (+ %.1f ms in %d steps since start of marking, " | |
6062 "biggest step %.1f ms)", | |
6063 steps_took_, | |
6064 steps_count_, | |
6065 longest_step_); | |
6066 } | |
6067 } | |
6068 | |
6069 if (gc_reason_ != NULL) { | |
6070 PrintF(" [%s]", gc_reason_); | |
6071 } | |
6072 | |
6073 if (collector_reason_ != NULL) { | |
6074 PrintF(" [%s]", collector_reason_); | |
6075 } | |
6076 | |
6077 PrintF(".\n"); | |
6078 } else { | |
6079 PrintF("pause=%.1f ", time); | |
6080 PrintF("mutator=%.1f ", spent_in_mutator_); | |
6081 PrintF("gc="); | |
6082 switch (collector_) { | |
6083 case SCAVENGER: | |
6084 PrintF("s"); | |
6085 break; | |
6086 case MARK_COMPACTOR: | |
6087 PrintF("ms"); | |
6088 break; | |
6089 default: | |
6090 UNREACHABLE(); | |
6091 } | |
6092 PrintF(" "); | |
6093 | |
6094 PrintF("external=%.1f ", scopes_[Scope::EXTERNAL]); | |
6095 PrintF("mark=%.1f ", scopes_[Scope::MC_MARK]); | |
6096 PrintF("sweep=%.2f ", scopes_[Scope::MC_SWEEP]); | |
6097 PrintF("sweepns=%.2f ", scopes_[Scope::MC_SWEEP_NEWSPACE]); | |
6098 PrintF("sweepos=%.2f ", scopes_[Scope::MC_SWEEP_OLDSPACE]); | |
6099 PrintF("sweepcode=%.2f ", scopes_[Scope::MC_SWEEP_CODE]); | |
6100 PrintF("sweepcell=%.2f ", scopes_[Scope::MC_SWEEP_CELL]); | |
6101 PrintF("sweepmap=%.2f ", scopes_[Scope::MC_SWEEP_MAP]); | |
6102 PrintF("evacuate=%.1f ", scopes_[Scope::MC_EVACUATE_PAGES]); | |
6103 PrintF("new_new=%.1f ", scopes_[Scope::MC_UPDATE_NEW_TO_NEW_POINTERS]); | |
6104 PrintF("root_new=%.1f ", scopes_[Scope::MC_UPDATE_ROOT_TO_NEW_POINTERS]); | |
6105 PrintF("old_new=%.1f ", scopes_[Scope::MC_UPDATE_OLD_TO_NEW_POINTERS]); | |
6106 PrintF("compaction_ptrs=%.1f ", | |
6107 scopes_[Scope::MC_UPDATE_POINTERS_TO_EVACUATED]); | |
6108 PrintF("intracompaction_ptrs=%.1f ", | |
6109 scopes_[Scope::MC_UPDATE_POINTERS_BETWEEN_EVACUATED]); | |
6110 PrintF("misc_compaction=%.1f ", scopes_[Scope::MC_UPDATE_MISC_POINTERS]); | |
6111 PrintF("weakcollection_process=%.1f ", | |
6112 scopes_[Scope::MC_WEAKCOLLECTION_PROCESS]); | |
6113 PrintF("weakcollection_clear=%.1f ", | |
6114 scopes_[Scope::MC_WEAKCOLLECTION_CLEAR]); | |
6115 | |
6116 PrintF("total_size_before=%" V8_PTR_PREFIX "d ", start_object_size_); | |
6117 PrintF("total_size_after=%" V8_PTR_PREFIX "d ", heap_->SizeOfObjects()); | |
6118 PrintF("holes_size_before=%" V8_PTR_PREFIX "d ", | |
6119 in_free_list_or_wasted_before_gc_); | |
6120 PrintF("holes_size_after=%" V8_PTR_PREFIX "d ", CountTotalHolesSize(heap_)); | |
6121 | |
6122 PrintF("allocated=%" V8_PTR_PREFIX "d ", allocated_since_last_gc_); | |
6123 PrintF("promoted=%" V8_PTR_PREFIX "d ", heap_->promoted_objects_size_); | |
6124 PrintF("semi_space_copied=%" V8_PTR_PREFIX "d ", | |
6125 heap_->semi_space_copied_object_size_); | |
6126 PrintF("nodes_died_in_new=%d ", nodes_died_in_new_space_); | |
6127 PrintF("nodes_copied_in_new=%d ", nodes_copied_in_new_space_); | |
6128 PrintF("nodes_promoted=%d ", nodes_promoted_); | |
6129 PrintF("promotion_rate=%.1f%% ", heap_->promotion_rate_); | |
6130 PrintF("semi_space_copy_rate=%.1f%% ", heap_->semi_space_copied_rate_); | |
6131 | |
6132 if (collector_ == SCAVENGER) { | |
6133 PrintF("stepscount=%d ", steps_count_since_last_gc_); | |
6134 PrintF("stepstook=%.1f ", steps_took_since_last_gc_); | |
6135 } else { | |
6136 PrintF("stepscount=%d ", steps_count_); | |
6137 PrintF("stepstook=%.1f ", steps_took_); | |
6138 PrintF("longeststep=%.1f ", longest_step_); | |
6139 } | |
6140 | |
6141 PrintF("\n"); | |
6142 } | 6049 } |
6143 | |
6144 heap_->PrintShortHeapStatistics(); | |
6145 } | 6050 } |
6146 | 6051 |
6147 | 6052 |
6148 const char* GCTracer::CollectorString() { | 6053 void GCTracer::Print() const { |
| 6054 PrintPID("%8.0f ms: ", heap_->isolate()->time_millis_since_init()); |
| 6055 |
| 6056 PrintF("%s %.1f (%.1f) -> %.1f (%.1f) MB, ", |
| 6057 CollectorString(), |
| 6058 static_cast<double>(start_object_size_) / MB, |
| 6059 static_cast<double>(start_memory_size_) / MB, |
| 6060 static_cast<double>(end_object_size_) / MB, |
| 6061 static_cast<double>(end_memory_size_) / MB); |
| 6062 |
| 6063 int external_time = static_cast<int>(scopes_[Scope::EXTERNAL]); |
| 6064 if (external_time > 0) PrintF("%d / ", external_time); |
| 6065 |
| 6066 PrintF("%.1f ms", end_time_ - start_time_); |
| 6067 if (steps_count_ > 0) { |
| 6068 if (collector_ == SCAVENGER) { |
| 6069 PrintF(" (+ %.1f ms in %d steps since last GC)", |
| 6070 steps_took_since_last_gc_, |
| 6071 steps_count_since_last_gc_); |
| 6072 } else { |
| 6073 PrintF(" (+ %.1f ms in %d steps since start of marking, " |
| 6074 "biggest step %.1f ms)", |
| 6075 steps_took_, |
| 6076 steps_count_, |
| 6077 longest_step_); |
| 6078 } |
| 6079 } |
| 6080 |
| 6081 if (gc_reason_ != NULL) { |
| 6082 PrintF(" [%s]", gc_reason_); |
| 6083 } |
| 6084 |
| 6085 if (collector_reason_ != NULL) { |
| 6086 PrintF(" [%s]", collector_reason_); |
| 6087 } |
| 6088 |
| 6089 PrintF(".\n"); |
| 6090 } |
| 6091 |
| 6092 |
| 6093 void GCTracer::PrintNVP() const { |
| 6094 PrintPID("%8.0f ms: ", heap_->isolate()->time_millis_since_init()); |
| 6095 |
| 6096 PrintF("pause=%.1f ", end_time_ - start_time_); |
| 6097 PrintF("mutator=%.1f ", spent_in_mutator_); |
| 6098 PrintF("gc="); |
| 6099 switch (collector_) { |
| 6100 case SCAVENGER: |
| 6101 PrintF("s"); |
| 6102 break; |
| 6103 case MARK_COMPACTOR: |
| 6104 PrintF("ms"); |
| 6105 break; |
| 6106 default: |
| 6107 UNREACHABLE(); |
| 6108 } |
| 6109 PrintF(" "); |
| 6110 |
| 6111 PrintF("external=%.1f ", scopes_[Scope::EXTERNAL]); |
| 6112 PrintF("mark=%.1f ", scopes_[Scope::MC_MARK]); |
| 6113 PrintF("sweep=%.2f ", scopes_[Scope::MC_SWEEP]); |
| 6114 PrintF("sweepns=%.2f ", scopes_[Scope::MC_SWEEP_NEWSPACE]); |
| 6115 PrintF("sweepos=%.2f ", scopes_[Scope::MC_SWEEP_OLDSPACE]); |
| 6116 PrintF("sweepcode=%.2f ", scopes_[Scope::MC_SWEEP_CODE]); |
| 6117 PrintF("sweepcell=%.2f ", scopes_[Scope::MC_SWEEP_CELL]); |
| 6118 PrintF("sweepmap=%.2f ", scopes_[Scope::MC_SWEEP_MAP]); |
| 6119 PrintF("evacuate=%.1f ", scopes_[Scope::MC_EVACUATE_PAGES]); |
| 6120 PrintF("new_new=%.1f ", scopes_[Scope::MC_UPDATE_NEW_TO_NEW_POINTERS]); |
| 6121 PrintF("root_new=%.1f ", scopes_[Scope::MC_UPDATE_ROOT_TO_NEW_POINTERS]); |
| 6122 PrintF("old_new=%.1f ", scopes_[Scope::MC_UPDATE_OLD_TO_NEW_POINTERS]); |
| 6123 PrintF("compaction_ptrs=%.1f ", |
| 6124 scopes_[Scope::MC_UPDATE_POINTERS_TO_EVACUATED]); |
| 6125 PrintF("intracompaction_ptrs=%.1f ", |
| 6126 scopes_[Scope::MC_UPDATE_POINTERS_BETWEEN_EVACUATED]); |
| 6127 PrintF("misc_compaction=%.1f ", scopes_[Scope::MC_UPDATE_MISC_POINTERS]); |
| 6128 PrintF("weakcollection_process=%.1f ", |
| 6129 scopes_[Scope::MC_WEAKCOLLECTION_PROCESS]); |
| 6130 PrintF("weakcollection_clear=%.1f ", |
| 6131 scopes_[Scope::MC_WEAKCOLLECTION_CLEAR]); |
| 6132 |
| 6133 PrintF("total_size_before=%" V8_PTR_PREFIX "d ", start_object_size_); |
| 6134 PrintF("total_size_after=%" V8_PTR_PREFIX "d ", end_object_size_); |
| 6135 PrintF("holes_size_before=%" V8_PTR_PREFIX "d ", |
| 6136 in_free_list_or_wasted_before_gc_); |
| 6137 PrintF("holes_size_after=%" V8_PTR_PREFIX "d ", CountTotalHolesSize(heap_)); |
| 6138 |
| 6139 PrintF("allocated=%" V8_PTR_PREFIX "d ", allocated_since_last_gc_); |
| 6140 PrintF("promoted=%" V8_PTR_PREFIX "d ", heap_->promoted_objects_size_); |
| 6141 PrintF("semi_space_copied=%" V8_PTR_PREFIX "d ", |
| 6142 heap_->semi_space_copied_object_size_); |
| 6143 PrintF("nodes_died_in_new=%d ", nodes_died_in_new_space_); |
| 6144 PrintF("nodes_copied_in_new=%d ", nodes_copied_in_new_space_); |
| 6145 PrintF("nodes_promoted=%d ", nodes_promoted_); |
| 6146 PrintF("promotion_rate=%.1f%% ", heap_->promotion_rate_); |
| 6147 PrintF("semi_space_copy_rate=%.1f%% ", heap_->semi_space_copied_rate_); |
| 6148 |
| 6149 if (collector_ == SCAVENGER) { |
| 6150 PrintF("stepscount=%d ", steps_count_since_last_gc_); |
| 6151 PrintF("stepstook=%.1f ", steps_took_since_last_gc_); |
| 6152 } else { |
| 6153 PrintF("stepscount=%d ", steps_count_); |
| 6154 PrintF("stepstook=%.1f ", steps_took_); |
| 6155 PrintF("longeststep=%.1f ", longest_step_); |
| 6156 } |
| 6157 |
| 6158 PrintF("\n"); |
| 6159 } |
| 6160 |
| 6161 |
| 6162 const char* GCTracer::CollectorString() const { |
6149 switch (collector_) { | 6163 switch (collector_) { |
6150 case SCAVENGER: | 6164 case SCAVENGER: |
6151 return "Scavenge"; | 6165 return "Scavenge"; |
6152 case MARK_COMPACTOR: | 6166 case MARK_COMPACTOR: |
6153 return "Mark-sweep"; | 6167 return "Mark-sweep"; |
6154 } | 6168 } |
6155 return "Unknown GC"; | 6169 return "Unknown GC"; |
6156 } | 6170 } |
6157 | 6171 |
6158 | 6172 |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6415 static_cast<int>(object_sizes_last_time_[index])); | 6429 static_cast<int>(object_sizes_last_time_[index])); |
6416 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6430 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6417 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6431 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6418 | 6432 |
6419 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6433 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6420 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6434 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6421 ClearObjectStats(); | 6435 ClearObjectStats(); |
6422 } | 6436 } |
6423 | 6437 |
6424 } } // namespace v8::internal | 6438 } } // namespace v8::internal |
OLD | NEW |