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_HEAP_H_ | 5 #ifndef V8_HEAP_HEAP_H_ |
6 #define V8_HEAP_HEAP_H_ | 6 #define V8_HEAP_HEAP_H_ |
7 | 7 |
8 #include <cmath> | 8 #include <cmath> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 666 matching lines...) Loading... |
677 return true; | 677 return true; |
678 #else | 678 #else |
679 #ifdef VERIFY_HEAP | 679 #ifdef VERIFY_HEAP |
680 return FLAG_verify_heap; | 680 return FLAG_verify_heap; |
681 #else | 681 #else |
682 return false; | 682 return false; |
683 #endif | 683 #endif |
684 #endif | 684 #endif |
685 } | 685 } |
686 | 686 |
| 687 static inline bool IsYoungGenerationCollector(GarbageCollector collector) { |
| 688 return collector == SCAVENGER || collector == MINOR_MARK_COMPACTOR; |
| 689 } |
| 690 |
| 691 static inline GarbageCollector YoungGenerationCollector() { |
| 692 return (FLAG_minor_mc) ? MINOR_MARK_COMPACTOR : SCAVENGER; |
| 693 } |
| 694 |
687 V8_EXPORT_PRIVATE static double HeapGrowingFactor(double gc_speed, | 695 V8_EXPORT_PRIVATE static double HeapGrowingFactor(double gc_speed, |
688 double mutator_speed); | 696 double mutator_speed); |
689 | 697 |
690 // Copy block of memory from src to dst. Size of block should be aligned | 698 // Copy block of memory from src to dst. Size of block should be aligned |
691 // by pointer size. | 699 // by pointer size. |
692 static inline void CopyBlock(Address dst, Address src, int byte_size); | 700 static inline void CopyBlock(Address dst, Address src, int byte_size); |
693 | 701 |
694 // Determines a static visitor id based on the given {map} that can then be | 702 // Determines a static visitor id based on the given {map} that can then be |
695 // stored on the map to facilitate fast dispatch for {StaticVisitorBase}. | 703 // stored on the map to facilitate fast dispatch for {StaticVisitorBase}. |
696 static int GetStaticVisitorIdForMap(Map* map); | 704 static int GetStaticVisitorIdForMap(Map* map); |
(...skipping 1069 matching lines...) Loading... |
1766 // Actual GC. ================================================================ | 1774 // Actual GC. ================================================================ |
1767 // =========================================================================== | 1775 // =========================================================================== |
1768 | 1776 |
1769 // Code that should be run before and after each GC. Includes some | 1777 // Code that should be run before and after each GC. Includes some |
1770 // reporting/verification activities when compiled with DEBUG set. | 1778 // reporting/verification activities when compiled with DEBUG set. |
1771 void GarbageCollectionPrologue(); | 1779 void GarbageCollectionPrologue(); |
1772 void GarbageCollectionEpilogue(); | 1780 void GarbageCollectionEpilogue(); |
1773 | 1781 |
1774 // Performs a major collection in the whole heap. | 1782 // Performs a major collection in the whole heap. |
1775 void MarkCompact(); | 1783 void MarkCompact(); |
| 1784 // Performs a minor collection of just the young generation. |
| 1785 void MinorMarkCompact(); |
1776 | 1786 |
1777 // Code to be run before and after mark-compact. | 1787 // Code to be run before and after mark-compact. |
1778 void MarkCompactPrologue(); | 1788 void MarkCompactPrologue(); |
1779 void MarkCompactEpilogue(); | 1789 void MarkCompactEpilogue(); |
1780 | 1790 |
1781 // Performs a minor collection in new generation. | 1791 // Performs a minor collection in new generation. |
1782 void Scavenge(); | 1792 void Scavenge(); |
1783 | 1793 |
1784 Address DoScavenge(ObjectVisitor* scavenge_visitor, Address new_space_front); | 1794 Address DoScavenge(ObjectVisitor* scavenge_visitor, Address new_space_front); |
1785 | 1795 |
(...skipping 842 matching lines...) Loading... |
2628 friend class LargeObjectSpace; | 2638 friend class LargeObjectSpace; |
2629 friend class NewSpace; | 2639 friend class NewSpace; |
2630 friend class PagedSpace; | 2640 friend class PagedSpace; |
2631 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); | 2641 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); |
2632 }; | 2642 }; |
2633 | 2643 |
2634 } // namespace internal | 2644 } // namespace internal |
2635 } // namespace v8 | 2645 } // namespace v8 |
2636 | 2646 |
2637 #endif // V8_HEAP_HEAP_H_ | 2647 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |