Commit 92f96e4e authored by ulan's avatar ulan Committed by Commit bot

Allow compaction when incremental marking is on.

BUG=chromium:450824
LOG=NO

Review URL: https://codereview.chromium.org/1014263002

Cr-Commit-Position: refs/heads/master@{#27267}
parent 9312024a
...@@ -459,7 +459,7 @@ static void PatchIncrementalMarkingRecordWriteStubs( ...@@ -459,7 +459,7 @@ static void PatchIncrementalMarkingRecordWriteStubs(
} }
void IncrementalMarking::Start(CompactionFlag flag) { void IncrementalMarking::Start() {
if (FLAG_trace_incremental_marking) { if (FLAG_trace_incremental_marking) {
PrintF("[IncrementalMarking] Start\n"); PrintF("[IncrementalMarking] Start\n");
} }
...@@ -474,7 +474,7 @@ void IncrementalMarking::Start(CompactionFlag flag) { ...@@ -474,7 +474,7 @@ void IncrementalMarking::Start(CompactionFlag flag) {
was_activated_ = true; was_activated_ = true;
if (!heap_->mark_compact_collector()->sweeping_in_progress()) { if (!heap_->mark_compact_collector()->sweeping_in_progress()) {
StartMarking(flag); StartMarking();
} else { } else {
if (FLAG_trace_incremental_marking) { if (FLAG_trace_incremental_marking) {
PrintF("[IncrementalMarking] Start sweeping.\n"); PrintF("[IncrementalMarking] Start sweeping.\n");
...@@ -486,12 +486,12 @@ void IncrementalMarking::Start(CompactionFlag flag) { ...@@ -486,12 +486,12 @@ void IncrementalMarking::Start(CompactionFlag flag) {
} }
void IncrementalMarking::StartMarking(CompactionFlag flag) { void IncrementalMarking::StartMarking() {
if (FLAG_trace_incremental_marking) { if (FLAG_trace_incremental_marking) {
PrintF("[IncrementalMarking] Start marking\n"); PrintF("[IncrementalMarking] Start marking\n");
} }
is_compacting_ = !FLAG_never_compact && (flag == ALLOW_COMPACTION) && is_compacting_ = !FLAG_never_compact &&
heap_->mark_compact_collector()->StartCompaction( heap_->mark_compact_collector()->StartCompaction(
MarkCompactCollector::INCREMENTAL_COMPACTION); MarkCompactCollector::INCREMENTAL_COMPACTION);
...@@ -823,9 +823,7 @@ void IncrementalMarking::Epilogue() { ...@@ -823,9 +823,7 @@ void IncrementalMarking::Epilogue() {
void IncrementalMarking::OldSpaceStep(intptr_t allocated) { void IncrementalMarking::OldSpaceStep(intptr_t allocated) {
if (IsStopped() && ShouldActivate()) { if (IsStopped() && ShouldActivate()) {
// TODO(hpayer): Let's play safe for now, but compaction should be Start();
// in principle possible.
Start(PREVENT_COMPACTION);
} else { } else {
Step(allocated * kFastMarking / kInitialMarkingSpeed, GC_VIA_STACK_GUARD); Step(allocated * kFastMarking / kInitialMarkingSpeed, GC_VIA_STACK_GUARD);
} }
...@@ -954,7 +952,7 @@ intptr_t IncrementalMarking::Step(intptr_t allocated_bytes, ...@@ -954,7 +952,7 @@ intptr_t IncrementalMarking::Step(intptr_t allocated_bytes,
} }
if (!heap_->mark_compact_collector()->sweeping_in_progress()) { if (!heap_->mark_compact_collector()->sweeping_in_progress()) {
bytes_scanned_ = 0; bytes_scanned_ = 0;
StartMarking(PREVENT_COMPACTION); StartMarking();
} }
} else if (state_ == MARKING) { } else if (state_ == MARKING) {
bytes_processed = ProcessMarkingDeque(bytes_to_process); bytes_processed = ProcessMarkingDeque(bytes_to_process);
......
...@@ -67,9 +67,7 @@ class IncrementalMarking { ...@@ -67,9 +67,7 @@ class IncrementalMarking {
bool WasActivated(); bool WasActivated();
enum CompactionFlag { ALLOW_COMPACTION, PREVENT_COMPACTION }; void Start();
void Start(CompactionFlag flag = ALLOW_COMPACTION);
void Stop(); void Stop();
...@@ -208,7 +206,7 @@ class IncrementalMarking { ...@@ -208,7 +206,7 @@ class IncrementalMarking {
void ResetStepCounters(); void ResetStepCounters();
void StartMarking(CompactionFlag flag); void StartMarking();
void ActivateIncrementalWriteBarrier(PagedSpace* space); void ActivateIncrementalWriteBarrier(PagedSpace* space);
static void ActivateIncrementalWriteBarrier(NewSpace* space); static void ActivateIncrementalWriteBarrier(NewSpace* space);
......
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