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

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

Issue 985453003: Eliminate invalid pointers in store buffer after marking. (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 | « src/heap/store-buffer.h ('k') | no next file » | 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 6c8a457af811e925ca295477497da5fa311c4a13..62ace0f891acafa31cad031dddfab7ce229a2b1a 100644
--- a/src/heap/store-buffer.cc
+++ b/src/heap/store-buffer.cc
@@ -434,6 +434,40 @@ void StoreBuffer::IteratePointersInStoreBuffer(ObjectSlotCallback slot_callback,
}
+void StoreBuffer::ClearInvalidStoreBufferEntries() {
+ Compact();
+ Address* new_top = old_start_;
+ for (Address* current = old_start_; current < old_top_; current++) {
+ Address addr = *current;
+ Object** slot = reinterpret_cast<Object**>(*current);
+ Object* object = reinterpret_cast<Object*>(
+ base::NoBarrier_Load(reinterpret_cast<base::AtomicWord*>(slot)));
+ if (heap_->InNewSpace(object)) {
+ if (heap_->mark_compact_collector()->IsSlotInLiveObject(
+ reinterpret_cast<HeapObject**>(slot),
+ reinterpret_cast<HeapObject*>(object))) {
+ *new_top++ = addr;
+ }
+ }
+ }
+ old_top_ = new_top;
+ ClearFilteringHashSets();
+}
+
+
+void StoreBuffer::VerifyValidStoreBufferEntries() {
+ for (Address* current = old_start_; current < old_top_; current++) {
+ Object** slot = reinterpret_cast<Object**>(*current);
+ Object* object = reinterpret_cast<Object*>(
+ base::NoBarrier_Load(reinterpret_cast<base::AtomicWord*>(slot)));
+ CHECK(heap_->InNewSpace(object));
+ heap_->mark_compact_collector()->VerifyIsSlotInLiveObject(
+ reinterpret_cast<HeapObject**>(slot),
+ reinterpret_cast<HeapObject*>(object));
+ }
+}
+
+
void StoreBuffer::IteratePointersToNewSpace(ObjectSlotCallback slot_callback) {
IteratePointersToNewSpace(slot_callback, false);
}
« no previous file with comments | « src/heap/store-buffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698