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

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

Issue 1053243003: Revert of Merge cellspace into old pointer space (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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/mark-compact.h ('k') | src/heap/objects-visiting-inl.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 35ae1bdf3601d6efb2770490be766a2e5373a2c5..6f81bebb1feaf55e22d37c8291eb94b163e5a902 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -137,6 +137,7 @@
static void VerifyMarking(Heap* heap) {
VerifyMarking(heap->old_space());
VerifyMarking(heap->code_space());
+ VerifyMarking(heap->cell_space());
VerifyMarking(heap->map_space());
VerifyMarking(heap->new_space());
@@ -214,6 +215,7 @@
static void VerifyEvacuation(Heap* heap) {
VerifyEvacuation(heap, heap->old_space());
VerifyEvacuation(heap, heap->code_space());
+ VerifyEvacuation(heap, heap->cell_space());
VerifyEvacuation(heap, heap->map_space());
VerifyEvacuation(heap->new_space());
@@ -266,6 +268,7 @@
if (FLAG_trace_fragmentation) {
TraceFragmentation(heap()->map_space());
+ TraceFragmentation(heap()->cell_space());
}
heap()->old_space()->EvictEvacuationCandidatesFromFreeLists();
@@ -292,6 +295,7 @@
ClearInvalidSlotsBufferEntries(heap_->old_space());
ClearInvalidSlotsBufferEntries(heap_->code_space());
+ ClearInvalidSlotsBufferEntries(heap_->cell_space());
ClearInvalidSlotsBufferEntries(heap_->map_space());
LargeObjectIterator it(heap_->lo_space());
@@ -317,6 +321,7 @@
VerifyValidSlotsBufferEntries(heap, heap->old_space());
VerifyValidSlotsBufferEntries(heap, heap->code_space());
+ VerifyValidSlotsBufferEntries(heap, heap->cell_space());
VerifyValidSlotsBufferEntries(heap, heap->map_space());
LargeObjectIterator it(heap->lo_space());
@@ -407,6 +412,7 @@
void MarkCompactCollector::VerifyMarkbitsAreClean() {
VerifyMarkbitsAreClean(heap_->old_space());
VerifyMarkbitsAreClean(heap_->code_space());
+ VerifyMarkbitsAreClean(heap_->cell_space());
VerifyMarkbitsAreClean(heap_->map_space());
VerifyMarkbitsAreClean(heap_->new_space());
@@ -463,6 +469,7 @@
ClearMarkbitsInPagedSpace(heap_->code_space());
ClearMarkbitsInPagedSpace(heap_->map_space());
ClearMarkbitsInPagedSpace(heap_->old_space());
+ ClearMarkbitsInPagedSpace(heap_->cell_space());
ClearMarkbitsInNewSpace(heap_->new_space());
LargeObjectIterator it(heap_->lo_space());
@@ -606,6 +613,8 @@
return "CODE_SPACE";
case MAP_SPACE:
return "MAP_SPACE";
+ case CELL_SPACE:
+ return "CELL_SPACE";
case LO_SPACE:
return "LO_SPACE";
default:
@@ -2084,6 +2093,9 @@
DiscoverGreyObjectsInSpace(heap(), &marking_deque_, heap()->map_space());
if (marking_deque_.IsFull()) return;
+ DiscoverGreyObjectsInSpace(heap(), &marking_deque_, heap()->cell_space());
+ if (marking_deque_.IsFull()) return;
+
LargeObjectIterator lo_it(heap()->lo_space());
DiscoverGreyObjectsWithIterator(heap(), &marking_deque_, &lo_it);
if (marking_deque_.IsFull()) return;
@@ -2273,6 +2285,23 @@
EnsureMarkingDequeIsCommittedAndInitialize();
PrepareForCodeFlushing();
+
+ if (was_marked_incrementally_) {
+ // There is no write barrier on cells so we have to scan them now at the end
+ // of the incremental marking.
+ {
+ HeapObjectIterator cell_iterator(heap()->cell_space());
+ HeapObject* cell;
+ while ((cell = cell_iterator.Next()) != NULL) {
+ DCHECK(cell->IsCell());
+ if (IsMarked(cell)) {
+ int offset = Cell::kValueOffset;
+ MarkCompactMarkingVisitor::VisitPointer(
+ heap(), reinterpret_cast<Object**>(cell->address() + offset));
+ }
+ }
+ }
+ }
RootMarkingVisitor root_visitor(heap());
MarkRoots(&root_visitor);
@@ -2826,16 +2855,6 @@
for (Object** p = start; p < end; p++) UpdatePointer(p);
}
- void VisitCell(RelocInfo* rinfo) {
- DCHECK(rinfo->rmode() == RelocInfo::CELL);
- Object* cell = rinfo->target_cell();
- Object* old_cell = cell;
- VisitPointer(&cell);
- if (cell != old_cell) {
- rinfo->set_target_cell(reinterpret_cast<Cell*>(cell));
- }
- }
-
void VisitEmbeddedPointer(RelocInfo* rinfo) {
DCHECK(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT);
Object* target = rinfo->target_object();
@@ -2944,9 +2963,11 @@
space_owner_id = 4;
} else if (heap->map_space()->ContainsSafe(slot_address)) {
space_owner_id = 5;
+ } else if (heap->cell_space()->ContainsSafe(slot_address)) {
+ space_owner_id = 6;
} else {
// Lo space or other.
- space_owner_id = 6;
+ space_owner_id = 7;
}
data[index++] = space_owner_id;
data[index++] = 0x20aaaaaaaaUL;
@@ -3374,11 +3395,6 @@
rinfo.Visit(isolate, v);
break;
}
- case SlotsBuffer::CELL_TARGET_SLOT: {
- RelocInfo rinfo(addr, RelocInfo::CELL, 0, NULL);
- rinfo.Visit(isolate, v);
- break;
- }
case SlotsBuffer::CODE_ENTRY_SLOT: {
v->VisitCodeEntry(addr);
break;
@@ -3775,6 +3791,15 @@
GCTracer::Scope gc_scope(heap()->tracer(),
GCTracer::Scope::MC_UPDATE_MISC_POINTERS);
+
+ // Update pointers from cells.
+ HeapObjectIterator cell_iterator(heap_->cell_space());
+ for (HeapObject* cell = cell_iterator.Next(); cell != NULL;
+ cell = cell_iterator.Next()) {
+ if (cell->IsCell()) {
+ Cell::BodyDescriptor::IterateBody(cell, &updating_visitor);
+ }
+ }
heap_->string_table()->Iterate(&updating_visitor);
@@ -4390,6 +4415,12 @@
SweepSpace(heap()->code_space(), SEQUENTIAL_SWEEPING);
}
+ {
+ GCTracer::Scope sweep_scope(heap()->tracer(),
+ GCTracer::Scope::MC_SWEEP_CELL);
+ SweepSpace(heap()->cell_space(), SEQUENTIAL_SWEEPING);
+ }
+
EvacuateNewSpaceAndCandidates();
// ClearNonLiveReferences depends on precise sweeping of map space to
@@ -4568,8 +4599,6 @@
static inline SlotsBuffer::SlotType SlotTypeForRMode(RelocInfo::Mode rmode) {
if (RelocInfo::IsCodeTarget(rmode)) {
return SlotsBuffer::CODE_TARGET_SLOT;
- } else if (RelocInfo::IsCell(rmode)) {
- return SlotsBuffer::CELL_TARGET_SLOT;
} else if (RelocInfo::IsEmbeddedObject(rmode)) {
return SlotsBuffer::EMBEDDED_OBJECT_SLOT;
} else if (RelocInfo::IsDebugBreakSlot(rmode)) {
« no previous file with comments | « src/heap/mark-compact.h ('k') | src/heap/objects-visiting-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698