| 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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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); | 469 void RefillFreeList(PagedSpace* space); |
| 470 void RefillFreeList(CompactionSpace* space); |
| 470 | 471 |
| 471 // Checks if sweeping is in progress right now on any space. | 472 // Checks if sweeping is in progress right now on any space. |
| 472 bool sweeping_in_progress() { return sweeping_in_progress_; } | 473 bool sweeping_in_progress() { return sweeping_in_progress_; } |
| 473 | 474 |
| 474 void set_evacuation(bool evacuation) { evacuation_ = evacuation; } | 475 void set_evacuation(bool evacuation) { evacuation_ = evacuation; } |
| 475 | 476 |
| 476 bool evacuation() const { return evacuation_; } | 477 bool evacuation() const { return evacuation_; } |
| 477 | 478 |
| 478 // Special case for processing weak references in a full collection. We need | 479 // Special case for processing weak references in a full collection. We need |
| 479 // to artificially keep AllocationSites alive for a time. | 480 // to artificially keep AllocationSites alive for a time. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 509 void VerifyIsSlotInLiveObject(Address slot, HeapObject* object); | 510 void VerifyIsSlotInLiveObject(Address slot, HeapObject* object); |
| 510 | 511 |
| 511 // Removes all the slots in the slot buffers that are within the given | 512 // Removes all the slots in the slot buffers that are within the given |
| 512 // address range. | 513 // address range. |
| 513 void RemoveObjectSlots(Address start_slot, Address end_slot); | 514 void RemoveObjectSlots(Address start_slot, Address end_slot); |
| 514 | 515 |
| 515 private: | 516 private: |
| 516 class CompactionTask; | 517 class CompactionTask; |
| 517 class SweeperTask; | 518 class SweeperTask; |
| 518 | 519 |
| 520 static const intptr_t kCompactionSpaceMemoryWanted = 500 * KB; |
| 521 |
| 519 explicit MarkCompactCollector(Heap* heap); | 522 explicit MarkCompactCollector(Heap* heap); |
| 520 ~MarkCompactCollector(); | 523 ~MarkCompactCollector(); |
| 521 | 524 |
| 522 bool WillBeDeoptimized(Code* code); | 525 bool WillBeDeoptimized(Code* code); |
| 523 void EvictPopularEvacuationCandidate(Page* page); | 526 void EvictPopularEvacuationCandidate(Page* page); |
| 524 void ClearInvalidStoreAndSlotsBufferEntries(); | 527 void ClearInvalidStoreAndSlotsBufferEntries(); |
| 525 | 528 |
| 526 void StartSweeperThreads(); | 529 void StartSweeperThreads(); |
| 527 | 530 |
| 528 #ifdef DEBUG | 531 #ifdef DEBUG |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 847 private: | 850 private: |
| 848 MarkCompactCollector* collector_; | 851 MarkCompactCollector* collector_; |
| 849 }; | 852 }; |
| 850 | 853 |
| 851 | 854 |
| 852 const char* AllocationSpaceName(AllocationSpace space); | 855 const char* AllocationSpaceName(AllocationSpace space); |
| 853 } // namespace internal | 856 } // namespace internal |
| 854 } // namespace v8 | 857 } // namespace v8 |
| 855 | 858 |
| 856 #endif // V8_HEAP_MARK_COMPACT_H_ | 859 #endif // V8_HEAP_MARK_COMPACT_H_ |
| OLD | NEW |