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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
106 semi_space_copied_object_size_(0), | 106 semi_space_copied_object_size_(0), |
107 semi_space_copied_rate_(0), | 107 semi_space_copied_rate_(0), |
108 nodes_died_in_new_space_(0), | 108 nodes_died_in_new_space_(0), |
109 nodes_copied_in_new_space_(0), | 109 nodes_copied_in_new_space_(0), |
110 nodes_promoted_(0), | 110 nodes_promoted_(0), |
111 maximum_size_scavenges_(0), | 111 maximum_size_scavenges_(0), |
112 max_gc_pause_(0.0), | 112 max_gc_pause_(0.0), |
113 total_gc_time_ms_(0.0), | 113 total_gc_time_ms_(0.0), |
114 max_alive_after_gc_(0), | 114 max_alive_after_gc_(0), |
115 min_in_mutator_(kMaxInt), | 115 min_in_mutator_(kMaxInt), |
116 alive_after_last_gc_(0), | |
117 last_gc_end_timestamp_(base::OS::TimeCurrentMillis()), | |
118 marking_time_(0.0), | 116 marking_time_(0.0), |
119 sweeping_time_(0.0), | 117 sweeping_time_(0.0), |
120 mark_compact_collector_(this), | 118 mark_compact_collector_(this), |
121 store_buffer_(this), | 119 store_buffer_(this), |
122 marking_(this), | 120 marking_(this), |
123 incremental_marking_(this), | 121 incremental_marking_(this), |
124 number_idle_notifications_(0), | 122 number_idle_notifications_(0), |
125 last_idle_notification_gc_count_(0), | 123 last_idle_notification_gc_count_(0), |
126 last_idle_notification_gc_count_init_(false), | 124 last_idle_notification_gc_count_init_(false), |
127 mark_sweeps_since_idle_round_started_(0), | 125 mark_sweeps_since_idle_round_started_(0), |
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
833 if (FLAG_trace_incremental_marking) { | 831 if (FLAG_trace_incremental_marking) { |
834 PrintF("[IncrementalMarking] Delaying MarkSweep.\n"); | 832 PrintF("[IncrementalMarking] Delaying MarkSweep.\n"); |
835 } | 833 } |
836 collector = SCAVENGER; | 834 collector = SCAVENGER; |
837 collector_reason = "incremental marking delaying mark-sweep"; | 835 collector_reason = "incremental marking delaying mark-sweep"; |
838 } | 836 } |
839 } | 837 } |
840 | 838 |
841 bool next_gc_likely_to_collect_more = false; | 839 bool next_gc_likely_to_collect_more = false; |
842 | 840 |
843 { tracer()->start(collector, gc_reason, collector_reason); | 841 { tracer()->Start(collector, gc_reason, collector_reason); |
844 ASSERT(AllowHeapAllocation::IsAllowed()); | 842 ASSERT(AllowHeapAllocation::IsAllowed()); |
845 DisallowHeapAllocation no_allocation_during_gc; | 843 DisallowHeapAllocation no_allocation_during_gc; |
846 GarbageCollectionPrologue(); | 844 GarbageCollectionPrologue(); |
847 | 845 |
848 { | 846 { |
849 HistogramTimerScope histogram_timer_scope( | 847 HistogramTimerScope histogram_timer_scope( |
850 (collector == SCAVENGER) ? isolate_->counters()->gc_scavenger() | 848 (collector == SCAVENGER) ? isolate_->counters()->gc_scavenger() |
851 : isolate_->counters()->gc_compactor()); | 849 : isolate_->counters()->gc_compactor()); |
852 next_gc_likely_to_collect_more = | 850 next_gc_likely_to_collect_more = |
853 PerformGarbageCollection(collector, gc_callback_flags); | 851 PerformGarbageCollection(collector, gc_callback_flags); |
854 } | 852 } |
855 | 853 |
856 GarbageCollectionEpilogue(); | 854 GarbageCollectionEpilogue(); |
857 tracer()->stop(); | 855 tracer()->Stop(); |
858 } | 856 } |
859 | 857 |
860 // Start incremental marking for the next cycle. The heap snapshot | 858 // Start incremental marking for the next cycle. The heap snapshot |
861 // generator needs incremental marking to stay off after it aborted. | 859 // generator needs incremental marking to stay off after it aborted. |
862 if (!mark_compact_collector()->abort_incremental_marking() && | 860 if (!mark_compact_collector()->abort_incremental_marking() && |
863 incremental_marking()->IsStopped() && | 861 incremental_marking()->IsStopped() && |
864 incremental_marking()->WorthActivating() && | 862 incremental_marking()->WorthActivating() && |
865 NextGCIsLikelyToBeFull()) { | 863 NextGCIsLikelyToBeFull()) { |
866 incremental_marking()->Start(); | 864 incremental_marking()->Start(); |
867 } | 865 } |
(...skipping 5083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5951 OldSpaces spaces(heap); | 5949 OldSpaces spaces(heap); |
5952 for (OldSpace* space = spaces.next(); | 5950 for (OldSpace* space = spaces.next(); |
5953 space != NULL; | 5951 space != NULL; |
5954 space = spaces.next()) { | 5952 space = spaces.next()) { |
5955 holes_size += space->Waste() + space->Available(); | 5953 holes_size += space->Waste() + space->Available(); |
5956 } | 5954 } |
5957 return holes_size; | 5955 return holes_size; |
5958 } | 5956 } |
5959 | 5957 |
5960 | 5958 |
5961 void Heap::UpdateGCStatistics(double start_time, | 5959 void Heap::UpdateCumulativeGCStatistics(double duration, |
5962 double end_time, | 5960 double spent_in_mutator, |
5963 double spent_in_mutator, | 5961 double marking_time) { |
5964 double marking_time) { | |
5965 double duration = end_time - start_time; | |
5966 alive_after_last_gc_ = SizeOfObjects(); | |
5967 last_gc_end_timestamp_ = end_time; | |
5968 | |
5969 if (FLAG_print_cumulative_gc_stat) { | 5962 if (FLAG_print_cumulative_gc_stat) { |
5970 total_gc_time_ms_ += duration; | 5963 total_gc_time_ms_ += duration; |
5971 max_gc_pause_ = Max(max_gc_pause_, duration); | 5964 max_gc_pause_ = Max(max_gc_pause_, duration); |
5972 max_alive_after_gc_ = Max(max_alive_after_gc_, alive_after_last_gc_); | 5965 max_alive_after_gc_ = Max(max_alive_after_gc_, SizeOfObjects()); |
5973 min_in_mutator_ = Min(min_in_mutator_, spent_in_mutator); | 5966 min_in_mutator_ = Min(min_in_mutator_, spent_in_mutator); |
5974 } else if (FLAG_trace_gc_verbose) { | 5967 } else if (FLAG_trace_gc_verbose) { |
5975 total_gc_time_ms_ += duration; | 5968 total_gc_time_ms_ += duration; |
5976 } | 5969 } |
5977 | 5970 |
5978 marking_time_ += marking_time; | 5971 marking_time_ += marking_time; |
5979 } | 5972 } |
5980 | 5973 |
5974 GCTracer::Event::Event() | |
5975 : collector(MARK_COMPACTOR), | |
5976 gc_reason(NULL), | |
5977 collector_reason(NULL), | |
5978 start_time(0.0), | |
5979 end_time(0.0), | |
5980 start_object_size(0), | |
5981 end_object_size(0), | |
5982 start_memory_size(0), | |
5983 end_memory_size(0), | |
5984 start_holes_size(0), | |
5985 end_holes_size(0), | |
5986 incremental_marking_steps(0), | |
5987 incremental_marking_duration(0.0) { | |
5988 for (int i = 0; i < Scope::NUMBER_OF_SCOPES; i++) { | |
5989 scopes[i] = 0; | |
5990 } | |
5991 } | |
5992 | |
5993 GCTracer::Event::Event(GarbageCollector collector, | |
5994 const char* gc_reason, | |
5995 const char* collector_reason) | |
5996 : collector(collector), | |
5997 gc_reason(gc_reason), | |
5998 collector_reason(collector_reason), | |
5999 start_time(0.0), | |
6000 end_time(0.0), | |
6001 start_object_size(0), | |
6002 end_object_size(0), | |
6003 start_memory_size(0), | |
6004 end_memory_size(0), | |
6005 start_holes_size(0), | |
6006 end_holes_size(0), | |
6007 incremental_marking_steps(0), | |
6008 incremental_marking_duration(0.0) { | |
6009 for (int i = 0; i < Scope::NUMBER_OF_SCOPES; i++) { | |
6010 scopes[i] = 0; | |
6011 } | |
6012 } | |
6013 | |
5981 | 6014 |
5982 GCTracer::GCTracer(Heap* heap) | 6015 GCTracer::GCTracer(Heap* heap) |
5983 : start_time_(0.0), | 6016 : heap_(heap), |
5984 end_time_(0.0), | 6017 incremental_marking_steps_(0), |
5985 start_object_size_(0), | 6018 incremental_marking_duration_(0.0), |
5986 end_object_size_(0), | 6019 longest_incremental_marking_step_(0.0) { |
5987 start_memory_size_(0), | 6020 double time = base::OS::TimeCurrentMillis(); |
5988 end_memory_size_(0), | 6021 |
5989 in_free_list_or_wasted_before_gc_(0), | 6022 Event mark_compactor_dummy_event(MARK_COMPACTOR, NULL, NULL); |
Hannes Payer (out of office)
2014/07/22 09:10:17
Hmm, I am not sure if the dummy elements may be pr
ernstm
2014/07/22 14:09:28
Good point. I've added a type to the Event that wi
| |
5990 allocated_since_last_gc_(0), | 6023 mark_compactor_dummy_event.end_time = time; |
5991 spent_in_mutator_(0), | 6024 event_buffers_[MARK_COMPACTOR].push_back(mark_compactor_dummy_event); |
5992 steps_count_(0), | 6025 |
5993 steps_took_(0.0), | 6026 Event scavenger_dummy_event(SCAVENGER, NULL, NULL); |
5994 longest_step_(0.0), | 6027 scavenger_dummy_event.end_time = time; |
5995 steps_count_since_last_gc_(0), | 6028 event_buffers_[SCAVENGER].push_back(scavenger_dummy_event); |
5996 steps_took_since_last_gc_(0.0), | 6029 } |
5997 heap_(heap), | 6030 |
5998 gc_reason_(NULL), | 6031 |
5999 collector_reason_(NULL) { | 6032 void GCTracer::Start(GarbageCollector collector, |
6033 const char* gc_reason, | |
6034 const char* collector_reason) { | |
6035 if (!FLAG_trace_gc && !FLAG_print_cumulative_gc_stat) return; | |
6036 | |
6037 pending_ = Event(collector, gc_reason, collector_reason); | |
6038 | |
6039 pending_.start_time = base::OS::TimeCurrentMillis(); | |
6040 pending_.start_object_size = heap_->SizeOfObjects(); | |
6041 pending_.start_memory_size = heap_->isolate()->memory_allocator()->Size(); | |
6042 pending_.start_holes_size = CountTotalHolesSize(heap_); | |
6043 | |
6044 pending_.incremental_marking_steps = incremental_marking_steps_; | |
6045 pending_.incremental_marking_duration = incremental_marking_duration_; | |
6046 pending_.longest_incremental_marking_step = longest_incremental_marking_step_; | |
6047 | |
6000 for (int i = 0; i < Scope::NUMBER_OF_SCOPES; i++) { | 6048 for (int i = 0; i < Scope::NUMBER_OF_SCOPES; i++) { |
6001 scopes_[i] = 0; | 6049 pending_.scopes[i] = 0; |
6002 } | 6050 } |
6003 } | 6051 } |
6004 | 6052 |
6005 | 6053 |
6006 void GCTracer::start(GarbageCollector collector, | 6054 void GCTracer::Stop() { |
6007 const char* gc_reason, | |
6008 const char* collector_reason) { | |
6009 if (!FLAG_trace_gc && !FLAG_print_cumulative_gc_stat) return; | 6055 if (!FLAG_trace_gc && !FLAG_print_cumulative_gc_stat) return; |
6010 | 6056 |
6011 collector_ = collector; | 6057 pending_.end_time = base::OS::TimeCurrentMillis(); |
6012 gc_reason_ = gc_reason; | 6058 pending_.end_object_size = heap_->SizeOfObjects(); |
6013 collector_reason_ = collector_reason; | 6059 pending_.end_memory_size = heap_->isolate()->memory_allocator()->Size(); |
6060 pending_.end_holes_size = CountTotalHolesSize(heap_); | |
6014 | 6061 |
6015 start_time_ = base::OS::TimeCurrentMillis(); | 6062 event_buffers_[pending_.collector].push_back(pending_); |
6016 start_object_size_ = heap_->SizeOfObjects(); | |
6017 start_memory_size_ = heap_->isolate()->memory_allocator()->Size(); | |
6018 | 6063 |
6019 for (int i = 0; i < Scope::NUMBER_OF_SCOPES; i++) { | 6064 if (pending_.collector == MARK_COMPACTOR) |
6020 scopes_[i] = 0; | 6065 longest_incremental_marking_step_ = 0.0; |
6021 } | |
6022 | 6066 |
6023 in_free_list_or_wasted_before_gc_ = CountTotalHolesSize(heap_); | 6067 double duration = pending_.end_time - pending_.start_time; |
6068 double spent_in_mutator = | |
6069 Max(pending_.start_time - Previous()->end_time, 0.0); | |
6024 | 6070 |
6025 allocated_since_last_gc_ = | 6071 heap_->UpdateCumulativeGCStatistics(duration, |
6026 heap_->SizeOfObjects() - heap_->alive_after_last_gc_; | 6072 spent_in_mutator, |
6073 Current()->scopes[Scope::MC_MARK]); | |
6027 | 6074 |
6028 spent_in_mutator_ = Max(start_time_ - heap_->last_gc_end_timestamp_, 0.0); | 6075 if (Current()->collector == SCAVENGER && FLAG_trace_gc_ignore_scavenger) |
6029 | 6076 return; |
6030 steps_count_ = heap_->incremental_marking()->steps_count(); | |
6031 steps_took_ = heap_->incremental_marking()->steps_took(); | |
6032 longest_step_ = heap_->incremental_marking()->longest_step(); | |
6033 steps_count_since_last_gc_ = | |
6034 heap_->incremental_marking()->steps_count_since_last_gc(); | |
6035 steps_took_since_last_gc_ = | |
6036 heap_->incremental_marking()->steps_took_since_last_gc(); | |
6037 } | |
6038 | |
6039 | |
6040 void GCTracer::stop() { | |
6041 if (!FLAG_trace_gc && !FLAG_print_cumulative_gc_stat) return; | |
6042 | |
6043 end_time_ = base::OS::TimeCurrentMillis(); | |
6044 end_object_size_ = heap_->SizeOfObjects(); | |
6045 end_memory_size_ = heap_->isolate()->memory_allocator()->Size(); | |
6046 | |
6047 heap_->UpdateGCStatistics(start_time_, | |
6048 end_time_, | |
6049 spent_in_mutator_, | |
6050 scopes_[Scope::MC_MARK]); | |
6051 | |
6052 if (collector_ == SCAVENGER && FLAG_trace_gc_ignore_scavenger) return; | |
6053 | 6077 |
6054 if (FLAG_trace_gc) { | 6078 if (FLAG_trace_gc) { |
6055 if (FLAG_trace_gc_nvp) | 6079 if (FLAG_trace_gc_nvp) |
6056 PrintNVP(); | 6080 PrintNVP(); |
6057 else | 6081 else |
6058 Print(); | 6082 Print(); |
6059 | 6083 |
6060 heap_->PrintShortHeapStatistics(); | 6084 heap_->PrintShortHeapStatistics(); |
6061 } | 6085 } |
6062 } | 6086 } |
6063 | 6087 |
6064 | 6088 |
6089 void GCTracer::AddIncrementalMarkingStep(double duration) { | |
6090 incremental_marking_steps_++; | |
6091 incremental_marking_duration_ += duration; | |
6092 longest_incremental_marking_step_ = | |
6093 Max(longest_incremental_marking_step_, duration); | |
6094 } | |
6095 | |
6096 | |
6097 GCTracer::EventBuffer::const_iterator GCTracer::Current() const { | |
6098 if (event_buffers_[SCAVENGER].back()->end_time >= | |
6099 event_buffers_[MARK_COMPACTOR].back()->end_time) | |
6100 return event_buffers_[SCAVENGER].back(); | |
6101 else | |
6102 return event_buffers_[MARK_COMPACTOR].back(); | |
6103 } | |
6104 | |
6105 | |
6106 GCTracer::EventBuffer::const_iterator GCTracer::Previous() const { | |
6107 EventBuffer::const_iterator current = this->Current(); | |
6108 EventBuffer::const_iterator previous = current; | |
6109 --previous; | |
6110 GarbageCollector other_buffer = | |
6111 (current->collector == SCAVENGER) ? MARK_COMPACTOR : SCAVENGER; | |
6112 if (!previous || | |
6113 event_buffers_[other_buffer].back()->end_time > previous->end_time) | |
6114 previous = event_buffers_[other_buffer].back(); | |
6115 | |
6116 return previous; | |
6117 } | |
6118 | |
6119 | |
6065 void GCTracer::Print() const { | 6120 void GCTracer::Print() const { |
6121 EventBuffer::const_iterator current = Current(); | |
6122 EventBuffer::const_iterator previous = Previous(); | |
6123 | |
6066 PrintPID("%8.0f ms: ", heap_->isolate()->time_millis_since_init()); | 6124 PrintPID("%8.0f ms: ", heap_->isolate()->time_millis_since_init()); |
6067 | 6125 |
6068 PrintF("%s %.1f (%.1f) -> %.1f (%.1f) MB, ", | 6126 PrintF("%s %.1f (%.1f) -> %.1f (%.1f) MB, ", |
6069 CollectorString(), | 6127 CollectorString(current->collector, false), |
6070 static_cast<double>(start_object_size_) / MB, | 6128 static_cast<double>(current->start_object_size) / MB, |
6071 static_cast<double>(start_memory_size_) / MB, | 6129 static_cast<double>(current->start_memory_size) / MB, |
6072 static_cast<double>(end_object_size_) / MB, | 6130 static_cast<double>(current->end_object_size) / MB, |
6073 static_cast<double>(end_memory_size_) / MB); | 6131 static_cast<double>(current->end_memory_size) / MB); |
6074 | 6132 |
6075 int external_time = static_cast<int>(scopes_[Scope::EXTERNAL]); | 6133 int external_time = static_cast<int>(current->scopes[Scope::EXTERNAL]); |
6076 if (external_time > 0) PrintF("%d / ", external_time); | 6134 if (external_time > 0) PrintF("%d / ", external_time); |
6077 | 6135 |
6078 PrintF("%.1f ms", end_time_ - start_time_); | 6136 double duration = current->end_time - current->start_time; |
6079 if (steps_count_ > 0) { | 6137 PrintF("%.1f ms", duration); |
6080 if (collector_ == SCAVENGER) { | 6138 if (current->collector == SCAVENGER) { |
6139 int steps = current->incremental_marking_steps - | |
6140 previous->incremental_marking_steps; | |
6141 if (steps > 0) { | |
6081 PrintF(" (+ %.1f ms in %d steps since last GC)", | 6142 PrintF(" (+ %.1f ms in %d steps since last GC)", |
6082 steps_took_since_last_gc_, | 6143 current->incremental_marking_duration - |
6083 steps_count_since_last_gc_); | 6144 previous->incremental_marking_duration, |
6084 } else { | 6145 steps); |
6146 } | |
6147 } else { | |
6148 EventBuffer::const_iterator previous_mark_compactor = current; | |
6149 --previous_mark_compactor; | |
6150 int steps = current->incremental_marking_steps - | |
6151 previous_mark_compactor->incremental_marking_steps; | |
6152 if (steps > 0) { | |
6085 PrintF(" (+ %.1f ms in %d steps since start of marking, " | 6153 PrintF(" (+ %.1f ms in %d steps since start of marking, " |
6086 "biggest step %.1f ms)", | 6154 "biggest step %.1f ms)", |
6087 steps_took_, | 6155 current->incremental_marking_duration - |
6088 steps_count_, | 6156 previous_mark_compactor->incremental_marking_duration, |
6089 longest_step_); | 6157 steps, |
6158 current->longest_incremental_marking_step); | |
6090 } | 6159 } |
6091 } | 6160 } |
6092 | 6161 |
6093 if (gc_reason_ != NULL) { | 6162 if (current->gc_reason != NULL) { |
6094 PrintF(" [%s]", gc_reason_); | 6163 PrintF(" [%s]", current->gc_reason); |
6095 } | 6164 } |
6096 | 6165 |
6097 if (collector_reason_ != NULL) { | 6166 if (current->collector_reason != NULL) { |
6098 PrintF(" [%s]", collector_reason_); | 6167 PrintF(" [%s]", current->collector_reason); |
6099 } | 6168 } |
6100 | 6169 |
6101 PrintF(".\n"); | 6170 PrintF(".\n"); |
6102 } | 6171 } |
6103 | 6172 |
6104 | 6173 |
6105 void GCTracer::PrintNVP() const { | 6174 void GCTracer::PrintNVP() const { |
6175 EventBuffer::const_iterator current = Current(); | |
6176 EventBuffer::const_iterator previous = Previous(); | |
6177 | |
6106 PrintPID("%8.0f ms: ", heap_->isolate()->time_millis_since_init()); | 6178 PrintPID("%8.0f ms: ", heap_->isolate()->time_millis_since_init()); |
6107 | 6179 |
6108 PrintF("pause=%.1f ", end_time_ - start_time_); | 6180 double duration = current->end_time - current->start_time; |
6109 PrintF("mutator=%.1f ", spent_in_mutator_); | 6181 double spent_in_mutator = current->start_time - previous->end_time; |
6110 PrintF("gc="); | |
6111 switch (collector_) { | |
6112 case SCAVENGER: | |
6113 PrintF("s"); | |
6114 break; | |
6115 case MARK_COMPACTOR: | |
6116 PrintF("ms"); | |
6117 break; | |
6118 default: | |
6119 UNREACHABLE(); | |
6120 } | |
6121 PrintF(" "); | |
6122 | 6182 |
6123 PrintF("external=%.1f ", scopes_[Scope::EXTERNAL]); | 6183 PrintF("pause=%.1f ", duration); |
6124 PrintF("mark=%.1f ", scopes_[Scope::MC_MARK]); | 6184 PrintF("mutator=%.1f ", spent_in_mutator); |
6125 PrintF("sweep=%.2f ", scopes_[Scope::MC_SWEEP]); | 6185 PrintF("gc=%s ", CollectorString(current->collector, true)); |
6126 PrintF("sweepns=%.2f ", scopes_[Scope::MC_SWEEP_NEWSPACE]); | 6186 |
6127 PrintF("sweepos=%.2f ", scopes_[Scope::MC_SWEEP_OLDSPACE]); | 6187 PrintF("external=%.1f ", current->scopes[Scope::EXTERNAL]); |
6128 PrintF("sweepcode=%.2f ", scopes_[Scope::MC_SWEEP_CODE]); | 6188 PrintF("mark=%.1f ", current->scopes[Scope::MC_MARK]); |
6129 PrintF("sweepcell=%.2f ", scopes_[Scope::MC_SWEEP_CELL]); | 6189 PrintF("sweep=%.2f ", current->scopes[Scope::MC_SWEEP]); |
6130 PrintF("sweepmap=%.2f ", scopes_[Scope::MC_SWEEP_MAP]); | 6190 PrintF("sweepns=%.2f ", current->scopes[Scope::MC_SWEEP_NEWSPACE]); |
6131 PrintF("evacuate=%.1f ", scopes_[Scope::MC_EVACUATE_PAGES]); | 6191 PrintF("sweepos=%.2f ", current->scopes[Scope::MC_SWEEP_OLDSPACE]); |
6132 PrintF("new_new=%.1f ", scopes_[Scope::MC_UPDATE_NEW_TO_NEW_POINTERS]); | 6192 PrintF("sweepcode=%.2f ", current->scopes[Scope::MC_SWEEP_CODE]); |
6133 PrintF("root_new=%.1f ", scopes_[Scope::MC_UPDATE_ROOT_TO_NEW_POINTERS]); | 6193 PrintF("sweepcell=%.2f ", current->scopes[Scope::MC_SWEEP_CELL]); |
6134 PrintF("old_new=%.1f ", scopes_[Scope::MC_UPDATE_OLD_TO_NEW_POINTERS]); | 6194 PrintF("sweepmap=%.2f ", current->scopes[Scope::MC_SWEEP_MAP]); |
6195 PrintF("evacuate=%.1f ", current->scopes[Scope::MC_EVACUATE_PAGES]); | |
6196 PrintF("new_new=%.1f ", | |
6197 current->scopes[Scope::MC_UPDATE_NEW_TO_NEW_POINTERS]); | |
6198 PrintF("root_new=%.1f ", | |
6199 current->scopes[Scope::MC_UPDATE_ROOT_TO_NEW_POINTERS]); | |
6200 PrintF("old_new=%.1f ", | |
6201 current->scopes[Scope::MC_UPDATE_OLD_TO_NEW_POINTERS]); | |
6135 PrintF("compaction_ptrs=%.1f ", | 6202 PrintF("compaction_ptrs=%.1f ", |
6136 scopes_[Scope::MC_UPDATE_POINTERS_TO_EVACUATED]); | 6203 current->scopes[Scope::MC_UPDATE_POINTERS_TO_EVACUATED]); |
6137 PrintF("intracompaction_ptrs=%.1f ", | 6204 PrintF("intracompaction_ptrs=%.1f ", |
6138 scopes_[Scope::MC_UPDATE_POINTERS_BETWEEN_EVACUATED]); | 6205 current->scopes[Scope::MC_UPDATE_POINTERS_BETWEEN_EVACUATED]); |
6139 PrintF("misc_compaction=%.1f ", scopes_[Scope::MC_UPDATE_MISC_POINTERS]); | 6206 PrintF("misc_compaction=%.1f ", |
6207 current->scopes[Scope::MC_UPDATE_MISC_POINTERS]); | |
6140 PrintF("weakcollection_process=%.1f ", | 6208 PrintF("weakcollection_process=%.1f ", |
6141 scopes_[Scope::MC_WEAKCOLLECTION_PROCESS]); | 6209 current->scopes[Scope::MC_WEAKCOLLECTION_PROCESS]); |
6142 PrintF("weakcollection_clear=%.1f ", | 6210 PrintF("weakcollection_clear=%.1f ", |
6143 scopes_[Scope::MC_WEAKCOLLECTION_CLEAR]); | 6211 current->scopes[Scope::MC_WEAKCOLLECTION_CLEAR]); |
6144 | 6212 |
6145 PrintF("total_size_before=%" V8_PTR_PREFIX "d ", start_object_size_); | 6213 PrintF("total_size_before=%" V8_PTR_PREFIX "d ", current->start_object_size); |
6146 PrintF("total_size_after=%" V8_PTR_PREFIX "d ", end_object_size_); | 6214 PrintF("total_size_after=%" V8_PTR_PREFIX "d ", current->end_object_size); |
6147 PrintF("holes_size_before=%" V8_PTR_PREFIX "d ", | 6215 PrintF("holes_size_before=%" V8_PTR_PREFIX "d ", current->start_holes_size); |
6148 in_free_list_or_wasted_before_gc_); | 6216 PrintF("holes_size_after=%" V8_PTR_PREFIX "d ", current->end_holes_size); |
6149 PrintF("holes_size_after=%" V8_PTR_PREFIX "d ", CountTotalHolesSize(heap_)); | |
6150 | 6217 |
6151 PrintF("allocated=%" V8_PTR_PREFIX "d ", allocated_since_last_gc_); | 6218 intptr_t allocated_since_last_gc = |
6219 current->start_object_size - previous->end_object_size; | |
6220 PrintF("allocated=%" V8_PTR_PREFIX "d ", allocated_since_last_gc); | |
6152 PrintF("promoted=%" V8_PTR_PREFIX "d ", heap_->promoted_objects_size_); | 6221 PrintF("promoted=%" V8_PTR_PREFIX "d ", heap_->promoted_objects_size_); |
6153 PrintF("semi_space_copied=%" V8_PTR_PREFIX "d ", | 6222 PrintF("semi_space_copied=%" V8_PTR_PREFIX "d ", |
6154 heap_->semi_space_copied_object_size_); | 6223 heap_->semi_space_copied_object_size_); |
6155 PrintF("nodes_died_in_new=%d ", heap_->nodes_died_in_new_space_); | 6224 PrintF("nodes_died_in_new=%d ", heap_->nodes_died_in_new_space_); |
6156 PrintF("nodes_copied_in_new=%d ", heap_->nodes_copied_in_new_space_); | 6225 PrintF("nodes_copied_in_new=%d ", heap_->nodes_copied_in_new_space_); |
6157 PrintF("nodes_promoted=%d ", heap_->nodes_promoted_); | 6226 PrintF("nodes_promoted=%d ", heap_->nodes_promoted_); |
6158 PrintF("promotion_rate=%.1f%% ", heap_->promotion_rate_); | 6227 PrintF("promotion_rate=%.1f%% ", heap_->promotion_rate_); |
6159 PrintF("semi_space_copy_rate=%.1f%% ", heap_->semi_space_copied_rate_); | 6228 PrintF("semi_space_copy_rate=%.1f%% ", heap_->semi_space_copied_rate_); |
6160 | 6229 |
6161 if (collector_ == SCAVENGER) { | 6230 if (current->collector == SCAVENGER) { |
6162 PrintF("stepscount=%d ", steps_count_since_last_gc_); | 6231 PrintF("stepscount=%d ", current->incremental_marking_steps - |
6163 PrintF("stepstook=%.1f ", steps_took_since_last_gc_); | 6232 previous->incremental_marking_steps); |
6233 PrintF("stepstook=%.1f ", current->incremental_marking_duration - | |
6234 previous->incremental_marking_duration); | |
6164 } else { | 6235 } else { |
6165 PrintF("stepscount=%d ", steps_count_); | 6236 EventBuffer::const_iterator previous_mark_compactor = current; |
6166 PrintF("stepstook=%.1f ", steps_took_); | 6237 --previous_mark_compactor; |
6167 PrintF("longeststep=%.1f ", longest_step_); | 6238 PrintF("stepscount=%d ", current->incremental_marking_steps - |
6239 previous_mark_compactor->incremental_marking_steps); | |
6240 PrintF("stepstook=%.1f ", current->incremental_marking_duration - | |
6241 previous_mark_compactor->incremental_marking_duration); | |
6242 PrintF("longeststep=%.1f ", current->longest_incremental_marking_step); | |
6168 } | 6243 } |
6169 | 6244 |
6170 PrintF("\n"); | 6245 PrintF("\n"); |
6171 } | 6246 } |
6172 | 6247 |
6173 | 6248 |
6174 const char* GCTracer::CollectorString() const { | 6249 const char* GCTracer::CollectorString(GarbageCollector collector, |
6175 switch (collector_) { | 6250 bool short_name) const { |
6251 switch (collector) { | |
6176 case SCAVENGER: | 6252 case SCAVENGER: |
6177 return "Scavenge"; | 6253 if (short_name) |
6254 return "s"; | |
6255 else | |
6256 return "Scavenge"; | |
6178 case MARK_COMPACTOR: | 6257 case MARK_COMPACTOR: |
6179 return "Mark-sweep"; | 6258 if (short_name) |
6259 return "ms"; | |
6260 else | |
6261 return "Mark-sweep"; | |
6180 } | 6262 } |
6181 return "Unknown GC"; | 6263 return "Unknown GC"; |
6182 } | 6264 } |
6183 | 6265 |
6184 | 6266 |
6185 int KeyedLookupCache::Hash(Handle<Map> map, Handle<Name> name) { | 6267 int KeyedLookupCache::Hash(Handle<Map> map, Handle<Name> name) { |
6186 DisallowHeapAllocation no_gc; | 6268 DisallowHeapAllocation no_gc; |
6187 // Uses only lower 32 bits if pointers are larger. | 6269 // Uses only lower 32 bits if pointers are larger. |
6188 uintptr_t addr_hash = | 6270 uintptr_t addr_hash = |
6189 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(*map)) >> kMapHashShift; | 6271 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(*map)) >> kMapHashShift; |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6441 static_cast<int>(object_sizes_last_time_[index])); | 6523 static_cast<int>(object_sizes_last_time_[index])); |
6442 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6524 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6443 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6525 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6444 | 6526 |
6445 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6527 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6446 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6528 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6447 ClearObjectStats(); | 6529 ClearObjectStats(); |
6448 } | 6530 } |
6449 | 6531 |
6450 } } // namespace v8::internal | 6532 } } // namespace v8::internal |
OLD | NEW |