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

Unified Diff: src/mark-compact.cc

Issue 432743002: Clean-up and repair cumulative marking and sweeping time stats. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/incremental-marking.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index f75db472d2b53cb16279e61854b1cd2c551e083a..9dbadacfb86b49785a7c78c43c8b5087f555fbc8 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -2291,6 +2291,10 @@ void MarkCompactCollector::ProcessTopOptimizedFrame(ObjectVisitor* visitor) {
void MarkCompactCollector::MarkLiveObjects() {
GCTracer::Scope gc_scope(heap()->tracer(), GCTracer::Scope::MC_MARK);
+ double start_time = 0.0;
+ if (FLAG_print_cumulative_gc_stat) {
+ start_time = base::OS::TimeCurrentMillis();
+ }
// The recursive GC marker detects when it is nearing stack overflow,
// and switches to a different marking system. JS interrupts interfere
// with the C stack limit check.
@@ -2395,6 +2399,10 @@ void MarkCompactCollector::MarkLiveObjects() {
ProcessEphemeralMarking(&root_visitor);
AfterMarking();
+
+ if (FLAG_print_cumulative_gc_stat) {
+ heap_->tracer()->AddMarkingTime(base::OS::TimeCurrentMillis() - start_time);
+ }
}
@@ -3284,11 +3292,6 @@ static int SweepPrecisely(PagedSpace* space,
ASSERT(parallelism == MarkCompactCollector::SWEEP_ON_MAIN_THREAD ||
sweeping_mode == SWEEP_ONLY);
- double start_time = 0.0;
- if (FLAG_print_cumulative_gc_stat) {
- start_time = base::OS::TimeCurrentMillis();
- }
-
Address free_start = p->area_start();
ASSERT(reinterpret_cast<intptr_t>(free_start) % (32 * kPointerSize) == 0);
int offsets[16];
@@ -3359,9 +3362,6 @@ static int SweepPrecisely(PagedSpace* space,
#endif
}
p->ResetLiveBytes();
- if (FLAG_print_cumulative_gc_stat) {
- space->heap()->AddSweepingTime(base::OS::TimeCurrentMillis() - start_time);
- }
if (parallelism == MarkCompactCollector::SWEEP_IN_PARALLEL) {
// When concurrent sweeping is active, the page will be marked after
@@ -4308,6 +4308,11 @@ static bool ShouldWaitForSweeperThreads(
void MarkCompactCollector::SweepSpaces() {
GCTracer::Scope gc_scope(heap()->tracer(), GCTracer::Scope::MC_SWEEP);
+ double start_time = 0.0;
+ if (FLAG_print_cumulative_gc_stat) {
+ start_time = base::OS::TimeCurrentMillis();
+ }
+
#ifdef DEBUG
state_ = SWEEP_SPACES;
#endif
@@ -4372,6 +4377,11 @@ void MarkCompactCollector::SweepSpaces() {
// Deallocate evacuated candidate pages.
ReleaseEvacuationCandidates();
+
+ if (FLAG_print_cumulative_gc_stat) {
+ heap_->tracer()->AddSweepingTime(base::OS::TimeCurrentMillis() -
+ start_time);
+ }
}
« no previous file with comments | « src/incremental-marking.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698