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

Unified Diff: src/heap/heap.cc

Issue 496873004: Reland part of r23285 "Start incremental marking in idle time handler only if it is worthwhile."" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Diff between this CL and r23285 Created 6 years, 4 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/heap/heap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index c7e1de398e0eba1c7b238e19cdb06039fa7a6526..f3f539d78153c120a75ac43478f9766f5d6c0ff4 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -845,8 +845,7 @@ bool Heap::CollectGarbage(GarbageCollector collector, const char* gc_reason,
// Start incremental marking for the next cycle. The heap snapshot
// generator needs incremental marking to stay off after it aborted.
if (!mark_compact_collector()->abort_incremental_marking() &&
- incremental_marking()->IsStopped() &&
- incremental_marking()->WorthActivating() && NextGCIsLikelyToBeFull()) {
+ WorthActivatingIncrementalMarking()) {
incremental_marking()->Start();
}
@@ -4277,6 +4276,12 @@ void Heap::AdvanceIdleIncrementalMarking(intptr_t step_size) {
}
+bool Heap::WorthActivatingIncrementalMarking() {
+ return incremental_marking()->IsStopped() &&
+ incremental_marking()->WorthActivating() && NextGCIsLikelyToBeFull();
+}
+
+
bool Heap::IdleNotification(int idle_time_in_ms) {
// If incremental marking is off, we do not perform idle notification.
if (!FLAG_incremental_marking) return true;
@@ -4285,9 +4290,16 @@ bool Heap::IdleNotification(int idle_time_in_ms) {
HistogramTimerScope idle_notification_scope(
isolate_->counters()->gc_idle_notification());
- GCIdleTimeAction action = gc_idle_time_handler_.Compute(
- idle_time_in_ms, contexts_disposed_, static_cast<size_t>(SizeOfObjects()),
- incremental_marking()->IsStopped(), tracer());
+ GCIdleTimeHandler::HeapState heap_state;
+ heap_state.contexts_disposed = contexts_disposed_;
+ heap_state.size_of_objects = static_cast<size_t>(SizeOfObjects());
+ heap_state.incremental_marking_stopped = incremental_marking()->IsStopped();
+ // TODO(ulan): Start incremental marking only for large heaps.
+ heap_state.can_start_incremental_marking = true;
+
+ GCIdleTimeAction action =
+ gc_idle_time_handler_.Compute(idle_time_in_ms, heap_state, tracer());
+
contexts_disposed_ = 0;
bool result = false;
switch (action.type) {
« no previous file with comments | « src/heap/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698