Commit 92855aed authored by ulan's avatar ulan Committed by Commit bot

Fix cctest/test-unboxed-doubles/IncrementalWriteBarrierObjectShiftFieldsRight after 5e87a0.

Make sure that when manual evacuation candidate selection is enabled we do not select more pages than requested.
BUG=

TBR=hpayer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#28662}
parent 21e6831e
......@@ -678,18 +678,25 @@ void MarkCompactCollector::CollectEvacuationCandidates(PagedSpace* space) {
reduce_memory_footprint_ ||
heap()->HasLowAllocationRate(
heap()->tracer()->CurrentAllocationThroughputInBytesPerMillisecond());
if (FLAG_stress_compaction || FLAG_manual_evacuation_candidates_selection) {
if (FLAG_manual_evacuation_candidates_selection) {
for (size_t i = 0; i < pages.size(); i++) {
Page* p = pages[i].second;
if (((i % 2 == 0) && FLAG_stress_compaction) ||
p->IsFlagSet(MemoryChunk::FORCE_EVACUATION_CANDIDATE_FOR_TESTING)) {
if (p->IsFlagSet(MemoryChunk::FORCE_EVACUATION_CANDIDATE_FOR_TESTING)) {
candidate_count++;
total_live_bytes += pages[i].first;
p->ClearFlag(MemoryChunk::FORCE_EVACUATION_CANDIDATE_FOR_TESTING);
AddEvacuationCandidate(p);
}
}
} else if (FLAG_stress_compaction) {
for (size_t i = 0; i < pages.size(); i++) {
Page* p = pages[i].second;
if (i % 2 == 0) {
candidate_count++;
total_live_bytes += pages[i].first;
AddEvacuationCandidate(p);
}
}
} else {
const int kTargetFragmentationPercent = 50;
const int kMaxEvacuatedBytes = 4 * Page::kPageSize;
......
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