| 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_MARK_COMPACT_H_ | 5 #ifndef V8_MARK_COMPACT_H_ |
| 6 #define V8_MARK_COMPACT_H_ | 6 #define V8_MARK_COMPACT_H_ |
| 7 | 7 |
| 8 #include "src/compiler-intrinsics.h" | 8 #include "src/compiler-intrinsics.h" |
| 9 #include "src/spaces.h" | 9 #include "src/spaces.h" |
| 10 | 10 |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 | 651 |
| 652 bool abort_incremental_marking() const { return abort_incremental_marking_; } | 652 bool abort_incremental_marking() const { return abort_incremental_marking_; } |
| 653 | 653 |
| 654 bool is_compacting() const { return compacting_; } | 654 bool is_compacting() const { return compacting_; } |
| 655 | 655 |
| 656 MarkingParity marking_parity() { return marking_parity_; } | 656 MarkingParity marking_parity() { return marking_parity_; } |
| 657 | 657 |
| 658 // Concurrent and parallel sweeping support. If required_freed_bytes was set | 658 // Concurrent and parallel sweeping support. If required_freed_bytes was set |
| 659 // to a value larger than 0, then sweeping returns after a block of at least | 659 // to a value larger than 0, then sweeping returns after a block of at least |
| 660 // required_freed_bytes was freed. If required_freed_bytes was set to zero | 660 // required_freed_bytes was freed. If required_freed_bytes was set to zero |
| 661 // then the whole given space is swept. | 661 // then the whole given space is swept. It returns the size of the maximum |
| 662 // continuous freed memory chunk. |
| 662 int SweepInParallel(PagedSpace* space, int required_freed_bytes); | 663 int SweepInParallel(PagedSpace* space, int required_freed_bytes); |
| 663 | 664 |
| 665 // Sweeps a given page concurrently to the sweeper threads. It returns the |
| 666 // size of the maximum continuous freed memory chunk. |
| 667 int SweepInParallel(Page* page, PagedSpace* space); |
| 668 |
| 664 void EnsureSweepingCompleted(); | 669 void EnsureSweepingCompleted(); |
| 665 | 670 |
| 666 // If sweeper threads are not active this method will return true. If | 671 // If sweeper threads are not active this method will return true. If |
| 667 // this is a latency issue we should be smarter here. Otherwise, it will | 672 // this is a latency issue we should be smarter here. Otherwise, it will |
| 668 // return true if the sweeper threads are done processing the pages. | 673 // return true if the sweeper threads are done processing the pages. |
| 669 bool IsSweepingCompleted(); | 674 bool IsSweepingCompleted(); |
| 670 | 675 |
| 671 void RefillFreeList(PagedSpace* space); | 676 void RefillFreeList(PagedSpace* space); |
| 672 | 677 |
| 673 bool AreSweeperThreadsActivated(); | 678 bool AreSweeperThreadsActivated(); |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 978 private: | 983 private: |
| 979 MarkCompactCollector* collector_; | 984 MarkCompactCollector* collector_; |
| 980 }; | 985 }; |
| 981 | 986 |
| 982 | 987 |
| 983 const char* AllocationSpaceName(AllocationSpace space); | 988 const char* AllocationSpaceName(AllocationSpace space); |
| 984 | 989 |
| 985 } } // namespace v8::internal | 990 } } // namespace v8::internal |
| 986 | 991 |
| 987 #endif // V8_MARK_COMPACT_H_ | 992 #endif // V8_MARK_COMPACT_H_ |
| OLD | NEW |