Commit da524227 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[heap] Allow pausing incremental steps

Bug: 843903
Change-Id: I51f920f3e775e09ebb8b1dcc569f229b1c98c678
Reviewed-on: https://chromium-review.googlesource.com/c/1280662Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599621}
parent 70114154
......@@ -834,6 +834,7 @@ void UnexpectedGCState(ThreadState::GCState gc_state) {
UNEXPECTED_GCSTATE(kIdleGCScheduled);
UNEXPECTED_GCSTATE(kPreciseGCScheduled);
UNEXPECTED_GCSTATE(kFullGCScheduled);
UNEXPECTED_GCSTATE(kIncrementalMarkingStepPaused);
UNEXPECTED_GCSTATE(kIncrementalMarkingStepScheduled);
UNEXPECTED_GCSTATE(kIncrementalMarkingFinalizeScheduled);
UNEXPECTED_GCSTATE(kPageNavigationGCScheduled);
......@@ -857,6 +858,7 @@ void ThreadState::SetGCState(GCState gc_state) {
gc_state_ == kNoGCScheduled || gc_state_ == kIdleGCScheduled ||
gc_state_ == kPreciseGCScheduled || gc_state_ == kFullGCScheduled ||
gc_state_ == kPageNavigationGCScheduled ||
gc_state_ == kIncrementalMarkingStepPaused ||
gc_state_ == kIncrementalMarkingStepScheduled ||
gc_state_ == kIncrementalMarkingFinalizeScheduled ||
gc_state_ == kIncrementalGCScheduled);
......@@ -879,6 +881,7 @@ void ThreadState::SetGCState(GCState gc_state) {
DCHECK(!IsSweepingInProgress());
VERIFY_STATE_TRANSITION(
gc_state_ == kNoGCScheduled || gc_state_ == kIdleGCScheduled ||
gc_state_ == kIncrementalMarkingStepPaused ||
gc_state_ == kIncrementalMarkingStepScheduled ||
gc_state_ == kIncrementalMarkingFinalizeScheduled ||
gc_state_ == kPreciseGCScheduled || gc_state_ == kFullGCScheduled ||
......@@ -898,6 +901,12 @@ void ThreadState::SetGCState(GCState gc_state) {
VERIFY_STATE_TRANSITION(gc_state_ == kNoGCScheduled ||
gc_state_ == kIdleGCScheduled);
break;
case kIncrementalMarkingStepPaused:
DCHECK(CheckThread());
DCHECK(IsMarkingInProgress());
DCHECK(!IsSweepingInProgress());
VERIFY_STATE_TRANSITION(gc_state_ == kIncrementalMarkingStepScheduled);
break;
default:
NOTREACHED();
}
......@@ -1484,7 +1493,7 @@ void ThreadState::IncrementalMarkingStep() {
// further marking if new objects are discovered. Otherwise, just process
// the rest in the atomic pause.
DCHECK(IsUnifiedGCMarkingInProgress());
SetGCState(kNoGCScheduled);
SetGCState(kIncrementalMarkingStepPaused);
} else {
ScheduleIncrementalMarkingFinalize();
}
......
......@@ -147,6 +147,7 @@ class PLATFORM_EXPORT ThreadState final
enum GCState {
kNoGCScheduled,
kIdleGCScheduled,
kIncrementalMarkingStepPaused,
kIncrementalMarkingStepScheduled,
kIncrementalMarkingFinalizeScheduled,
kPreciseGCScheduled,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment