| 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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 546 | 546 | 
| 547   // True if concurrent or parallel sweeping is currently in progress. | 547   // True if concurrent or parallel sweeping is currently in progress. | 
| 548   bool sweeping_in_progress_; | 548   bool sweeping_in_progress_; | 
| 549 | 549 | 
| 550   // True if parallel compaction is currently in progress. | 550   // True if parallel compaction is currently in progress. | 
| 551   bool parallel_compaction_in_progress_; | 551   bool parallel_compaction_in_progress_; | 
| 552 | 552 | 
| 553   // Synchronize sweeper threads. | 553   // Synchronize sweeper threads. | 
| 554   base::Semaphore pending_sweeper_jobs_semaphore_; | 554   base::Semaphore pending_sweeper_jobs_semaphore_; | 
| 555 | 555 | 
| 556   // Synchronize compaction threads. | 556   // Synchronize compaction tasks. | 
| 557   base::Semaphore pending_compaction_jobs_semaphore_; | 557   base::Semaphore pending_compaction_tasks_semaphore_; | 
|  | 558 | 
|  | 559   // Number of active compaction tasks (including main thread). | 
|  | 560   intptr_t concurrent_compaction_tasks_active_; | 
| 558 | 561 | 
| 559   bool evacuation_; | 562   bool evacuation_; | 
| 560 | 563 | 
| 561   SlotsBufferAllocator* slots_buffer_allocator_; | 564   SlotsBufferAllocator* slots_buffer_allocator_; | 
| 562 | 565 | 
| 563   SlotsBuffer* migration_slots_buffer_; | 566   SlotsBuffer* migration_slots_buffer_; | 
| 564 | 567 | 
| 565   base::Mutex migration_slots_buffer_mutex_; | 568   base::Mutex migration_slots_buffer_mutex_; | 
| 566 | 569 | 
| 567   // Finishes GC, performs heap verification if enabled. | 570   // Finishes GC, performs heap verification if enabled. | 
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 705   // If we are not compacting the heap, we simply sweep the spaces except | 708   // If we are not compacting the heap, we simply sweep the spaces except | 
| 706   // for the large object space, clearing mark bits and adding unmarked | 709   // for the large object space, clearing mark bits and adding unmarked | 
| 707   // regions to each space's free list. | 710   // regions to each space's free list. | 
| 708   void SweepSpaces(); | 711   void SweepSpaces(); | 
| 709 | 712 | 
| 710   int DiscoverAndEvacuateBlackObjectsOnPage(NewSpace* new_space, | 713   int DiscoverAndEvacuateBlackObjectsOnPage(NewSpace* new_space, | 
| 711                                             NewSpacePage* p); | 714                                             NewSpacePage* p); | 
| 712 | 715 | 
| 713   void EvacuateNewSpace(); | 716   void EvacuateNewSpace(); | 
| 714 | 717 | 
| 715   void EvacuateLiveObjectsFromPage(Page* p, PagedSpace* target_space); | 718   bool EvacuateLiveObjectsFromPage(Page* p, PagedSpace* target_space); | 
| 716 | 719 | 
| 717   void EvacuatePages(); | 720   void EvacuatePages(CompactionSpaceCollection* compaction_spaces); | 
|  | 721   void EvacuatePagesInParallel(); | 
| 718 | 722 | 
| 719   void EvacuatePagesInParallel(); | 723   int NumberOfParallelCompactionTasks() { | 
|  | 724     // TODO(hpayer, mlippautz): Figure out some logic to determine the number | 
|  | 725     // of compaction tasks. | 
|  | 726     return 1; | 
|  | 727   } | 
| 720 | 728 | 
| 721   void WaitUntilCompactionCompleted(); | 729   void WaitUntilCompactionCompleted(); | 
| 722 | 730 | 
| 723   void EvacuateNewSpaceAndCandidates(); | 731   void EvacuateNewSpaceAndCandidates(); | 
| 724 | 732 | 
| 725   void ReleaseEvacuationCandidates(); | 733   void ReleaseEvacuationCandidates(); | 
| 726 | 734 | 
| 727   // Moves the pages of the evacuation_candidates_ list to the end of their | 735   // Moves the pages of the evacuation_candidates_ list to the end of their | 
| 728   // corresponding space pages list. | 736   // corresponding space pages list. | 
| 729   void MoveEvacuationCandidatesToEndOfPagesList(); | 737   void MoveEvacuationCandidatesToEndOfPagesList(); | 
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 823  private: | 831  private: | 
| 824   MarkCompactCollector* collector_; | 832   MarkCompactCollector* collector_; | 
| 825 }; | 833 }; | 
| 826 | 834 | 
| 827 | 835 | 
| 828 const char* AllocationSpaceName(AllocationSpace space); | 836 const char* AllocationSpaceName(AllocationSpace space); | 
| 829 } | 837 } | 
| 830 }  // namespace v8::internal | 838 }  // namespace v8::internal | 
| 831 | 839 | 
| 832 #endif  // V8_HEAP_MARK_COMPACT_H_ | 840 #endif  // V8_HEAP_MARK_COMPACT_H_ | 
| OLD | NEW | 
|---|