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

Unified Diff: src/heap/mark-compact.cc

Issue 2870683003: [heap] Factor out marking state of array buffer tracker (Closed)
Patch Set: Get MarkingState out of thin air Created 3 years, 7 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
« no previous file with comments | « src/heap/array-buffer-tracker.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index df3025f620bb4d6d340c14103445617098ca070d..ab6907ecc674a40c653c93741676b004e7157ff6 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -3784,6 +3784,9 @@ int MarkCompactCollector::Sweeper::RawSweep(
space->identity() == CODE_SPACE || space->identity() == MAP_SPACE);
DCHECK(!p->IsEvacuationCandidate() && !p->SweepingDone());
+ // Sweeper takes the marking state of the full collector.
+ const MarkingState state = MarkingState::Internal(p);
+
// If there are old-to-new slots in that page, we have to filter out slots
// that are in dead memory which is freed by the sweeper.
ClearOldToNewSlotsMode slots_clearing_mode = GetClearOldToNewSlotsMode(p);
@@ -3793,7 +3796,7 @@ int MarkCompactCollector::Sweeper::RawSweep(
// Before we sweep objects on the page, we free dead array buffers which
// requires valid mark bits.
- ArrayBufferTracker::FreeDead(p);
+ ArrayBufferTracker::FreeDead(p, state);
Address free_start = p->area_start();
DCHECK(reinterpret_cast<intptr_t>(free_start) % (32 * kPointerSize) == 0);
@@ -3812,11 +3815,11 @@ int MarkCompactCollector::Sweeper::RawSweep(
intptr_t max_freed_bytes = 0;
int curr_region = -1;
- LiveObjectIterator<kBlackObjects> it(p, MarkingState::Internal(p));
+ LiveObjectIterator<kBlackObjects> it(p, state);
HeapObject* object = NULL;
while ((object = it.Next()) != NULL) {
- DCHECK(ObjectMarking::IsBlack(object, MarkingState::Internal(object)));
+ DCHECK(ObjectMarking::IsBlack(object, state));
Address free_end = object->address();
if (free_end != free_start) {
CHECK_GT(free_end, free_start);
@@ -3890,7 +3893,7 @@ int MarkCompactCollector::Sweeper::RawSweep(
}
// Clear the mark bits of that page and reset live bytes count.
- MarkingState::Internal(p).ClearLiveness();
+ state.ClearLiveness();
p->concurrent_sweeping_state().SetValue(Page::kSweepingDone);
if (free_list_mode == IGNORE_FREE_LIST) return 0;
« no previous file with comments | « src/heap/array-buffer-tracker.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698