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 1790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1801 void ProcessWeakListRoots(WeakObjectRetainer* retainer); | 1801 void ProcessWeakListRoots(WeakObjectRetainer* retainer); |
1802 | 1802 |
1803 // =========================================================================== | 1803 // =========================================================================== |
1804 // GC statistics. ============================================================ | 1804 // GC statistics. ============================================================ |
1805 // =========================================================================== | 1805 // =========================================================================== |
1806 | 1806 |
1807 inline intptr_t OldGenerationSpaceAvailable() { | 1807 inline intptr_t OldGenerationSpaceAvailable() { |
1808 return old_generation_allocation_limit_ - PromotedTotalSize(); | 1808 return old_generation_allocation_limit_ - PromotedTotalSize(); |
1809 } | 1809 } |
1810 | 1810 |
1811 // Returns maximum GC pause. | 1811 void UpdateTotalGCTime(double duration); |
1812 double get_max_gc_pause() { return max_gc_pause_; } | |
1813 | |
1814 // Returns maximum size of objects alive after GC. | |
1815 intptr_t get_max_alive_after_gc() { return max_alive_after_gc_; } | |
1816 | |
1817 // Returns minimal interval between two subsequent collections. | |
1818 double get_min_in_mutator() { return min_in_mutator_; } | |
1819 | |
1820 // Update GC statistics that are tracked on the Heap. | |
1821 void UpdateCumulativeGCStatistics(double duration, double spent_in_mutator, | |
1822 double marking_time); | |
1823 | 1812 |
1824 bool MaximumSizeScavenge() { return maximum_size_scavenges_ > 0; } | 1813 bool MaximumSizeScavenge() { return maximum_size_scavenges_ > 0; } |
1825 | 1814 |
1826 // =========================================================================== | 1815 // =========================================================================== |
1827 // Growing strategy. ========================================================= | 1816 // Growing strategy. ========================================================= |
1828 // =========================================================================== | 1817 // =========================================================================== |
1829 | 1818 |
1830 // Decrease the allocation limit if the new limit based on the given | 1819 // Decrease the allocation limit if the new limit based on the given |
1831 // parameters is lower than the current limit. | 1820 // parameters is lower than the current limit. |
1832 void DampenOldGenerationAllocationLimit(intptr_t old_gen_size, | 1821 void DampenOldGenerationAllocationLimit(intptr_t old_gen_size, |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2206 int nodes_died_in_new_space_; | 2195 int nodes_died_in_new_space_; |
2207 int nodes_copied_in_new_space_; | 2196 int nodes_copied_in_new_space_; |
2208 int nodes_promoted_; | 2197 int nodes_promoted_; |
2209 | 2198 |
2210 // This is the pretenuring trigger for allocation sites that are in maybe | 2199 // This is the pretenuring trigger for allocation sites that are in maybe |
2211 // tenure state. When we switched to the maximum new space size we deoptimize | 2200 // tenure state. When we switched to the maximum new space size we deoptimize |
2212 // the code that belongs to the allocation site and derive the lifetime | 2201 // the code that belongs to the allocation site and derive the lifetime |
2213 // of the allocation site. | 2202 // of the allocation site. |
2214 unsigned int maximum_size_scavenges_; | 2203 unsigned int maximum_size_scavenges_; |
2215 | 2204 |
2216 // Maximum GC pause. | |
2217 double max_gc_pause_; | |
2218 | |
2219 // Total time spent in GC. | 2205 // Total time spent in GC. |
2220 double total_gc_time_ms_; | 2206 double total_gc_time_ms_; |
2221 | 2207 |
2222 // Maximum size of objects alive after GC. | |
2223 intptr_t max_alive_after_gc_; | |
2224 | |
2225 // Minimal interval between two subsequent collections. | |
2226 double min_in_mutator_; | |
2227 | |
2228 // Cumulative GC time spent in marking. | |
2229 double marking_time_; | |
2230 | |
2231 // Cumulative GC time spent in sweeping. | |
2232 double sweeping_time_; | |
2233 | |
2234 // Last time an idle notification happened. | 2208 // Last time an idle notification happened. |
2235 double last_idle_notification_time_; | 2209 double last_idle_notification_time_; |
2236 | 2210 |
2237 // Last time a garbage collection happened. | 2211 // Last time a garbage collection happened. |
2238 double last_gc_time_; | 2212 double last_gc_time_; |
2239 | 2213 |
2240 Scavenger* scavenge_collector_; | 2214 Scavenger* scavenge_collector_; |
2241 | 2215 |
2242 MarkCompactCollector* mark_compact_collector_; | 2216 MarkCompactCollector* mark_compact_collector_; |
2243 | 2217 |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2641 friend class LargeObjectSpace; | 2615 friend class LargeObjectSpace; |
2642 friend class NewSpace; | 2616 friend class NewSpace; |
2643 friend class PagedSpace; | 2617 friend class PagedSpace; |
2644 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); | 2618 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); |
2645 }; | 2619 }; |
2646 | 2620 |
2647 } // namespace internal | 2621 } // namespace internal |
2648 } // namespace v8 | 2622 } // namespace v8 |
2649 | 2623 |
2650 #endif // V8_HEAP_HEAP_H_ | 2624 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |