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

Unified Diff: src/heap/store-buffer.cc

Issue 1010363005: Filter invalid slots out from the SlotsBuffer after marking. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebasing (argh!) 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 | « src/heap/spaces.h ('k') | test/cctest/test-unboxed-doubles.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/store-buffer.cc
diff --git a/src/heap/store-buffer.cc b/src/heap/store-buffer.cc
index b21bf27c13966184abec0cbec5d454c5ed5c7e4d..f5404a4b62b2fa34d2a50134cfb943411d5be254 100644
--- a/src/heap/store-buffer.cc
+++ b/src/heap/store-buffer.cc
@@ -363,12 +363,14 @@ void StoreBuffer::ClearInvalidStoreBufferEntries() {
Address* new_top = old_start_;
for (Address* current = old_start_; current < old_top_; current++) {
Address addr = *current;
- Object** slot = reinterpret_cast<Object**>(*current);
+ Object** slot = reinterpret_cast<Object**>(addr);
Object* object = *slot;
- if (heap_->InNewSpace(object)) {
- if (heap_->mark_compact_collector()->IsSlotInLiveObject(
- reinterpret_cast<HeapObject**>(slot),
- reinterpret_cast<HeapObject*>(object))) {
+ if (heap_->InNewSpace(object) && object->IsHeapObject()) {
+ // If the target object is not black, the source slot must be part
+ // of a non-black (dead) object.
+ HeapObject* heap_object = HeapObject::cast(object);
+ if (Marking::IsBlack(Marking::MarkBitFrom(heap_object)) &&
+ heap_->mark_compact_collector()->IsSlotInLiveObject(addr)) {
*new_top++ = addr;
}
}
@@ -391,10 +393,10 @@ void StoreBuffer::VerifyValidStoreBufferEntries() {
for (Address* current = old_start_; current < old_top_; current++) {
Object** slot = reinterpret_cast<Object**>(*current);
Object* object = *slot;
+ CHECK(object->IsHeapObject());
CHECK(heap_->InNewSpace(object));
heap_->mark_compact_collector()->VerifyIsSlotInLiveObject(
- reinterpret_cast<HeapObject**>(slot),
- reinterpret_cast<HeapObject*>(object));
+ reinterpret_cast<Address>(slot), HeapObject::cast(object));
}
}
« no previous file with comments | « src/heap/spaces.h ('k') | test/cctest/test-unboxed-doubles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698