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

Unified 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 8 years 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 side-by-side diff with in-line comments
Download patch
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index 4cc47d0405a2dac3fad5b79c8fe9a692b46751af..9477f2e759111ba14f4263b1bfbbdf1e430632ea 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -134,6 +134,8 @@ Heap::Heap()
gc_safe_size_of_old_object_(NULL),
total_regexp_code_generated_(0),
tracer_(NULL),
+ marking_time_(0.0),
+ sweeping_time_(0.0),
young_survivors_after_last_gc_(0),
high_survival_rate_period_length_(0),
low_survival_rate_period_length_(0),
@@ -6233,7 +6235,7 @@ void Heap::TearDown() {
#endif
if (FLAG_print_cumulative_gc_stat) {
- PrintF("\n\n");
+ PrintF("\n");
PrintF("gc_count=%d ", gc_count_);
PrintF("mark_sweep_count=%d ", ms_count_);
PrintF("max_gc_pause=%d ", get_max_gc_pause());
@@ -6241,6 +6243,8 @@ void Heap::TearDown() {
PrintF("min_in_mutator=%d ", get_min_in_mutator());
PrintF("max_alive_after_gc=%" V8_PTR_PREFIX "d ",
get_max_alive_after_gc());
+ PrintF("total_marking_time=%f ", marking_time());
+ PrintF("total_sweeping_time=%f ", sweeping_time());
PrintF("\n\n");
}
@@ -6933,6 +6937,9 @@ GCTracer::~GCTracer() {
if (collector_ == SCAVENGER && FLAG_trace_gc_ignore_scavenger) return;
+ heap_->AddMarkingTime(scopes_[Scope::MC_MARK]);
+
+ if (FLAG_print_cumulative_gc_stat && !FLAG_trace_gc) return;
PrintPID("%8.0f ms: ", heap_->isolate()->time_millis_since_init());
if (!FLAG_trace_gc_nvp) {

Powered by Google App Engine
This is Rietveld 408576698