Chromium Code Reviews| Index: src/heap/store-buffer.h |
| diff --git a/src/heap/store-buffer.h b/src/heap/store-buffer.h |
| index 9eeb00117b8509cd9082b2fdc9f61ee9692ad718..98a4a73ebdfbf3730d37d2af2c4e0e8760f32fc8 100644 |
| --- a/src/heap/store-buffer.h |
| +++ b/src/heap/store-buffer.h |
| @@ -216,6 +216,40 @@ class DontMoveStoreBufferEntriesScope { |
| StoreBuffer* store_buffer_; |
| bool stored_state_; |
| }; |
| + |
| + |
| +class LocalStoreBuffer BASE_EMBEDDED { |
| + public: |
| + LocalStoreBuffer() : top_(new Node(nullptr)) {} |
| + |
| + ~LocalStoreBuffer() { |
| + Node* current = top_; |
| + while (current != nullptr) { |
| + Node* tmp = current->next; |
| + delete current; |
| + current = tmp; |
| + } |
| + } |
| + |
| + inline void Record(Address addr); |
| + inline void Process(StoreBuffer* store_buffer); |
| + |
| + private: |
| + static const int kBufferSize = 16 * KB; |
|
Michael Lippautz
2016/01/14 19:51:55
Profiled using v8.infinite_scroll.
|
| + |
| + struct Node : Malloced { |
| + explicit Node(Node* next_node) : next(next_node), count(0) {} |
| + |
| + inline bool is_full() { return count == kBufferSize; } |
| + |
| + Node* next; |
| + Address buffer[kBufferSize]; |
| + int count; |
| + }; |
| + |
| + Node* top_; |
| +}; |
| + |
| } // namespace internal |
| } // namespace v8 |