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

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

Issue 993983002: Remove unnecessary NoBarrier_load instructions in store buffer. (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 | 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 7de8632b2ec71636f08ca6bb6470fbfd0c9f77e1..9c3c12c08d83751860a961732695deaeec41b5de 100644
--- a/src/heap/store-buffer.cc
+++ b/src/heap/store-buffer.cc
@@ -350,8 +350,7 @@ void StoreBuffer::VerifyPointers(LargeObjectSpace* space) {
// When we are not in GC the Heap::InNewSpace() predicate
// checks that pointers which satisfy predicate point into
// the active semispace.
- Object* object = reinterpret_cast<Object*>(
- base::NoBarrier_Load(reinterpret_cast<base::AtomicWord*>(slot)));
+ Object* object = *slot;
heap_->InNewSpace(object);
slot_address += kPointerSize;
}
@@ -382,8 +381,7 @@ void StoreBuffer::ProcessOldToNewSlot(Address slot_address,
ObjectSlotCallback slot_callback,
bool clear_maps) {
Object** slot = reinterpret_cast<Object**>(slot_address);
- Object* object = reinterpret_cast<Object*>(
- base::NoBarrier_Load(reinterpret_cast<base::AtomicWord*>(slot)));
+ Object* object = *slot;
// If the object is not in from space, it must be a duplicate store buffer
// entry and the slot was already updated.
@@ -394,8 +392,7 @@ void StoreBuffer::ProcessOldToNewSlot(Address slot_address,
// pointer. Clear the map field now lazily (during full GC).
if (clear_maps) ClearDeadObject(heap_object);
slot_callback(reinterpret_cast<HeapObject**>(slot), heap_object);
- object = reinterpret_cast<Object*>(
- base::NoBarrier_Load(reinterpret_cast<base::AtomicWord*>(slot)));
+ object = *slot;
// If the object was in from space before and is after executing the
// callback in to space, the object is still live.
// Unfortunately, we do not know about the slot. It could be in a
@@ -440,6 +437,8 @@ void StoreBuffer::ClearInvalidStoreBufferEntries() {
for (Address* current = old_start_; current < old_top_; current++) {
Address addr = *current;
Object** slot = reinterpret_cast<Object**>(*current);
+ // Use a NoBarrier_Load here since the slot can be in a dead object
+ // which may be touched by the concurrent sweeper thread.
Jarin 2015/03/10 13:32:25 Why did not you update this one?
Hannes Payer (out of office) 2015/03/10 13:51:17 Because the stale pointers may be accessed concurr
Object* object = reinterpret_cast<Object*>(
base::NoBarrier_Load(reinterpret_cast<base::AtomicWord*>(slot)));
if (heap_->InNewSpace(object)) {
@@ -467,8 +466,7 @@ void StoreBuffer::ClearInvalidStoreBufferEntries() {
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)));
+ Object* object = *slot;
CHECK(heap_->InNewSpace(object));
heap_->mark_compact_collector()->VerifyIsSlotInLiveObject(
reinterpret_cast<HeapObject**>(slot),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698