| 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 1830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1841 } | 1841 } |
| 1842 | 1842 |
| 1843 void UpdateTotalGCTime(double duration); | 1843 void UpdateTotalGCTime(double duration); |
| 1844 | 1844 |
| 1845 bool MaximumSizeScavenge() { return maximum_size_scavenges_ > 0; } | 1845 bool MaximumSizeScavenge() { return maximum_size_scavenges_ > 0; } |
| 1846 | 1846 |
| 1847 // =========================================================================== | 1847 // =========================================================================== |
| 1848 // Growing strategy. ========================================================= | 1848 // Growing strategy. ========================================================= |
| 1849 // =========================================================================== | 1849 // =========================================================================== |
| 1850 | 1850 |
| 1851 // For some webpages RAIL mode does not switch from PERFORMANCE_LOAD. |
| 1852 // This constant limits the effect of load RAIL mode on GC. |
| 1853 // The value is arbitrary and chosen as the largest load time observed in |
| 1854 // v8 browsing benchmarks. |
| 1855 static const int kMaxLoadTimeMs = 3000; |
| 1856 |
| 1857 bool ShouldOptimizeForLoadTime(); |
| 1858 |
| 1851 // Decrease the allocation limit if the new limit based on the given | 1859 // Decrease the allocation limit if the new limit based on the given |
| 1852 // parameters is lower than the current limit. | 1860 // parameters is lower than the current limit. |
| 1853 void DampenOldGenerationAllocationLimit(size_t old_gen_size, double gc_speed, | 1861 void DampenOldGenerationAllocationLimit(size_t old_gen_size, double gc_speed, |
| 1854 double mutator_speed); | 1862 double mutator_speed); |
| 1855 | 1863 |
| 1856 // Calculates the allocation limit based on a given growing factor and a | 1864 // Calculates the allocation limit based on a given growing factor and a |
| 1857 // given old generation size. | 1865 // given old generation size. |
| 1858 size_t CalculateOldGenerationAllocationLimit(double factor, | 1866 size_t CalculateOldGenerationAllocationLimit(double factor, |
| 1859 size_t old_gen_size); | 1867 size_t old_gen_size); |
| 1860 | 1868 |
| (...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2666 friend class LargeObjectSpace; | 2674 friend class LargeObjectSpace; |
| 2667 friend class NewSpace; | 2675 friend class NewSpace; |
| 2668 friend class PagedSpace; | 2676 friend class PagedSpace; |
| 2669 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); | 2677 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); |
| 2670 }; | 2678 }; |
| 2671 | 2679 |
| 2672 } // namespace internal | 2680 } // namespace internal |
| 2673 } // namespace v8 | 2681 } // namespace v8 |
| 2674 | 2682 |
| 2675 #endif // V8_HEAP_HEAP_H_ | 2683 #endif // V8_HEAP_HEAP_H_ |
| OLD | NEW |