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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 | 459 |
460 void EnsureSweepingCompleted(); | 460 void EnsureSweepingCompleted(); |
461 | 461 |
462 void SweepOrWaitUntilSweepingCompleted(Page* page); | 462 void SweepOrWaitUntilSweepingCompleted(Page* page); |
463 | 463 |
464 // If sweeper threads are not active this method will return true. If | 464 // If sweeper threads are not active this method will return true. If |
465 // this is a latency issue we should be smarter here. Otherwise, it will | 465 // this is a latency issue we should be smarter here. Otherwise, it will |
466 // return true if the sweeper threads are done processing the pages. | 466 // return true if the sweeper threads are done processing the pages. |
467 bool IsSweepingCompleted(); | 467 bool IsSweepingCompleted(); |
468 | 468 |
| 469 void RefillFreeList(PagedSpace* space); |
| 470 |
469 // Checks if sweeping is in progress right now on any space. | 471 // Checks if sweeping is in progress right now on any space. |
470 bool sweeping_in_progress() { return sweeping_in_progress_; } | 472 bool sweeping_in_progress() { return sweeping_in_progress_; } |
471 | 473 |
472 void set_evacuation(bool evacuation) { evacuation_ = evacuation; } | 474 void set_evacuation(bool evacuation) { evacuation_ = evacuation; } |
473 | 475 |
474 bool evacuation() const { return evacuation_; } | 476 bool evacuation() const { return evacuation_; } |
475 | 477 |
476 // Special case for processing weak references in a full collection. We need | 478 // Special case for processing weak references in a full collection. We need |
477 // to artificially keep AllocationSites alive for a time. | 479 // to artificially keep AllocationSites alive for a time. |
478 void MarkAllocationSite(AllocationSite* site); | 480 void MarkAllocationSite(AllocationSite* site); |
(...skipping 24 matching lines...) Expand all Loading... |
503 // when mark bits are still intact. | 505 // when mark bits are still intact. |
504 bool IsSlotInBlackObject(Page* p, Address slot, HeapObject** out_object); | 506 bool IsSlotInBlackObject(Page* p, Address slot, HeapObject** out_object); |
505 bool IsSlotInBlackObjectSlow(Page* p, Address slot); | 507 bool IsSlotInBlackObjectSlow(Page* p, Address slot); |
506 bool IsSlotInLiveObject(Address slot); | 508 bool IsSlotInLiveObject(Address slot); |
507 void VerifyIsSlotInLiveObject(Address slot, HeapObject* object); | 509 void VerifyIsSlotInLiveObject(Address slot, HeapObject* object); |
508 | 510 |
509 // Removes all the slots in the slot buffers that are within the given | 511 // Removes all the slots in the slot buffers that are within the given |
510 // address range. | 512 // address range. |
511 void RemoveObjectSlots(Address start_slot, Address end_slot); | 513 void RemoveObjectSlots(Address start_slot, Address end_slot); |
512 | 514 |
513 // | |
514 // Free lists filled by sweeper and consumed by corresponding spaces | |
515 // (including compaction spaces). | |
516 // | |
517 base::SmartPointer<FreeList>& free_list_old_space() { | |
518 return free_list_old_space_; | |
519 } | |
520 base::SmartPointer<FreeList>& free_list_code_space() { | |
521 return free_list_code_space_; | |
522 } | |
523 base::SmartPointer<FreeList>& free_list_map_space() { | |
524 return free_list_map_space_; | |
525 } | |
526 | |
527 private: | 515 private: |
528 class CompactionTask; | 516 class CompactionTask; |
529 class SweeperTask; | 517 class SweeperTask; |
530 | 518 |
531 explicit MarkCompactCollector(Heap* heap); | 519 explicit MarkCompactCollector(Heap* heap); |
532 ~MarkCompactCollector(); | 520 ~MarkCompactCollector(); |
533 | 521 |
534 bool WillBeDeoptimized(Code* code); | 522 bool WillBeDeoptimized(Code* code); |
535 void EvictPopularEvacuationCandidate(Page* page); | 523 void EvictPopularEvacuationCandidate(Page* page); |
536 void ClearInvalidStoreAndSlotsBufferEntries(); | 524 void ClearInvalidStoreAndSlotsBufferEntries(); |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 private: | 847 private: |
860 MarkCompactCollector* collector_; | 848 MarkCompactCollector* collector_; |
861 }; | 849 }; |
862 | 850 |
863 | 851 |
864 const char* AllocationSpaceName(AllocationSpace space); | 852 const char* AllocationSpaceName(AllocationSpace space); |
865 } // namespace internal | 853 } // namespace internal |
866 } // namespace v8 | 854 } // namespace v8 |
867 | 855 |
868 #endif // V8_HEAP_MARK_COMPACT_H_ | 856 #endif // V8_HEAP_MARK_COMPACT_H_ |
OLD | NEW |