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 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 // then the whole given space is swept. It returns the size of the maximum | 692 // then the whole given space is swept. It returns the size of the maximum |
693 // continuous freed memory chunk. | 693 // continuous freed memory chunk. |
694 int SweepInParallel(PagedSpace* space, int required_freed_bytes); | 694 int SweepInParallel(PagedSpace* space, int required_freed_bytes); |
695 | 695 |
696 // Sweeps a given page concurrently to the sweeper threads. It returns the | 696 // Sweeps a given page concurrently to the sweeper threads. It returns the |
697 // size of the maximum continuous freed memory chunk. | 697 // size of the maximum continuous freed memory chunk. |
698 int SweepInParallel(Page* page, PagedSpace* space); | 698 int SweepInParallel(Page* page, PagedSpace* space); |
699 | 699 |
700 void EnsureSweepingCompleted(); | 700 void EnsureSweepingCompleted(); |
701 | 701 |
| 702 void SweepOrWaitUntilSweepingCompleted(Page* page); |
| 703 |
702 // If sweeper threads are not active this method will return true. If | 704 // If sweeper threads are not active this method will return true. If |
703 // this is a latency issue we should be smarter here. Otherwise, it will | 705 // this is a latency issue we should be smarter here. Otherwise, it will |
704 // return true if the sweeper threads are done processing the pages. | 706 // return true if the sweeper threads are done processing the pages. |
705 bool IsSweepingCompleted(); | 707 bool IsSweepingCompleted(); |
706 | 708 |
707 void RefillFreeList(PagedSpace* space); | 709 void RefillFreeList(PagedSpace* space); |
708 | 710 |
709 // Checks if sweeping is in progress right now on any space. | 711 // Checks if sweeping is in progress right now on any space. |
710 bool sweeping_in_progress() { return sweeping_in_progress_; } | 712 bool sweeping_in_progress() { return sweeping_in_progress_; } |
711 | 713 |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
972 base::VirtualMemory* marking_deque_memory_; | 974 base::VirtualMemory* marking_deque_memory_; |
973 size_t marking_deque_memory_committed_; | 975 size_t marking_deque_memory_committed_; |
974 MarkingDeque marking_deque_; | 976 MarkingDeque marking_deque_; |
975 CodeFlusher* code_flusher_; | 977 CodeFlusher* code_flusher_; |
976 bool have_code_to_deoptimize_; | 978 bool have_code_to_deoptimize_; |
977 | 979 |
978 List<Page*> evacuation_candidates_; | 980 List<Page*> evacuation_candidates_; |
979 List<Code*> invalidated_code_; | 981 List<Code*> invalidated_code_; |
980 | 982 |
981 base::SmartPointer<FreeList> free_list_old_space_; | 983 base::SmartPointer<FreeList> free_list_old_space_; |
| 984 base::SmartPointer<FreeList> free_list_code_space_; |
982 | 985 |
983 friend class Heap; | 986 friend class Heap; |
984 }; | 987 }; |
985 | 988 |
986 | 989 |
987 class MarkBitCellIterator BASE_EMBEDDED { | 990 class MarkBitCellIterator BASE_EMBEDDED { |
988 public: | 991 public: |
989 explicit MarkBitCellIterator(MemoryChunk* chunk) : chunk_(chunk) { | 992 explicit MarkBitCellIterator(MemoryChunk* chunk) : chunk_(chunk) { |
990 last_cell_index_ = Bitmap::IndexToCell(Bitmap::CellAlignIndex( | 993 last_cell_index_ = Bitmap::IndexToCell(Bitmap::CellAlignIndex( |
991 chunk_->AddressToMarkbitIndex(chunk_->area_end()))); | 994 chunk_->AddressToMarkbitIndex(chunk_->area_end()))); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1037 private: | 1040 private: |
1038 MarkCompactCollector* collector_; | 1041 MarkCompactCollector* collector_; |
1039 }; | 1042 }; |
1040 | 1043 |
1041 | 1044 |
1042 const char* AllocationSpaceName(AllocationSpace space); | 1045 const char* AllocationSpaceName(AllocationSpace space); |
1043 } | 1046 } |
1044 } // namespace v8::internal | 1047 } // namespace v8::internal |
1045 | 1048 |
1046 #endif // V8_HEAP_MARK_COMPACT_H_ | 1049 #endif // V8_HEAP_MARK_COMPACT_H_ |
OLD | NEW |