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

Side by Side Diff: src/heap/store-buffer-inl.h

Issue 1577853007: [heap] Parallel newspace evacuation, semispace copy, and compaction \o/ (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Refactoring Created 4 years, 11 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
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 #ifndef V8_STORE_BUFFER_INL_H_ 5 #ifndef V8_STORE_BUFFER_INL_H_
6 #define V8_STORE_BUFFER_INL_H_ 6 #define V8_STORE_BUFFER_INL_H_
7 7
8 #include "src/heap/heap.h" 8 #include "src/heap/heap.h"
9 #include "src/heap/spaces-inl.h" 9 #include "src/heap/spaces-inl.h"
10 #include "src/heap/store-buffer.h" 10 #include "src/heap/store-buffer.h"
(...skipping 10 matching lines...) Expand all
21 DCHECK(top == limit_); 21 DCHECK(top == limit_);
22 Compact(); 22 Compact();
23 } else { 23 } else {
24 DCHECK(top < limit_); 24 DCHECK(top < limit_);
25 } 25 }
26 } 26 }
27 27
28 28
29 inline void StoreBuffer::MarkSynchronized(Address addr) { 29 inline void StoreBuffer::MarkSynchronized(Address addr) {
30 base::LockGuard<base::Mutex> lock_guard(&mutex_); 30 base::LockGuard<base::Mutex> lock_guard(&mutex_);
31 if (MemoryChunk::FromAddress(addr)->scan_on_scavenge()) return;
31 Mark(addr); 32 Mark(addr);
32 } 33 }
33 34
34 35
35 void StoreBuffer::EnterDirectlyIntoStoreBuffer(Address addr) { 36 void StoreBuffer::EnterDirectlyIntoStoreBuffer(Address addr) {
36 if (store_buffer_rebuilding_enabled_) { 37 if (store_buffer_rebuilding_enabled_) {
37 SLOW_DCHECK(!heap_->code_space()->Contains(addr) && 38 SLOW_DCHECK(!heap_->code_space()->Contains(addr) &&
38 !heap_->new_space()->Contains(addr)); 39 !heap_->new_space()->Contains(addr));
39 Address* top = old_top_; 40 Address* top = old_top_;
40 *top++ = addr; 41 *top++ = addr;
41 old_top_ = top; 42 old_top_ = top;
42 old_buffer_is_sorted_ = false; 43 old_buffer_is_sorted_ = false;
43 old_buffer_is_filtered_ = false; 44 old_buffer_is_filtered_ = false;
44 if (top >= old_limit_) { 45 if (top >= old_limit_) {
45 DCHECK(callback_ != NULL); 46 DCHECK(callback_ != NULL);
46 (*callback_)(heap_, MemoryChunk::FromAnyPointerAddress(heap_, addr), 47 (*callback_)(heap_, MemoryChunk::FromAnyPointerAddress(heap_, addr),
47 kStoreBufferFullEvent); 48 kStoreBufferFullEvent);
48 } 49 }
49 } 50 }
50 } 51 }
52
53
54 void LocalStoreBuffer::Record(Address addr) {
55 if (top_->is_full()) top_ = new Node(top_);
56 top_->buffer[top_->count++] = addr;
57 }
58
59
60 void LocalStoreBuffer::Process(StoreBuffer* store_buffer) {
61 Node* current = top_;
62 while (current != nullptr) {
63 for (int i = 0; i < current->count; i++) {
64 store_buffer->Mark(current->buffer[i]);
65 }
66 current = current->next;
67 }
68 }
69
51 } // namespace internal 70 } // namespace internal
52 } // namespace v8 71 } // namespace v8
53 72
54 #endif // V8_STORE_BUFFER_INL_H_ 73 #endif // V8_STORE_BUFFER_INL_H_
OLDNEW
« src/heap/mark-compact.cc ('K') | « src/heap/store-buffer.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698