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

Unified Diff: src/mark-compact.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, 11 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 adbc5e7e549997172f467458d6f1623a2b23f070..e685025554538f57e5384b1544d0b5ca18b247ad 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -2734,6 +2734,11 @@ static void SweepPrecisely(PagedSpace* space,
space->identity() == CODE_SPACE);
ASSERT((p->skip_list() == NULL) || (skip_list_mode == REBUILD_SKIP_LIST));
+ double start_time = 0.0;
+ if (FLAG_print_cumulative_gc_stat) {
+ start_time = OS::TimeCurrentMillis();
+ }
+
MarkBit::CellType* cells = p->markbits()->cells();
p->MarkSweptPrecisely();
@@ -2799,6 +2804,9 @@ static void SweepPrecisely(PagedSpace* space,
space->Free(free_start, static_cast<int>(p->area_end() - free_start));
}
p->ResetLiveBytes();
+ if (FLAG_print_cumulative_gc_stat) {
+ space->heap()->AddSweepingTime(OS::TimeCurrentMillis() - start_time);
+ }
}
@@ -3394,6 +3402,11 @@ static inline Address StartOfLiveObject(Address block_address, uint32_t cell) {
// spaces will not contain the free space map.
intptr_t MarkCompactCollector::SweepConservatively(PagedSpace* space, Page* p) {
ASSERT(!p->IsEvacuationCandidate() && !p->WasSwept());
+ double start_time = 0.0;
+ if (FLAG_print_cumulative_gc_stat) {
+ start_time = OS::TimeCurrentMillis();
+ }
+
MarkBit::CellType* cells = p->markbits()->cells();
p->MarkSweptConservatively();
@@ -3480,6 +3493,10 @@ intptr_t MarkCompactCollector::SweepConservatively(PagedSpace* space, Page* p) {
}
p->ResetLiveBytes();
+
+ if (FLAG_print_cumulative_gc_stat) {
+ space->heap()->AddSweepingTime(OS::TimeCurrentMillis() - start_time);
+ }
return freed_bytes;
}
« 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