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

Side by Side Diff: src/heap/store-buffer.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_H_ 5 #ifndef V8_STORE_BUFFER_H_
6 #define V8_STORE_BUFFER_H_ 6 #define V8_STORE_BUFFER_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/base/logging.h" 9 #include "src/base/logging.h"
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 } 209 }
210 210
211 ~DontMoveStoreBufferEntriesScope() { 211 ~DontMoveStoreBufferEntriesScope() {
212 store_buffer_->may_move_store_buffer_entries_ = stored_state_; 212 store_buffer_->may_move_store_buffer_entries_ = stored_state_;
213 } 213 }
214 214
215 private: 215 private:
216 StoreBuffer* store_buffer_; 216 StoreBuffer* store_buffer_;
217 bool stored_state_; 217 bool stored_state_;
218 }; 218 };
219
220
221 class LocalStoreBuffer BASE_EMBEDDED {
222 public:
223 LocalStoreBuffer() : top_(new Node(nullptr)) {}
224
225 ~LocalStoreBuffer() {
226 Node* current = top_;
227 while (current != nullptr) {
228 Node* tmp = current->next;
229 delete current;
230 current = tmp;
231 }
232 }
233
234 inline void Record(Address addr);
235 inline void Process(StoreBuffer* store_buffer);
236
237 private:
238 static const int kBufferSize = 16 * KB;
239
240 struct Node : Malloced {
241 explicit Node(Node* next_node) : next(next_node), count(0) {}
242
243 inline bool is_full() { return count == kBufferSize; }
244
245 Node* next;
246 Address buffer[kBufferSize];
247 int count;
248 };
249
250 Node* top_;
251 };
252
219 } // namespace internal 253 } // namespace internal
220 } // namespace v8 254 } // namespace v8
221 255
222 #endif // V8_STORE_BUFFER_H_ 256 #endif // V8_STORE_BUFFER_H_
OLDNEW
« src/heap/mark-compact.cc ('K') | « src/heap/spaces.cc ('k') | src/heap/store-buffer-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698