Commit 4b640300 authored by mlippautz's avatar mlippautz Committed by Commit bot

[heap] Fix recording on aborted code pages

R=ulan@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2021823002
Cr-Commit-Position: refs/heads/master@{#36580}
parent 359a269a
...@@ -3138,8 +3138,11 @@ bool MarkCompactCollector::Evacuator::EvacuatePage(Page* page) { ...@@ -3138,8 +3138,11 @@ bool MarkCompactCollector::Evacuator::EvacuatePage(Page* page) {
case kObjectsOldToOld: case kObjectsOldToOld:
result = EvacuateSinglePage<kClearMarkbits>(page, &old_space_visitor_); result = EvacuateSinglePage<kClearMarkbits>(page, &old_space_visitor_);
if (!result) { if (!result) {
// Aborted compaction page. We can record slots here to have them // Aborted compaction page. We have to record slots here, since we might
// processed in parallel later on. // not have recorded them in first place.
// Note: We mark the page as aborted here to be able to record slots
// for code objects in |RecordMigratedSlotVisitor|.
page->SetFlag(Page::COMPACTION_WAS_ABORTED);
EvacuateRecordOnlyVisitor record_visitor(collector_->heap()); EvacuateRecordOnlyVisitor record_visitor(collector_->heap());
result = EvacuateSinglePage<kKeepMarking>(page, &record_visitor); result = EvacuateSinglePage<kKeepMarking>(page, &record_visitor);
DCHECK(result); DCHECK(result);
...@@ -3234,7 +3237,6 @@ class EvacuationJobTraits { ...@@ -3234,7 +3237,6 @@ class EvacuationJobTraits {
} else { } else {
// We have partially compacted the page, i.e., some objects may have // We have partially compacted the page, i.e., some objects may have
// moved, others are still in place. // moved, others are still in place.
p->SetFlag(Page::COMPACTION_WAS_ABORTED);
p->ClearEvacuationCandidate(); p->ClearEvacuationCandidate();
// Slots have already been recorded so we just need to add it to the // Slots have already been recorded so we just need to add it to the
// sweeper. // sweeper.
......
...@@ -713,7 +713,8 @@ class MemoryChunk { ...@@ -713,7 +713,8 @@ class MemoryChunk {
} }
bool ShouldSkipEvacuationSlotRecording() { bool ShouldSkipEvacuationSlotRecording() {
return (flags_ & kSkipEvacuationSlotsRecordingMask) != 0; return ((flags_ & kSkipEvacuationSlotsRecordingMask) != 0) &&
!IsFlagSet(COMPACTION_WAS_ABORTED);
} }
Executability executable() { Executability executable() {
......
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