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

Unified Diff: src/incremental-marking.cc

Issue 428263006: Report precise number of incrementally marked bytes to gc tracer. (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.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/incremental-marking.cc
diff --git a/src/incremental-marking.cc b/src/incremental-marking.cc
index 0ab9a002452e94aa7846816d14c73e9c4f349b7e..6526577d3efc1d4490d0a2340f8daaa7a70cd210 100644
--- a/src/incremental-marking.cc
+++ b/src/incremental-marking.cc
@@ -677,9 +677,10 @@ void IncrementalMarking::VisitObject(Map* map, HeapObject* obj, int size) {
}
-void IncrementalMarking::ProcessMarkingDeque(intptr_t bytes_to_process) {
+intptr_t IncrementalMarking::ProcessMarkingDeque(intptr_t bytes_to_process) {
+ intptr_t bytes_processed = 0;
Map* filler_map = heap_->one_pointer_filler_map();
- while (!marking_deque_.IsEmpty() && bytes_to_process > 0) {
+ while (!marking_deque_.IsEmpty() && bytes_processed < bytes_to_process) {
HeapObject* obj = marking_deque_.Pop();
// Explicitly skip one word fillers. Incremental markbit patterns are
@@ -693,8 +694,9 @@ void IncrementalMarking::ProcessMarkingDeque(intptr_t bytes_to_process) {
int delta = (size - unscanned_bytes_of_large_object_);
// TODO(jochen): remove after http://crbug.com/381820 is resolved.
CHECK_LT(0, delta);
- bytes_to_process -= delta;
+ bytes_processed += delta;
}
+ return bytes_processed;
}
@@ -873,6 +875,7 @@ void IncrementalMarking::Step(intptr_t allocated_bytes,
write_barriers_invoked_since_last_step_ = 0;
bytes_scanned_ += bytes_to_process;
+ intptr_t bytes_processed = 0;
if (state_ == SWEEPING) {
if (heap_->mark_compact_collector()->sweeping_in_progress() &&
@@ -884,7 +887,7 @@ void IncrementalMarking::Step(intptr_t allocated_bytes,
StartMarking(PREVENT_COMPACTION);
}
} else if (state_ == MARKING) {
- ProcessMarkingDeque(bytes_to_process);
+ bytes_processed = ProcessMarkingDeque(bytes_to_process);
if (marking_deque_.IsEmpty()) MarkingComplete(action);
}
@@ -956,7 +959,10 @@ void IncrementalMarking::Step(intptr_t allocated_bytes,
double end = base::OS::TimeCurrentMillis();
double duration = (end - start);
- heap_->tracer()->AddIncrementalMarkingStep(duration, allocated_bytes);
+ // Note that we report zero bytes here when sweeping was in progress or
+ // when we just started incremental marking. In these cases we did not
+ // process the marking deque.
+ heap_->tracer()->AddIncrementalMarkingStep(duration, bytes_processed);
heap_->AddMarkingTime(duration);
}
}
« no previous file with comments | « src/incremental-marking.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698