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_nvp) { |
Hannes Payer (out of office)
2014/07/16 13:33:06
What about
if (FLAG_trace_gc) {
if (FLAG_trace_g
ernstm
2014/07/16 13:43:52
Good catch. This was actually wrong, because the P
| |
6036 | 6043 PrintNVP(); |
6037 if (FLAG_print_cumulative_gc_stat && !FLAG_trace_gc) return; | |
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 { | 6044 } else { |
6079 PrintF("pause=%.1f ", time); | 6045 Print(); |
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 } | 6046 } |
6143 | 6047 |
6144 heap_->PrintShortHeapStatistics(); | 6048 heap_->PrintShortHeapStatistics(); |
6145 } | 6049 } |
6146 | 6050 |
6147 | 6051 |
6148 const char* GCTracer::CollectorString() { | 6052 void GCTracer::Print() const { |
6053 if (!FLAG_trace_gc) return; | |
Hannes Payer (out of office)
2014/07/16 13:33:06
... drop this check here
| |
6054 | |
6055 PrintPID("%8.0f ms: ", heap_->isolate()->time_millis_since_init()); | |
6056 | |
6057 PrintF("%s %.1f (%.1f) -> %.1f (%.1f) MB, ", | |
6058 CollectorString(), | |
6059 static_cast<double>(start_object_size_) / MB, | |
6060 static_cast<double>(start_memory_size_) / MB, | |
6061 static_cast<double>(end_object_size_) / MB, | |
6062 static_cast<double>(end_memory_size_) / MB); | |
6063 | |
6064 int external_time = static_cast<int>(scopes_[Scope::EXTERNAL]); | |
6065 if (external_time > 0) PrintF("%d / ", external_time); | |
6066 | |
6067 PrintF("%.1f ms", end_time_ - start_time_); | |
6068 if (steps_count_ > 0) { | |
6069 if (collector_ == SCAVENGER) { | |
6070 PrintF(" (+ %.1f ms in %d steps since last GC)", | |
6071 steps_took_since_last_gc_, | |
6072 steps_count_since_last_gc_); | |
6073 } else { | |
6074 PrintF(" (+ %.1f ms in %d steps since start of marking, " | |
6075 "biggest step %.1f ms)", | |
6076 steps_took_, | |
6077 steps_count_, | |
6078 longest_step_); | |
6079 } | |
6080 } | |
6081 | |
6082 if (gc_reason_ != NULL) { | |
6083 PrintF(" [%s]", gc_reason_); | |
6084 } | |
6085 | |
6086 if (collector_reason_ != NULL) { | |
6087 PrintF(" [%s]", collector_reason_); | |
6088 } | |
6089 | |
6090 PrintF(".\n"); | |
6091 } | |
6092 | |
6093 | |
6094 void GCTracer::PrintNVP() const { | |
6095 if (!FLAG_trace_gc) return; | |
Hannes Payer (out of office)
2014/07/16 13:33:06
... drop this check here
| |
6096 | |
6097 PrintPID("%8.0f ms: ", heap_->isolate()->time_millis_since_init()); | |
6098 | |
6099 PrintF("pause=%.1f ", end_time_ - start_time_); | |
6100 PrintF("mutator=%.1f ", spent_in_mutator_); | |
6101 PrintF("gc="); | |
6102 switch (collector_) { | |
6103 case SCAVENGER: | |
6104 PrintF("s"); | |
6105 break; | |
6106 case MARK_COMPACTOR: | |
6107 PrintF("ms"); | |
6108 break; | |
6109 default: | |
6110 UNREACHABLE(); | |
6111 } | |
6112 PrintF(" "); | |
6113 | |
6114 PrintF("external=%.1f ", scopes_[Scope::EXTERNAL]); | |
6115 PrintF("mark=%.1f ", scopes_[Scope::MC_MARK]); | |
6116 PrintF("sweep=%.2f ", scopes_[Scope::MC_SWEEP]); | |
6117 PrintF("sweepns=%.2f ", scopes_[Scope::MC_SWEEP_NEWSPACE]); | |
6118 PrintF("sweepos=%.2f ", scopes_[Scope::MC_SWEEP_OLDSPACE]); | |
6119 PrintF("sweepcode=%.2f ", scopes_[Scope::MC_SWEEP_CODE]); | |
6120 PrintF("sweepcell=%.2f ", scopes_[Scope::MC_SWEEP_CELL]); | |
6121 PrintF("sweepmap=%.2f ", scopes_[Scope::MC_SWEEP_MAP]); | |
6122 PrintF("evacuate=%.1f ", scopes_[Scope::MC_EVACUATE_PAGES]); | |
6123 PrintF("new_new=%.1f ", scopes_[Scope::MC_UPDATE_NEW_TO_NEW_POINTERS]); | |
6124 PrintF("root_new=%.1f ", scopes_[Scope::MC_UPDATE_ROOT_TO_NEW_POINTERS]); | |
6125 PrintF("old_new=%.1f ", scopes_[Scope::MC_UPDATE_OLD_TO_NEW_POINTERS]); | |
6126 PrintF("compaction_ptrs=%.1f ", | |
6127 scopes_[Scope::MC_UPDATE_POINTERS_TO_EVACUATED]); | |
6128 PrintF("intracompaction_ptrs=%.1f ", | |
6129 scopes_[Scope::MC_UPDATE_POINTERS_BETWEEN_EVACUATED]); | |
6130 PrintF("misc_compaction=%.1f ", scopes_[Scope::MC_UPDATE_MISC_POINTERS]); | |
6131 PrintF("weakcollection_process=%.1f ", | |
6132 scopes_[Scope::MC_WEAKCOLLECTION_PROCESS]); | |
6133 PrintF("weakcollection_clear=%.1f ", | |
6134 scopes_[Scope::MC_WEAKCOLLECTION_CLEAR]); | |
6135 | |
6136 PrintF("total_size_before=%" V8_PTR_PREFIX "d ", start_object_size_); | |
6137 PrintF("total_size_after=%" V8_PTR_PREFIX "d ", end_object_size_); | |
6138 PrintF("holes_size_before=%" V8_PTR_PREFIX "d ", | |
6139 in_free_list_or_wasted_before_gc_); | |
6140 PrintF("holes_size_after=%" V8_PTR_PREFIX "d ", CountTotalHolesSize(heap_)); | |
6141 | |
6142 PrintF("allocated=%" V8_PTR_PREFIX "d ", allocated_since_last_gc_); | |
6143 PrintF("promoted=%" V8_PTR_PREFIX "d ", heap_->promoted_objects_size_); | |
6144 PrintF("semi_space_copied=%" V8_PTR_PREFIX "d ", | |
6145 heap_->semi_space_copied_object_size_); | |
6146 PrintF("nodes_died_in_new=%d ", nodes_died_in_new_space_); | |
6147 PrintF("nodes_copied_in_new=%d ", nodes_copied_in_new_space_); | |
6148 PrintF("nodes_promoted=%d ", nodes_promoted_); | |
6149 PrintF("promotion_rate=%.1f%% ", heap_->promotion_rate_); | |
6150 PrintF("semi_space_copy_rate=%.1f%% ", heap_->semi_space_copied_rate_); | |
6151 | |
6152 if (collector_ == SCAVENGER) { | |
6153 PrintF("stepscount=%d ", steps_count_since_last_gc_); | |
6154 PrintF("stepstook=%.1f ", steps_took_since_last_gc_); | |
6155 } else { | |
6156 PrintF("stepscount=%d ", steps_count_); | |
6157 PrintF("stepstook=%.1f ", steps_took_); | |
6158 PrintF("longeststep=%.1f ", longest_step_); | |
6159 } | |
6160 | |
6161 PrintF("\n"); | |
6162 } | |
6163 | |
6164 | |
6165 const char* GCTracer::CollectorString() const { | |
6149 switch (collector_) { | 6166 switch (collector_) { |
6150 case SCAVENGER: | 6167 case SCAVENGER: |
6151 return "Scavenge"; | 6168 return "Scavenge"; |
6152 case MARK_COMPACTOR: | 6169 case MARK_COMPACTOR: |
6153 return "Mark-sweep"; | 6170 return "Mark-sweep"; |
6154 } | 6171 } |
6155 return "Unknown GC"; | 6172 return "Unknown GC"; |
6156 } | 6173 } |
6157 | 6174 |
6158 | 6175 |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6415 static_cast<int>(object_sizes_last_time_[index])); | 6432 static_cast<int>(object_sizes_last_time_[index])); |
6416 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6433 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6417 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6434 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6418 | 6435 |
6419 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6436 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6420 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6437 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6421 ClearObjectStats(); | 6438 ClearObjectStats(); |
6422 } | 6439 } |
6423 | 6440 |
6424 } } // namespace v8::internal | 6441 } } // namespace v8::internal |
OLD | NEW |