Chromium Code Reviews| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 54 // exempt from the store buffer and process the promotion queue. These steps | 54 // exempt from the store buffer and process the promotion queue. These steps |
| 55 // can overflow this buffer. We check for this and on overflow we call the | 55 // can overflow this buffer. We check for this and on overflow we call the |
| 56 // callback set up with the StoreBufferRebuildScope object. | 56 // callback set up with the StoreBufferRebuildScope object. |
| 57 inline void EnterDirectlyIntoStoreBuffer(Address addr); | 57 inline void EnterDirectlyIntoStoreBuffer(Address addr); |
| 58 | 58 |
| 59 // Iterates over all pointers that go from old space to new space. It will | 59 // Iterates over all pointers that go from old space to new space. It will |
| 60 // delete the store buffer as it starts so the callback should reenter | 60 // delete the store buffer as it starts so the callback should reenter |
| 61 // surviving old-to-new pointers into the store buffer to rebuild it. | 61 // surviving old-to-new pointers into the store buffer to rebuild it. |
| 62 void IteratePointersToNewSpace(ObjectSlotCallback callback); | 62 void IteratePointersToNewSpace(ObjectSlotCallback callback); |
| 63 | 63 |
| 64 // Iterate pointers to from semispace of new space found in memory interval | |
| 65 // from start to end within |object|. | |
| 66 void IteratePointersToFromSpace(HeapObject* target, int size, | |
|
Hannes Payer (out of office)
2015/10/23 11:41:19
These methods should live in heap. They have nothi
indutny
2015/10/23 15:17:09
Acknowledged.
| |
| 67 ObjectSlotCallback slot_callback); | |
| 68 | |
| 64 static const int kStoreBufferOverflowBit = 1 << (14 + kPointerSizeLog2); | 69 static const int kStoreBufferOverflowBit = 1 << (14 + kPointerSizeLog2); |
| 65 static const int kStoreBufferSize = kStoreBufferOverflowBit; | 70 static const int kStoreBufferSize = kStoreBufferOverflowBit; |
| 66 static const int kStoreBufferLength = kStoreBufferSize / sizeof(Address); | 71 static const int kStoreBufferLength = kStoreBufferSize / sizeof(Address); |
| 67 static const int kOldStoreBufferLength = kStoreBufferLength * 16; | 72 static const int kOldStoreBufferLength = kStoreBufferLength * 16; |
| 68 static const int kHashSetLengthLog2 = 12; | 73 static const int kHashSetLengthLog2 = 12; |
| 69 static const int kHashSetLength = 1 << kHashSetLengthLog2; | 74 static const int kHashSetLength = 1 << kHashSetLengthLog2; |
| 70 | 75 |
| 71 void Compact(); | 76 void Compact(); |
| 72 | 77 |
| 73 void GCPrologue(); | 78 void GCPrologue(); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 151 // visit_pointer_region callback. | 156 // visit_pointer_region callback. |
| 152 // If either visit_pointer_region or callback can cause an allocation | 157 // If either visit_pointer_region or callback can cause an allocation |
| 153 // in old space and changes in allocation watermark then | 158 // in old space and changes in allocation watermark then |
| 154 // can_preallocate_during_iteration should be set to true. | 159 // can_preallocate_during_iteration should be set to true. |
| 155 void IteratePointersOnPage(PagedSpace* space, Page* page, | 160 void IteratePointersOnPage(PagedSpace* space, Page* page, |
| 156 RegionCallback region_callback, | 161 RegionCallback region_callback, |
| 157 ObjectSlotCallback slot_callback); | 162 ObjectSlotCallback slot_callback); |
| 158 | 163 |
| 159 void IteratePointersInStoreBuffer(ObjectSlotCallback slot_callback); | 164 void IteratePointersInStoreBuffer(ObjectSlotCallback slot_callback); |
| 160 | 165 |
| 166 void IterateAndMarkPointersToFromSpace(HeapObject* object, Address start, | |
|
Hannes Payer (out of office)
2015/10/23 11:41:19
Same same.
indutny
2015/10/23 15:17:09
Acknowledged.
| |
| 167 Address end, bool record_slots, | |
| 168 ObjectSlotCallback slot_callback); | |
| 169 | |
| 161 #ifdef VERIFY_HEAP | 170 #ifdef VERIFY_HEAP |
| 162 void VerifyPointers(LargeObjectSpace* space); | 171 void VerifyPointers(LargeObjectSpace* space); |
| 163 #endif | 172 #endif |
| 164 | 173 |
| 165 friend class StoreBufferRebuildScope; | 174 friend class StoreBufferRebuildScope; |
| 166 friend class DontMoveStoreBufferEntriesScope; | 175 friend class DontMoveStoreBufferEntriesScope; |
| 167 }; | 176 }; |
| 168 | 177 |
| 169 | 178 |
| 170 class StoreBufferRebuilder { | 179 class StoreBufferRebuilder { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 224 } | 233 } |
| 225 | 234 |
| 226 private: | 235 private: |
| 227 StoreBuffer* store_buffer_; | 236 StoreBuffer* store_buffer_; |
| 228 bool stored_state_; | 237 bool stored_state_; |
| 229 }; | 238 }; |
| 230 } // namespace internal | 239 } // namespace internal |
| 231 } // namespace v8 | 240 } // namespace v8 |
| 232 | 241 |
| 233 #endif // V8_STORE_BUFFER_H_ | 242 #endif // V8_STORE_BUFFER_H_ |
| OLD | NEW |