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

Unified Diff: src/heap/heap.cc

Issue 2304123003: [heap] Refactor incremental marking step. (Closed)
Patch Set: small fix 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
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index ae9f4fd71ce0e88a25167112279a7cc1d5d54de6..6766269154a2c9be49197e1cc6c7babe24ffce3a 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -923,10 +923,8 @@ void Heap::ReportExternalMemoryPressure(const char* gc_reason) {
double deadline = MonotonicallyIncreasingTimeInMs() +
FLAG_external_allocation_limit_incremental_time;
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);
}
}
@@ -1043,9 +1041,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;
@@ -1081,6 +1079,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') | src/heap/spaces.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698