| 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_HEAP_SPACES_H_ | 5 #ifndef V8_HEAP_SPACES_H_ |
| 6 #define V8_HEAP_SPACES_H_ | 6 #define V8_HEAP_SPACES_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <unordered_set> | 10 #include <unordered_set> |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 inline SlotSet* old_to_new_slots() { return old_to_new_slots_; } | 456 inline SlotSet* old_to_new_slots() { return old_to_new_slots_; } |
| 457 inline SlotSet* old_to_old_slots() { return old_to_old_slots_; } | 457 inline SlotSet* old_to_old_slots() { return old_to_old_slots_; } |
| 458 inline TypedSlotSet* typed_old_to_new_slots() { | 458 inline TypedSlotSet* typed_old_to_new_slots() { |
| 459 return typed_old_to_new_slots_; | 459 return typed_old_to_new_slots_; |
| 460 } | 460 } |
| 461 inline TypedSlotSet* typed_old_to_old_slots() { | 461 inline TypedSlotSet* typed_old_to_old_slots() { |
| 462 return typed_old_to_old_slots_; | 462 return typed_old_to_old_slots_; |
| 463 } | 463 } |
| 464 inline LocalArrayBufferTracker* local_tracker() { return local_tracker_; } | 464 inline LocalArrayBufferTracker* local_tracker() { return local_tracker_; } |
| 465 | 465 |
| 466 V8_EXPORT_PRIVATE void AllocateOldToNewSlots(); | 466 void AllocateOldToNewSlots(); |
| 467 void ReleaseOldToNewSlots(); | 467 void ReleaseOldToNewSlots(); |
| 468 void AllocateOldToOldSlots(); | 468 void AllocateOldToOldSlots(); |
| 469 void ReleaseOldToOldSlots(); | 469 void ReleaseOldToOldSlots(); |
| 470 void AllocateTypedOldToNewSlots(); | 470 void AllocateTypedOldToNewSlots(); |
| 471 void ReleaseTypedOldToNewSlots(); | 471 void ReleaseTypedOldToNewSlots(); |
| 472 void AllocateTypedOldToOldSlots(); | 472 void AllocateTypedOldToOldSlots(); |
| 473 void ReleaseTypedOldToOldSlots(); | 473 void ReleaseTypedOldToOldSlots(); |
| 474 void AllocateLocalTracker(); | 474 void AllocateLocalTracker(); |
| 475 void ReleaseLocalTracker(); | 475 void ReleaseLocalTracker(); |
| 476 | 476 |
| (...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1423 | 1423 |
| 1424 | 1424 |
| 1425 // ----------------------------------------------------------------------------- | 1425 // ----------------------------------------------------------------------------- |
| 1426 // Interface for heap object iterator to be implemented by all object space | 1426 // Interface for heap object iterator to be implemented by all object space |
| 1427 // object iterators. | 1427 // object iterators. |
| 1428 // | 1428 // |
| 1429 // NOTE: The space specific object iterators also implements the own next() | 1429 // NOTE: The space specific object iterators also implements the own next() |
| 1430 // method which is used to avoid using virtual functions | 1430 // method which is used to avoid using virtual functions |
| 1431 // iterating a specific space. | 1431 // iterating a specific space. |
| 1432 | 1432 |
| 1433 class V8_EXPORT_PRIVATE ObjectIterator : public Malloced { | 1433 class ObjectIterator : public Malloced { |
| 1434 public: | 1434 public: |
| 1435 virtual ~ObjectIterator() {} | 1435 virtual ~ObjectIterator() {} |
| 1436 virtual HeapObject* Next() = 0; | 1436 virtual HeapObject* Next() = 0; |
| 1437 }; | 1437 }; |
| 1438 | 1438 |
| 1439 template <class PAGE_TYPE> | 1439 template <class PAGE_TYPE> |
| 1440 class PageIteratorImpl | 1440 class PageIteratorImpl |
| 1441 : public std::iterator<std::forward_iterator_tag, PAGE_TYPE> { | 1441 : public std::iterator<std::forward_iterator_tag, PAGE_TYPE> { |
| 1442 public: | 1442 public: |
| 1443 explicit PageIteratorImpl(PAGE_TYPE* p) : p_(p) {} | 1443 explicit PageIteratorImpl(PAGE_TYPE* p) : p_(p) {} |
| (...skipping 30 matching lines...) Expand all Loading... |
| 1474 | 1474 |
| 1475 // ----------------------------------------------------------------------------- | 1475 // ----------------------------------------------------------------------------- |
| 1476 // Heap object iterator in new/old/map spaces. | 1476 // Heap object iterator in new/old/map spaces. |
| 1477 // | 1477 // |
| 1478 // A HeapObjectIterator iterates objects from the bottom of the given space | 1478 // A HeapObjectIterator iterates objects from the bottom of the given space |
| 1479 // to its top or from the bottom of the given page to its top. | 1479 // to its top or from the bottom of the given page to its top. |
| 1480 // | 1480 // |
| 1481 // If objects are allocated in the page during iteration the iterator may | 1481 // If objects are allocated in the page during iteration the iterator may |
| 1482 // or may not iterate over those objects. The caller must create a new | 1482 // or may not iterate over those objects. The caller must create a new |
| 1483 // iterator in order to be sure to visit these new objects. | 1483 // iterator in order to be sure to visit these new objects. |
| 1484 class V8_EXPORT_PRIVATE HeapObjectIterator : public ObjectIterator { | 1484 class HeapObjectIterator : public ObjectIterator { |
| 1485 public: | 1485 public: |
| 1486 // Creates a new object iterator in a given space. | 1486 // Creates a new object iterator in a given space. |
| 1487 explicit HeapObjectIterator(PagedSpace* space); | 1487 explicit HeapObjectIterator(PagedSpace* space); |
| 1488 explicit HeapObjectIterator(Page* page); | 1488 explicit HeapObjectIterator(Page* page); |
| 1489 | 1489 |
| 1490 // Advance to the next object, skipping free spaces and other fillers and | 1490 // Advance to the next object, skipping free spaces and other fillers and |
| 1491 // skipping the special garbage section of which there is one per space. | 1491 // skipping the special garbage section of which there is one per space. |
| 1492 // Returns nullptr when the iteration has ended. | 1492 // Returns nullptr when the iteration has ended. |
| 1493 inline HeapObject* Next() override; | 1493 inline HeapObject* Next() override; |
| 1494 | 1494 |
| (...skipping 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2942 PageIterator old_iterator_; | 2942 PageIterator old_iterator_; |
| 2943 PageIterator code_iterator_; | 2943 PageIterator code_iterator_; |
| 2944 PageIterator map_iterator_; | 2944 PageIterator map_iterator_; |
| 2945 LargePageIterator lo_iterator_; | 2945 LargePageIterator lo_iterator_; |
| 2946 }; | 2946 }; |
| 2947 | 2947 |
| 2948 } // namespace internal | 2948 } // namespace internal |
| 2949 } // namespace v8 | 2949 } // namespace v8 |
| 2950 | 2950 |
| 2951 #endif // V8_HEAP_SPACES_H_ | 2951 #endif // V8_HEAP_SPACES_H_ |
| OLD | NEW |