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

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

Issue 991853002: Remove lazy sweeping of new space and corresponding complicated pointer updating logic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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/store-buffer.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 01dabaf2a1dd66e210bd24ca589105e8435b0570..3146d3c6e4f82b8f4ac9cc3da4ed16024b066578 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -3008,19 +3008,15 @@ void PointersUpdatingVisitor::CheckLayoutDescriptorAndDie(Heap* heap,
static void UpdatePointer(HeapObject** address, HeapObject* object) {
- Address new_addr = Memory::Address_at(object->address());
-
- // The new space sweep will overwrite the map word of dead objects
- // with NULL. In this case we do not need to transfer this entry to
- // the store buffer which we are rebuilding.
- // We perform the pointer update with a no barrier compare-and-swap. The
- // compare and swap may fail in the case where the pointer update tries to
- // update garbage memory which was concurrently accessed by the sweeper.
- if (new_addr != NULL) {
- base::NoBarrier_CompareAndSwap(
- reinterpret_cast<base::AtomicWord*>(address),
- reinterpret_cast<base::AtomicWord>(object),
- reinterpret_cast<base::AtomicWord>(HeapObject::FromAddress(new_addr)));
+ MapWord map_word = object->map_word();
+ // The store buffer can still contain stale pointers in dead large objects.
+ // Ignore these pointers here.
+ DCHECK(map_word.IsForwardingAddress() ||
+ object->GetHeap()->lo_space()->FindPage(
+ reinterpret_cast<Address>(address)) != NULL);
+ if (map_word.IsForwardingAddress()) {
+ // Update the corresponding slot.
+ *address = map_word.ToForwardingAddress();
}
}
@@ -3650,8 +3646,7 @@ void MarkCompactCollector::EvacuateNewSpaceAndCandidates() {
GCTracer::Scope::MC_UPDATE_OLD_TO_NEW_POINTERS);
StoreBufferRebuildScope scope(heap_, heap_->store_buffer(),
&Heap::ScavengeStoreBufferCallback);
- heap_->store_buffer()->IteratePointersToNewSpaceAndClearMaps(
- &UpdatePointer);
+ heap_->store_buffer()->IteratePointersToNewSpace(&UpdatePointer);
}
{
« no previous file with comments | « no previous file | src/heap/store-buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698