OLD | NEW |
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" |
11 #include "src/cancelable-task.h" | 11 #include "src/cancelable-task.h" |
12 #include "src/globals.h" | 12 #include "src/globals.h" |
13 #include "src/heap/remembered-set.h" | 13 #include "src/heap/remembered-set.h" |
14 #include "src/heap/slot-set.h" | 14 #include "src/heap/slot-set.h" |
15 | 15 |
16 namespace v8 { | 16 namespace v8 { |
17 namespace internal { | 17 namespace internal { |
18 | 18 |
19 // Intermediate buffer that accumulates old-to-new stores from the generated | 19 // Intermediate buffer that accumulates old-to-new stores from the generated |
20 // code. Moreover, it stores invalid old-to-new slots with two entries. | 20 // code. Moreover, it stores invalid old-to-new slots with two entries. |
21 // The first is a tagged address of the start of the invalid range, the second | 21 // The first is a tagged address of the start of the invalid range, the second |
22 // one is the end address of the invalid range or null if there is just one slot | 22 // one is the end address of the invalid range or null if there is just one slot |
23 // that needs to be removed from the remembered set. On buffer overflow the | 23 // that needs to be removed from the remembered set. On buffer overflow the |
24 // slots are moved to the remembered set. | 24 // slots are moved to the remembered set. |
25 class StoreBuffer { | 25 class StoreBuffer { |
26 public: | 26 public: |
27 static const int kStoreBufferSize = 1 << (14 + kPointerSizeLog2); | 27 static const int kStoreBufferSize = 1 << (11 + kPointerSizeLog2); |
28 static const int kStoreBufferMask = kStoreBufferSize - 1; | 28 static const int kStoreBufferMask = kStoreBufferSize - 1; |
29 static const int kStoreBuffers = 2; | 29 static const int kStoreBuffers = 2; |
30 static const intptr_t kDeletionTag = 1; | 30 static const intptr_t kDeletionTag = 1; |
31 | 31 |
32 V8_EXPORT_PRIVATE static void StoreBufferOverflow(Isolate* isolate); | 32 V8_EXPORT_PRIVATE static void StoreBufferOverflow(Isolate* isolate); |
33 | 33 |
34 explicit StoreBuffer(Heap* heap); | 34 explicit StoreBuffer(Heap* heap); |
35 void SetUp(); | 35 void SetUp(); |
36 void TearDown(); | 36 void TearDown(); |
37 | 37 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 // Points to the current buffer in use. | 142 // Points to the current buffer in use. |
143 int current_; | 143 int current_; |
144 | 144 |
145 base::VirtualMemory* virtual_memory_; | 145 base::VirtualMemory* virtual_memory_; |
146 }; | 146 }; |
147 | 147 |
148 } // namespace internal | 148 } // namespace internal |
149 } // namespace v8 | 149 } // namespace v8 |
150 | 150 |
151 #endif // V8_STORE_BUFFER_H_ | 151 #endif // V8_STORE_BUFFER_H_ |
OLD | NEW |