| 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" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 ObjectSlotCallback slot_callback); | 23 ObjectSlotCallback slot_callback); |
| 24 | 24 |
| 25 // Used to implement the write barrier by collecting addresses of pointers | 25 // Used to implement the write barrier by collecting addresses of pointers |
| 26 // between spaces. | 26 // between spaces. |
| 27 class StoreBuffer { | 27 class StoreBuffer { |
| 28 public: | 28 public: |
| 29 explicit StoreBuffer(Heap* heap); | 29 explicit StoreBuffer(Heap* heap); |
| 30 | 30 |
| 31 static void StoreBufferOverflow(Isolate* isolate); | 31 static void StoreBufferOverflow(Isolate* isolate); |
| 32 | 32 |
| 33 inline Address TopAddress(); | |
| 34 | |
| 35 void SetUp(); | 33 void SetUp(); |
| 36 void TearDown(); | 34 void TearDown(); |
| 37 | 35 |
| 38 // This is used by the mutator to enter addresses into the store buffer. | 36 // This is used by the mutator to enter addresses into the store buffer. |
| 39 inline void Mark(Address addr); | 37 inline void Mark(Address addr); |
| 40 | 38 |
| 41 // This is used by the heap traversal to enter the addresses into the store | 39 // This is used by the heap traversal to enter the addresses into the store |
| 42 // buffer that should still be in the store buffer after GC. It enters | 40 // buffer that should still be in the store buffer after GC. It enters |
| 43 // addresses directly into the old buffer because the GC starts by wiping the | 41 // addresses directly into the old buffer because the GC starts by wiping the |
| 44 // old buffer and thereafter only visits each cell once so there is no need | 42 // old buffer and thereafter only visits each cell once so there is no need |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 } | 217 } |
| 220 | 218 |
| 221 private: | 219 private: |
| 222 StoreBuffer* store_buffer_; | 220 StoreBuffer* store_buffer_; |
| 223 bool stored_state_; | 221 bool stored_state_; |
| 224 }; | 222 }; |
| 225 } | 223 } |
| 226 } // namespace v8::internal | 224 } // namespace v8::internal |
| 227 | 225 |
| 228 #endif // V8_STORE_BUFFER_H_ | 226 #endif // V8_STORE_BUFFER_H_ |
| OLD | NEW |