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

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

Issue 2236543002: [heap] Register end of black areas to support faster filtering of invalid slots. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix nit Created 4 years, 4 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 | « no previous file | src/heap/spaces.h » ('j') | 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 c7e4d8f29a6cd9c60f1882bb945f0be518a6f256..ae095782c380c1c5cb0109dba436e9374260be82 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -2991,6 +2991,11 @@ bool MarkCompactCollector::IsSlotInBlackObject(MemoryChunk* p, Address slot) {
base_address += (cell_index - base_address_cell_index) *
Bitmap::kBitsPerCell * kPointerSize;
Address address = base_address + offset * kPointerSize;
+
+ // If the found mark bit is part of a black area, the slot cannot be part
+ // of a live object since it is not marked.
+ if (p->IsBlackAreaEndMarker(address + kPointerSize)) return false;
+
HeapObject* object = HeapObject::FromAddress(address);
CHECK(Marking::IsBlack(ObjectMarking::MarkBitFrom(object)));
CHECK(object->address() < reinterpret_cast<Address>(slot));
@@ -3372,6 +3377,9 @@ int MarkCompactCollector::Sweeper::RawSweep(
// requires valid mark bits.
ArrayBufferTracker::FreeDead(p);
+ // We also release the black area markers here.
+ p->ReleaseBlackAreaEndMarkerMap();
+
Address free_start = p->area_start();
DCHECK(reinterpret_cast<intptr_t>(free_start) % (32 * kPointerSize) == 0);
@@ -3915,6 +3923,7 @@ void MarkCompactCollector::StartSweepSpace(PagedSpace* space) {
if (p->IsEvacuationCandidate()) {
// Will be processed in EvacuateNewSpaceAndCandidates.
DCHECK(evacuation_candidates_.length() > 0);
+ DCHECK(!p->HasBlackAreas());
continue;
}
« no previous file with comments | « no previous file | src/heap/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698