Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(773)

Side by Side Diff: src/heap.cc

Issue 11595006: Precisely measure duration of mark and sweep phases. Changed print_cumulative_gc_stat flag to only … (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/heap.h ('k') | src/incremental-marking.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 low_survival_rate_period_length_(0), 139 low_survival_rate_period_length_(0),
140 survival_rate_(0), 140 survival_rate_(0),
141 previous_survival_rate_trend_(Heap::STABLE), 141 previous_survival_rate_trend_(Heap::STABLE),
142 survival_rate_trend_(Heap::STABLE), 142 survival_rate_trend_(Heap::STABLE),
143 max_gc_pause_(0), 143 max_gc_pause_(0),
144 total_gc_time_ms_(0), 144 total_gc_time_ms_(0),
145 max_alive_after_gc_(0), 145 max_alive_after_gc_(0),
146 min_in_mutator_(kMaxInt), 146 min_in_mutator_(kMaxInt),
147 alive_after_last_gc_(0), 147 alive_after_last_gc_(0),
148 last_gc_end_timestamp_(0.0), 148 last_gc_end_timestamp_(0.0),
149 marking_time_(0.0),
150 sweeping_time_(0.0),
149 store_buffer_(this), 151 store_buffer_(this),
150 marking_(this), 152 marking_(this),
151 incremental_marking_(this), 153 incremental_marking_(this),
152 number_idle_notifications_(0), 154 number_idle_notifications_(0),
153 last_idle_notification_gc_count_(0), 155 last_idle_notification_gc_count_(0),
154 last_idle_notification_gc_count_init_(false), 156 last_idle_notification_gc_count_init_(false),
155 mark_sweeps_since_idle_round_started_(0), 157 mark_sweeps_since_idle_round_started_(0),
156 ms_count_at_last_idle_notification_(0), 158 ms_count_at_last_idle_notification_(0),
157 gc_count_at_last_idle_gc_(0), 159 gc_count_at_last_idle_gc_(0),
158 scavenges_since_last_idle_round_(kIdleScavengeThreshold), 160 scavenges_since_last_idle_round_(kIdleScavengeThreshold),
(...skipping 6067 matching lines...) Expand 10 before | Expand all | Expand 10 after
6226 6228
6227 6229
6228 void Heap::TearDown() { 6230 void Heap::TearDown() {
6229 #ifdef VERIFY_HEAP 6231 #ifdef VERIFY_HEAP
6230 if (FLAG_verify_heap) { 6232 if (FLAG_verify_heap) {
6231 Verify(); 6233 Verify();
6232 } 6234 }
6233 #endif 6235 #endif
6234 6236
6235 if (FLAG_print_cumulative_gc_stat) { 6237 if (FLAG_print_cumulative_gc_stat) {
6236 PrintF("\n\n"); 6238 PrintF("\n");
6237 PrintF("gc_count=%d ", gc_count_); 6239 PrintF("gc_count=%d ", gc_count_);
6238 PrintF("mark_sweep_count=%d ", ms_count_); 6240 PrintF("mark_sweep_count=%d ", ms_count_);
6239 PrintF("max_gc_pause=%d ", get_max_gc_pause()); 6241 PrintF("max_gc_pause=%d ", get_max_gc_pause());
6240 PrintF("total_gc_time=%d ", total_gc_time_ms_); 6242 PrintF("total_gc_time=%d ", total_gc_time_ms_);
6241 PrintF("min_in_mutator=%d ", get_min_in_mutator()); 6243 PrintF("min_in_mutator=%d ", get_min_in_mutator());
6242 PrintF("max_alive_after_gc=%" V8_PTR_PREFIX "d ", 6244 PrintF("max_alive_after_gc=%" V8_PTR_PREFIX "d ",
6243 get_max_alive_after_gc()); 6245 get_max_alive_after_gc());
6246 PrintF("total_marking_time=%f ", marking_time());
6247 PrintF("total_sweeping_time=%f ", sweeping_time());
6244 PrintF("\n\n"); 6248 PrintF("\n\n");
6245 } 6249 }
6246 6250
6247 isolate_->global_handles()->TearDown(); 6251 isolate_->global_handles()->TearDown();
6248 6252
6249 external_string_table_.TearDown(); 6253 external_string_table_.TearDown();
6250 6254
6251 error_object_list_.TearDown(); 6255 error_object_list_.TearDown();
6252 6256
6253 new_space_.TearDown(); 6257 new_space_.TearDown();
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
6926 if (!first_gc) { 6930 if (!first_gc) {
6927 heap_->min_in_mutator_ = Min(heap_->min_in_mutator_, 6931 heap_->min_in_mutator_ = Min(heap_->min_in_mutator_,
6928 static_cast<int>(spent_in_mutator_)); 6932 static_cast<int>(spent_in_mutator_));
6929 } 6933 }
6930 } else if (FLAG_trace_gc_verbose) { 6934 } else if (FLAG_trace_gc_verbose) {
6931 heap_->total_gc_time_ms_ += time; 6935 heap_->total_gc_time_ms_ += time;
6932 } 6936 }
6933 6937
6934 if (collector_ == SCAVENGER && FLAG_trace_gc_ignore_scavenger) return; 6938 if (collector_ == SCAVENGER && FLAG_trace_gc_ignore_scavenger) return;
6935 6939
6940 heap_->AddMarkingTime(scopes_[Scope::MC_MARK]);
6941
6942 if (FLAG_print_cumulative_gc_stat && !FLAG_trace_gc) return;
6936 PrintPID("%8.0f ms: ", heap_->isolate()->time_millis_since_init()); 6943 PrintPID("%8.0f ms: ", heap_->isolate()->time_millis_since_init());
6937 6944
6938 if (!FLAG_trace_gc_nvp) { 6945 if (!FLAG_trace_gc_nvp) {
6939 int external_time = static_cast<int>(scopes_[Scope::EXTERNAL]); 6946 int external_time = static_cast<int>(scopes_[Scope::EXTERNAL]);
6940 6947
6941 double end_memory_size_mb = 6948 double end_memory_size_mb =
6942 static_cast<double>(heap_->isolate()->memory_allocator()->Size()) / MB; 6949 static_cast<double>(heap_->isolate()->memory_allocator()->Size()) / MB;
6943 6950
6944 PrintF("%s %.1f (%.1f) -> %.1f (%.1f) MB, ", 6951 PrintF("%s %.1f (%.1f) -> %.1f (%.1f) MB, ",
6945 CollectorString(), 6952 CollectorString(),
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
7406 static_cast<int>(object_sizes_last_time_[index])); 7413 static_cast<int>(object_sizes_last_time_[index]));
7407 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) 7414 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT)
7408 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7415 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7409 7416
7410 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7417 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
7411 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 7418 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
7412 ClearObjectStats(); 7419 ClearObjectStats();
7413 } 7420 }
7414 7421
7415 } } // namespace v8::internal 7422 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/incremental-marking.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698