| 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 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 inline Heap* heap() const { return heap_; } | 565 inline Heap* heap() const { return heap_; } |
| 566 inline Isolate* isolate() const; | 566 inline Isolate* isolate() const; |
| 567 | 567 |
| 568 CodeFlusher* code_flusher() { return code_flusher_; } | 568 CodeFlusher* code_flusher() { return code_flusher_; } |
| 569 inline bool is_code_flushing_enabled() const { return code_flusher_ != NULL; } | 569 inline bool is_code_flushing_enabled() const { return code_flusher_ != NULL; } |
| 570 void EnableCodeFlushing(bool enable); | 570 void EnableCodeFlushing(bool enable); |
| 571 | 571 |
| 572 enum SweeperType { | 572 enum SweeperType { |
| 573 PARALLEL_CONSERVATIVE, | 573 PARALLEL_CONSERVATIVE, |
| 574 CONCURRENT_CONSERVATIVE, | 574 CONCURRENT_CONSERVATIVE, |
| 575 PARALLEL_PRECISE, |
| 576 CONCURRENT_PRECISE, |
| 575 PRECISE | 577 PRECISE |
| 576 }; | 578 }; |
| 577 | 579 |
| 578 enum SweepingParallelism { | 580 enum SweepingParallelism { |
| 579 SWEEP_ON_MAIN_THREAD, | 581 SWEEP_ON_MAIN_THREAD, |
| 580 SWEEP_IN_PARALLEL | 582 SWEEP_IN_PARALLEL |
| 581 }; | 583 }; |
| 582 | 584 |
| 583 #ifdef VERIFY_HEAP | 585 #ifdef VERIFY_HEAP |
| 584 void VerifyMarkbitsAreClean(); | 586 void VerifyMarkbitsAreClean(); |
| 585 static void VerifyMarkbitsAreClean(PagedSpace* space); | 587 static void VerifyMarkbitsAreClean(PagedSpace* space); |
| 586 static void VerifyMarkbitsAreClean(NewSpace* space); | 588 static void VerifyMarkbitsAreClean(NewSpace* space); |
| 587 void VerifyWeakEmbeddedObjectsInCode(); | 589 void VerifyWeakEmbeddedObjectsInCode(); |
| 588 void VerifyOmittedMapChecks(); | 590 void VerifyOmittedMapChecks(); |
| 589 #endif | 591 #endif |
| 590 | 592 |
| 591 // Sweep a single page from the given space conservatively. | 593 // Sweep a single page from the given space conservatively. |
| 592 // Returns the size of the biggest continuous freed memory chunk in bytes. | 594 // Returns the size of the biggest continuous freed memory chunk in bytes. |
| 593 template<SweepingParallelism type> | 595 template<SweepingParallelism type> |
| 594 static intptr_t SweepConservatively(PagedSpace* space, | 596 static int SweepConservatively(PagedSpace* space, |
| 595 FreeList* free_list, | 597 FreeList* free_list, |
| 596 Page* p); | 598 Page* p); |
| 597 | 599 |
| 598 INLINE(static bool ShouldSkipEvacuationSlotRecording(Object** anchor)) { | 600 INLINE(static bool ShouldSkipEvacuationSlotRecording(Object** anchor)) { |
| 599 return Page::FromAddress(reinterpret_cast<Address>(anchor))-> | 601 return Page::FromAddress(reinterpret_cast<Address>(anchor))-> |
| 600 ShouldSkipEvacuationSlotRecording(); | 602 ShouldSkipEvacuationSlotRecording(); |
| 601 } | 603 } |
| 602 | 604 |
| 603 INLINE(static bool ShouldSkipEvacuationSlotRecording(Object* host)) { | 605 INLINE(static bool ShouldSkipEvacuationSlotRecording(Object* host)) { |
| 604 return Page::FromAddress(reinterpret_cast<Address>(host))-> | 606 return Page::FromAddress(reinterpret_cast<Address>(host))-> |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 985 private: | 987 private: |
| 986 MarkCompactCollector* collector_; | 988 MarkCompactCollector* collector_; |
| 987 }; | 989 }; |
| 988 | 990 |
| 989 | 991 |
| 990 const char* AllocationSpaceName(AllocationSpace space); | 992 const char* AllocationSpaceName(AllocationSpace space); |
| 991 | 993 |
| 992 } } // namespace v8::internal | 994 } } // namespace v8::internal |
| 993 | 995 |
| 994 #endif // V8_MARK_COMPACT_H_ | 996 #endif // V8_MARK_COMPACT_H_ |
| OLD | NEW |