OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_MARK_COMPACT_H_ | 5 #ifndef V8_HEAP_MARK_COMPACT_H_ |
6 #define V8_HEAP_MARK_COMPACT_H_ | 6 #define V8_HEAP_MARK_COMPACT_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 class MinorMarkCompactCollector { | 416 class MinorMarkCompactCollector { |
417 public: | 417 public: |
418 explicit MinorMarkCompactCollector(Heap* heap) | 418 explicit MinorMarkCompactCollector(Heap* heap) |
419 : heap_(heap), marking_deque_(heap) {} | 419 : heap_(heap), marking_deque_(heap) {} |
420 | 420 |
421 void SetUp(); | 421 void SetUp(); |
422 void TearDown(); | 422 void TearDown(); |
423 | 423 |
424 void CollectGarbage(); | 424 void CollectGarbage(); |
425 | 425 |
| 426 inline Heap* heap() const { return heap_; } |
| 427 |
426 private: | 428 private: |
427 class RootMarkingVisitor; | 429 class RootMarkingVisitor; |
428 | 430 |
429 inline Heap* heap() { return heap_; } | |
430 inline Isolate* isolate() { return heap()->isolate(); } | 431 inline Isolate* isolate() { return heap()->isolate(); } |
431 inline MarkingDeque* marking_deque() { return &marking_deque_; } | 432 inline MarkingDeque* marking_deque() { return &marking_deque_; } |
432 | 433 |
433 V8_INLINE void MarkObject(HeapObject* obj); | 434 V8_INLINE void MarkObject(HeapObject* obj); |
434 V8_INLINE void PushBlack(HeapObject* obj); | 435 V8_INLINE void PushBlack(HeapObject* obj); |
435 | 436 |
436 SlotCallbackResult CheckAndMarkObject(Heap* heap, Address slot_address); | 437 SlotCallbackResult CheckAndMarkObject(Heap* heap, Address slot_address); |
437 void MarkLiveObjects(); | 438 void MarkLiveObjects(); |
438 void ProcessMarkingDeque(); | 439 void ProcessMarkingDeque(); |
439 void EmptyMarkingDeque(); | 440 void EmptyMarkingDeque(); |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 | 861 |
861 private: | 862 private: |
862 MarkCompactCollector* collector_; | 863 MarkCompactCollector* collector_; |
863 }; | 864 }; |
864 | 865 |
865 V8_EXPORT_PRIVATE const char* AllocationSpaceName(AllocationSpace space); | 866 V8_EXPORT_PRIVATE const char* AllocationSpaceName(AllocationSpace space); |
866 } // namespace internal | 867 } // namespace internal |
867 } // namespace v8 | 868 } // namespace v8 |
868 | 869 |
869 #endif // V8_HEAP_MARK_COMPACT_H_ | 870 #endif // V8_HEAP_MARK_COMPACT_H_ |
OLD | NEW |