| 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 "src/base/bits.h" | 8 #include "src/base/bits.h" |
| 9 #include "src/heap/spaces.h" | 9 #include "src/heap/spaces.h" |
| 10 | 10 |
| (...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 void UncommitMarkingDeque(); | 677 void UncommitMarkingDeque(); |
| 678 | 678 |
| 679 // The following four methods can just be called after marking, when the | 679 // The following four methods can just be called after marking, when the |
| 680 // whole transitive closure is known. They must be called before sweeping | 680 // whole transitive closure is known. They must be called before sweeping |
| 681 // when mark bits are still intact. | 681 // when mark bits are still intact. |
| 682 bool IsSlotInBlackObject(Page* p, Address slot); | 682 bool IsSlotInBlackObject(Page* p, Address slot); |
| 683 bool IsSlotInBlackObjectSlow(Page* p, Address slot); | 683 bool IsSlotInBlackObjectSlow(Page* p, Address slot); |
| 684 bool IsSlotInLiveObject(HeapObject** address, HeapObject* object); | 684 bool IsSlotInLiveObject(HeapObject** address, HeapObject* object); |
| 685 void VerifyIsSlotInLiveObject(HeapObject** address, HeapObject* object); | 685 void VerifyIsSlotInLiveObject(HeapObject** address, HeapObject* object); |
| 686 | 686 |
| 687 size_t last_mark_compact_time() const { return last_mark_compact_time_; } |
| 688 |
| 687 private: | 689 private: |
| 688 class SweeperTask; | 690 class SweeperTask; |
| 689 | 691 |
| 690 explicit MarkCompactCollector(Heap* heap); | 692 explicit MarkCompactCollector(Heap* heap); |
| 691 ~MarkCompactCollector(); | 693 ~MarkCompactCollector(); |
| 692 | 694 |
| 693 bool MarkInvalidatedCode(); | 695 bool MarkInvalidatedCode(); |
| 694 bool WillBeDeoptimized(Code* code); | 696 bool WillBeDeoptimized(Code* code); |
| 695 void RemoveDeadInvalidatedCode(); | 697 void RemoveDeadInvalidatedCode(); |
| 696 void ProcessInvalidatedCode(ObjectVisitor* visitor); | 698 void ProcessInvalidatedCode(ObjectVisitor* visitor); |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 903 MarkingDeque marking_deque_; | 905 MarkingDeque marking_deque_; |
| 904 CodeFlusher* code_flusher_; | 906 CodeFlusher* code_flusher_; |
| 905 bool have_code_to_deoptimize_; | 907 bool have_code_to_deoptimize_; |
| 906 | 908 |
| 907 List<Page*> evacuation_candidates_; | 909 List<Page*> evacuation_candidates_; |
| 908 List<Code*> invalidated_code_; | 910 List<Code*> invalidated_code_; |
| 909 | 911 |
| 910 SmartPointer<FreeList> free_list_old_data_space_; | 912 SmartPointer<FreeList> free_list_old_data_space_; |
| 911 SmartPointer<FreeList> free_list_old_pointer_space_; | 913 SmartPointer<FreeList> free_list_old_pointer_space_; |
| 912 | 914 |
| 915 size_t last_mark_compact_time_; |
| 916 |
| 913 friend class Heap; | 917 friend class Heap; |
| 914 }; | 918 }; |
| 915 | 919 |
| 916 | 920 |
| 917 class MarkBitCellIterator BASE_EMBEDDED { | 921 class MarkBitCellIterator BASE_EMBEDDED { |
| 918 public: | 922 public: |
| 919 explicit MarkBitCellIterator(MemoryChunk* chunk) : chunk_(chunk) { | 923 explicit MarkBitCellIterator(MemoryChunk* chunk) : chunk_(chunk) { |
| 920 last_cell_index_ = Bitmap::IndexToCell(Bitmap::CellAlignIndex( | 924 last_cell_index_ = Bitmap::IndexToCell(Bitmap::CellAlignIndex( |
| 921 chunk_->AddressToMarkbitIndex(chunk_->area_end()))); | 925 chunk_->AddressToMarkbitIndex(chunk_->area_end()))); |
| 922 cell_base_ = chunk_->area_start(); | 926 cell_base_ = chunk_->area_start(); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 967 private: | 971 private: |
| 968 MarkCompactCollector* collector_; | 972 MarkCompactCollector* collector_; |
| 969 }; | 973 }; |
| 970 | 974 |
| 971 | 975 |
| 972 const char* AllocationSpaceName(AllocationSpace space); | 976 const char* AllocationSpaceName(AllocationSpace space); |
| 973 } | 977 } |
| 974 } // namespace v8::internal | 978 } // namespace v8::internal |
| 975 | 979 |
| 976 #endif // V8_HEAP_MARK_COMPACT_H_ | 980 #endif // V8_HEAP_MARK_COMPACT_H_ |
| OLD | NEW |