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 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 } | 596 } |
597 | 597 |
598 // TODO(gc) If all evacuation candidates are too popular we | 598 // TODO(gc) If all evacuation candidates are too popular we |
599 // should stop slots recording entirely. | 599 // should stop slots recording entirely. |
600 page->ClearEvacuationCandidate(); | 600 page->ClearEvacuationCandidate(); |
601 | 601 |
602 // We were not collecting slots on this page that point | 602 // We were not collecting slots on this page that point |
603 // to other evacuation candidates thus we have to | 603 // to other evacuation candidates thus we have to |
604 // rescan the page after evacuation to discover and update all | 604 // rescan the page after evacuation to discover and update all |
605 // pointers to evacuated objects. | 605 // pointers to evacuated objects. |
606 if (page->owner()->identity() == OLD_DATA_SPACE) { | 606 page->SetFlag(Page::RESCAN_ON_EVACUATION); |
607 evacuation_candidates_.RemoveElement(page); | |
608 } else { | |
609 page->SetFlag(Page::RESCAN_ON_EVACUATION); | |
610 } | |
611 } | 607 } |
612 | 608 |
613 void RecordRelocSlot(RelocInfo* rinfo, Object* target); | 609 void RecordRelocSlot(RelocInfo* rinfo, Object* target); |
614 void RecordCodeEntrySlot(Address slot, Code* target); | 610 void RecordCodeEntrySlot(Address slot, Code* target); |
615 void RecordCodeTargetPatch(Address pc, Code* target); | 611 void RecordCodeTargetPatch(Address pc, Code* target); |
616 | 612 |
617 INLINE(void RecordSlot( | 613 INLINE(void RecordSlot( |
618 Object** anchor_slot, Object** slot, Object* object, | 614 Object** anchor_slot, Object** slot, Object* object, |
619 SlotsBuffer::AdditionMode mode = SlotsBuffer::FAIL_ON_OVERFLOW)); | 615 SlotsBuffer::AdditionMode mode = SlotsBuffer::FAIL_ON_OVERFLOW)); |
620 | 616 |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
900 Heap* heap_; | 896 Heap* heap_; |
901 base::VirtualMemory* marking_deque_memory_; | 897 base::VirtualMemory* marking_deque_memory_; |
902 bool marking_deque_memory_committed_; | 898 bool marking_deque_memory_committed_; |
903 MarkingDeque marking_deque_; | 899 MarkingDeque marking_deque_; |
904 CodeFlusher* code_flusher_; | 900 CodeFlusher* code_flusher_; |
905 bool have_code_to_deoptimize_; | 901 bool have_code_to_deoptimize_; |
906 | 902 |
907 List<Page*> evacuation_candidates_; | 903 List<Page*> evacuation_candidates_; |
908 List<Code*> invalidated_code_; | 904 List<Code*> invalidated_code_; |
909 | 905 |
910 SmartPointer<FreeList> free_list_old_data_space_; | 906 SmartPointer<FreeList> free_list_old_space_; |
911 SmartPointer<FreeList> free_list_old_pointer_space_; | |
912 | 907 |
913 friend class Heap; | 908 friend class Heap; |
914 }; | 909 }; |
915 | 910 |
916 | 911 |
917 class MarkBitCellIterator BASE_EMBEDDED { | 912 class MarkBitCellIterator BASE_EMBEDDED { |
918 public: | 913 public: |
919 explicit MarkBitCellIterator(MemoryChunk* chunk) : chunk_(chunk) { | 914 explicit MarkBitCellIterator(MemoryChunk* chunk) : chunk_(chunk) { |
920 last_cell_index_ = Bitmap::IndexToCell(Bitmap::CellAlignIndex( | 915 last_cell_index_ = Bitmap::IndexToCell(Bitmap::CellAlignIndex( |
921 chunk_->AddressToMarkbitIndex(chunk_->area_end()))); | 916 chunk_->AddressToMarkbitIndex(chunk_->area_end()))); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 private: | 962 private: |
968 MarkCompactCollector* collector_; | 963 MarkCompactCollector* collector_; |
969 }; | 964 }; |
970 | 965 |
971 | 966 |
972 const char* AllocationSpaceName(AllocationSpace space); | 967 const char* AllocationSpaceName(AllocationSpace space); |
973 } | 968 } |
974 } // namespace v8::internal | 969 } // namespace v8::internal |
975 | 970 |
976 #endif // V8_HEAP_MARK_COMPACT_H_ | 971 #endif // V8_HEAP_MARK_COMPACT_H_ |
OLD | NEW |