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

Unified Diff: src/heap/heap.cc

Issue 2321553002: [heap] Do more incremental marking work in tasks. (Closed)
Patch Set: address comment Created 4 years, 3 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 | « no previous file | src/heap/incremental-marking.h » ('j') | 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 ad8d1466b92d8d6c43167914f395c6a8dc7394a2..231c8ab000c441d540d4eaae95cc73c74f4ac030 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -937,7 +937,7 @@ void Heap::ReportExternalMemoryPressure() {
pressure * kMaxStepSizeOnExternalLimit;
incremental_marking()->AdvanceIncrementalMarking(
deadline, IncrementalMarking::GC_VIA_STACK_GUARD,
- IncrementalMarking::FORCE_COMPLETION);
+ IncrementalMarking::FORCE_COMPLETION, StepOrigin::kV8);
}
}
@@ -1054,7 +1054,9 @@ bool Heap::CollectGarbage(GarbageCollector collector,
// Start incremental marking for the next cycle. The heap snapshot
// generator needs incremental marking to stay off after it aborted.
- if (!ShouldAbortIncrementalMarking()) {
+ // We do this only for scavenger to avoid a loop where mark-compact
+ // causes another mark-compact.
+ if (collector == SCAVENGER && !ShouldAbortIncrementalMarking()) {
StartIncrementalMarkingIfAllocationLimitIsReached(kNoGCFlags,
kNoGCCallbackFlags);
}
@@ -4300,15 +4302,16 @@ bool Heap::PerformIdleTimeAction(GCIdleTimeAction action,
result = true;
break;
case DO_INCREMENTAL_STEP: {
- if (incremental_marking()->incremental_marking_job()->IdleTaskPending()) {
- result = true;
- } else {
- incremental_marking()
- ->incremental_marking_job()
- ->NotifyIdleTaskProgress();
- result = IncrementalMarkingJob::IdleTask::Step(this, deadline_in_ms) ==
- IncrementalMarkingJob::IdleTask::kDone;
+ const double remaining_idle_time_in_ms =
+ incremental_marking()->AdvanceIncrementalMarking(
+ deadline_in_ms, IncrementalMarking::NO_GC_VIA_STACK_GUARD,
+ IncrementalMarking::FORCE_COMPLETION, StepOrigin::kTask);
+ if (remaining_idle_time_in_ms > 0.0) {
+ TryFinalizeIdleIncrementalMarking(
+ remaining_idle_time_in_ms,
+ GarbageCollectionReason::kFinalizeMarkingViaTask);
}
+ result = incremental_marking()->IsStopped();
break;
}
case DO_FULL_GC: {
« no previous file with comments | « no previous file | src/heap/incremental-marking.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698