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