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/globals.h" | 11 #include "src/globals.h" |
12 #include "src/heap/slot-set.h" | 12 #include "src/heap/slot-set.h" |
13 | 13 |
14 namespace v8 { | 14 namespace v8 { |
15 namespace internal { | 15 namespace internal { |
16 | 16 |
17 // Intermediate buffer that accumulates old-to-new stores from the generated | 17 // Intermediate buffer that accumulates old-to-new stores from the generated |
18 // code. On buffer overflow the slots are moved to the remembered set. | 18 // code. On buffer overflow the slots are moved to the remembered set. |
19 class StoreBuffer { | 19 class StoreBuffer { |
20 public: | 20 public: |
| 21 static const int kStoreBufferOverflowBit = 1 << (14 + kPointerSizeLog2); |
| 22 static const int kStoreBufferSize = kStoreBufferOverflowBit; |
| 23 static const int kStoreBufferLength = kStoreBufferSize / sizeof(Address); |
| 24 |
| 25 static void StoreBufferOverflow(Isolate* isolate); |
| 26 |
21 explicit StoreBuffer(Heap* heap); | 27 explicit StoreBuffer(Heap* heap); |
22 static void StoreBufferOverflow(Isolate* isolate); | |
23 void SetUp(); | 28 void SetUp(); |
24 void TearDown(); | 29 void TearDown(); |
25 | 30 |
26 static const int kStoreBufferOverflowBit = 1 << (14 + kPointerSizeLog2); | 31 // Used to add entries from generated code. |
27 static const int kStoreBufferSize = kStoreBufferOverflowBit; | 32 inline Address* top_address() { return reinterpret_cast<Address*>(&top_); } |
28 static const int kStoreBufferLength = kStoreBufferSize / sizeof(Address); | |
29 | 33 |
30 void MoveEntriesToRememberedSet(); | 34 void MoveEntriesToRememberedSet(); |
31 | 35 |
32 private: | 36 private: |
33 Heap* heap_; | 37 Heap* heap_; |
34 | 38 |
| 39 Address* top_; |
| 40 |
35 // The start and the limit of the buffer that contains store slots | 41 // The start and the limit of the buffer that contains store slots |
36 // added from the generated code. | 42 // added from the generated code. |
37 Address* start_; | 43 Address* start_; |
38 Address* limit_; | 44 Address* limit_; |
39 | 45 |
40 base::VirtualMemory* virtual_memory_; | 46 base::VirtualMemory* virtual_memory_; |
41 }; | 47 }; |
42 | 48 |
43 } // namespace internal | 49 } // namespace internal |
44 } // namespace v8 | 50 } // namespace v8 |
45 | 51 |
46 #endif // V8_STORE_BUFFER_H_ | 52 #endif // V8_STORE_BUFFER_H_ |
OLD | NEW |