From 8e749aaafdb8d7a02046b2ef1e8df6f535300851 Mon Sep 17 00:00:00 2001 From: "hpayer@chromium.org" Date: Wed, 19 Mar 2014 09:27:42 +0000 Subject: [PATCH] Added sweeping time measurement for old space sweeping. BUG= R=mstarzinger@chromium.org Review URL: https://codereview.chromium.org/203263014 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20050 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/heap.cc | 5 +++-- src/heap.h | 1 + src/mark-compact.cc | 24 +++++++++++++----------- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/heap.cc b/src/heap.cc index 4855ac0..2f983dc 100644 --- a/src/heap.cc +++ b/src/heap.cc @@ -7431,8 +7431,9 @@ GCTracer::~GCTracer() { PrintF("external=%.1f ", scopes_[Scope::EXTERNAL]); PrintF("mark=%.1f ", scopes_[Scope::MC_MARK]); - PrintF("sweep=%.1f ", scopes_[Scope::MC_SWEEP]); - PrintF("sweepns=%.1f ", scopes_[Scope::MC_SWEEP_NEWSPACE]); + PrintF("sweep=%.2f ", scopes_[Scope::MC_SWEEP]); + PrintF("sweepns=%.2f ", scopes_[Scope::MC_SWEEP_NEWSPACE]); + PrintF("sweepos=%.2f ", scopes_[Scope::MC_SWEEP_OLDSPACE]); PrintF("evacuate=%.1f ", scopes_[Scope::MC_EVACUATE_PAGES]); PrintF("new_new=%.1f ", scopes_[Scope::MC_UPDATE_NEW_TO_NEW_POINTERS]); PrintF("root_new=%.1f ", scopes_[Scope::MC_UPDATE_ROOT_TO_NEW_POINTERS]); diff --git a/src/heap.h b/src/heap.h index 393f46e..8511ed4 100644 --- a/src/heap.h +++ b/src/heap.h @@ -2877,6 +2877,7 @@ class GCTracer BASE_EMBEDDED { MC_MARK, MC_SWEEP, MC_SWEEP_NEWSPACE, + MC_SWEEP_OLDSPACE, MC_EVACUATE_PAGES, MC_UPDATE_NEW_TO_NEW_POINTERS, MC_UPDATE_ROOT_TO_NEW_POINTERS, diff --git a/src/mark-compact.cc b/src/mark-compact.cc index 810f25d..cfaa587 100644 --- a/src/mark-compact.cc +++ b/src/mark-compact.cc @@ -4240,20 +4240,22 @@ void MarkCompactCollector::SweepSpaces() { // the map space last because freeing non-live maps overwrites them and // the other spaces rely on possibly non-live maps to get the sizes for // non-live objects. - SequentialSweepingScope scope(this); - SweepSpace(heap()->old_pointer_space(), how_to_sweep); - SweepSpace(heap()->old_data_space(), how_to_sweep); + { GCTracer::Scope sweep_scope(tracer_, GCTracer::Scope::MC_SWEEP_OLDSPACE); + { SequentialSweepingScope scope(this); + SweepSpace(heap()->old_pointer_space(), how_to_sweep); + SweepSpace(heap()->old_data_space(), how_to_sweep); + } - if (how_to_sweep == PARALLEL_CONSERVATIVE || - how_to_sweep == CONCURRENT_CONSERVATIVE) { - // TODO(hpayer): fix race with concurrent sweeper - StartSweeperThreads(); - } + if (how_to_sweep == PARALLEL_CONSERVATIVE || + how_to_sweep == CONCURRENT_CONSERVATIVE) { + // TODO(hpayer): fix race with concurrent sweeper + StartSweeperThreads(); + } - if (how_to_sweep == PARALLEL_CONSERVATIVE) { - WaitUntilSweepingCompleted(); + if (how_to_sweep == PARALLEL_CONSERVATIVE) { + WaitUntilSweepingCompleted(); + } } - RemoveDeadInvalidatedCode(); SweepSpace(heap()->code_space(), PRECISE); -- 2.7.4