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

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

Issue 1739003003: Version 5.0.71.2 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@5.0
Patch Set: Created 4 years, 10 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 | « src/heap/spaces-inl.h ('k') | src/heap/store-buffer-inl.h » ('j') | 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 #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 22 matching lines...) Expand all
33 Heap* heap_; 33 Heap* heap_;
34 34
35 // The start and the limit of the buffer that contains store slots 35 // The start and the limit of the buffer that contains store slots
36 // added from the generated code. 36 // added from the generated code.
37 Address* start_; 37 Address* start_;
38 Address* limit_; 38 Address* limit_;
39 39
40 base::VirtualMemory* virtual_memory_; 40 base::VirtualMemory* virtual_memory_;
41 }; 41 };
42 42
43
44 class LocalStoreBuffer BASE_EMBEDDED {
45 public:
46 explicit LocalStoreBuffer(Heap* heap)
47 : top_(new Node(nullptr)), heap_(heap) {}
48
49 ~LocalStoreBuffer() {
50 Node* current = top_;
51 while (current != nullptr) {
52 Node* tmp = current->next;
53 delete current;
54 current = tmp;
55 }
56 }
57
58 inline void Record(Address addr);
59 inline void Process(StoreBuffer* store_buffer);
60
61 private:
62 static const int kBufferSize = 16 * KB;
63
64 struct Node : Malloced {
65 explicit Node(Node* next_node) : next(next_node), count(0) {}
66
67 inline bool is_full() { return count == kBufferSize; }
68
69 Node* next;
70 Address buffer[kBufferSize];
71 int count;
72 };
73
74 Node* top_;
75 Heap* heap_;
76 };
77
43 } // namespace internal 78 } // namespace internal
44 } // namespace v8 79 } // namespace v8
45 80
46 #endif // V8_STORE_BUFFER_H_ 81 #endif // V8_STORE_BUFFER_H_
OLDNEW
« no previous file with comments | « src/heap/spaces-inl.h ('k') | src/heap/store-buffer-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698