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

Side by Side Diff: src/heap/store-buffer.cc

Issue 1007273002: Remove all atomic access from 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <algorithm> 5 #include <algorithm>
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #include "src/base/atomicops.h"
10 #include "src/counters.h" 9 #include "src/counters.h"
11 #include "src/heap/store-buffer-inl.h" 10 #include "src/heap/store-buffer-inl.h"
12 11
13 namespace v8 { 12 namespace v8 {
14 namespace internal { 13 namespace internal {
15 14
16 StoreBuffer::StoreBuffer(Heap* heap) 15 StoreBuffer::StoreBuffer(Heap* heap)
17 : heap_(heap), 16 : heap_(heap),
18 start_(NULL), 17 start_(NULL),
19 limit_(NULL), 18 limit_(NULL),
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 } 355 }
357 } 356 }
358 357
359 358
360 void StoreBuffer::ClearInvalidStoreBufferEntries() { 359 void StoreBuffer::ClearInvalidStoreBufferEntries() {
361 Compact(); 360 Compact();
362 Address* new_top = old_start_; 361 Address* new_top = old_start_;
363 for (Address* current = old_start_; current < old_top_; current++) { 362 for (Address* current = old_start_; current < old_top_; current++) {
364 Address addr = *current; 363 Address addr = *current;
365 Object** slot = reinterpret_cast<Object**>(*current); 364 Object** slot = reinterpret_cast<Object**>(*current);
366 // Use a NoBarrier_Load here since the slot can be in a dead object 365 Object* object = *slot;
367 // which may be touched by the concurrent sweeper thread.
368 Object* object = reinterpret_cast<Object*>(
369 base::NoBarrier_Load(reinterpret_cast<base::AtomicWord*>(slot)));
370 if (heap_->InNewSpace(object)) { 366 if (heap_->InNewSpace(object)) {
371 if (heap_->mark_compact_collector()->IsSlotInLiveObject( 367 if (heap_->mark_compact_collector()->IsSlotInLiveObject(
372 reinterpret_cast<HeapObject**>(slot), 368 reinterpret_cast<HeapObject**>(slot),
373 reinterpret_cast<HeapObject*>(object))) { 369 reinterpret_cast<HeapObject*>(object))) {
374 *new_top++ = addr; 370 *new_top++ = addr;
375 } 371 }
376 } 372 }
377 } 373 }
378 old_top_ = new_top; 374 old_top_ = new_top;
379 ClearFilteringHashSets(); 375 ClearFilteringHashSets();
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 } 562 }
567 old_buffer_is_sorted_ = false; 563 old_buffer_is_sorted_ = false;
568 old_buffer_is_filtered_ = false; 564 old_buffer_is_filtered_ = false;
569 *old_top_++ = reinterpret_cast<Address>(int_addr << kPointerSizeLog2); 565 *old_top_++ = reinterpret_cast<Address>(int_addr << kPointerSizeLog2);
570 DCHECK(old_top_ <= old_limit_); 566 DCHECK(old_top_ <= old_limit_);
571 } 567 }
572 heap_->isolate()->counters()->store_buffer_compactions()->Increment(); 568 heap_->isolate()->counters()->store_buffer_compactions()->Increment();
573 } 569 }
574 } 570 }
575 } // namespace v8::internal 571 } // namespace v8::internal
OLDNEW
« 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