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

Unified Diff: src/heap/heap.cc

Issue 2304123003: [heap] Refactor incremental marking step. (Closed)
Patch Set: another fix of the test 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 | « src/heap/heap.h ('k') | 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 1601999a835a60c82c1492252cf1655244458825..5e47e6d481600f15b057d6e3f8df324a26d70745 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -936,10 +936,8 @@ void Heap::ReportExternalMemoryPressure(const char* gc_reason) {
const double deadline = MonotonicallyIncreasingTimeInMs() +
pressure * kMaxStepSizeOnExternalLimit;
incremental_marking()->AdvanceIncrementalMarking(
- deadline,
- IncrementalMarking::StepActions(IncrementalMarking::GC_VIA_STACK_GUARD,
- IncrementalMarking::FORCE_MARKING,
- IncrementalMarking::FORCE_COMPLETION));
+ deadline, IncrementalMarking::GC_VIA_STACK_GUARD,
+ IncrementalMarking::FORCE_COMPLETION);
}
}
@@ -1056,9 +1054,9 @@ 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 (!ShouldAbortIncrementalMarking() && incremental_marking()->IsStopped() &&
- incremental_marking()->ShouldActivateEvenWithoutIdleNotification()) {
- StartIncrementalMarking(kNoGCFlags, kNoGCCallbackFlags, "GC epilogue");
+ if (!ShouldAbortIncrementalMarking()) {
+ StartIncrementalMarkingIfNeeded(kNoGCFlags, kNoGCCallbackFlags,
+ "GC epilogue");
}
return next_gc_likely_to_collect_more;
@@ -1094,6 +1092,13 @@ void Heap::StartIncrementalMarking(int gc_flags,
incremental_marking()->Start(reason);
}
+void Heap::StartIncrementalMarkingIfNeeded(
+ int gc_flags, const GCCallbackFlags gc_callback_flags, const char* reason) {
+ if (incremental_marking()->IsStopped() &&
+ incremental_marking()->ShouldActivateEvenWithoutIdleNotification()) {
+ StartIncrementalMarking(gc_flags, gc_callback_flags, reason);
+ }
+}
void Heap::StartIdleIncrementalMarking() {
gc_idle_time_handler_->ResetNoProgressCounter();
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/incremental-marking.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698