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 1881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1892 // Calculates the allocation limit based on a given growing factor and a | 1892 // Calculates the allocation limit based on a given growing factor and a |
1893 // given old generation size. | 1893 // given old generation size. |
1894 intptr_t CalculateOldGenerationAllocationLimit(double factor, | 1894 intptr_t CalculateOldGenerationAllocationLimit(double factor, |
1895 intptr_t old_gen_size); | 1895 intptr_t old_gen_size); |
1896 | 1896 |
1897 // Sets the allocation limit to trigger the next full garbage collection. | 1897 // Sets the allocation limit to trigger the next full garbage collection. |
1898 void SetOldGenerationAllocationLimit(intptr_t old_gen_size, double gc_speed, | 1898 void SetOldGenerationAllocationLimit(intptr_t old_gen_size, double gc_speed, |
1899 double mutator_speed); | 1899 double mutator_speed); |
1900 | 1900 |
1901 // =========================================================================== | 1901 // =========================================================================== |
1902 // Inline allocation. ======================================================== | |
1903 // =========================================================================== | |
1904 | |
1905 void LowerInlineAllocationLimit(intptr_t step); | |
1906 void ResetInlineAllocationLimit(); | |
1907 | |
1908 // =========================================================================== | |
1909 // Idle notification. ======================================================== | 1902 // Idle notification. ======================================================== |
1910 // =========================================================================== | 1903 // =========================================================================== |
1911 | 1904 |
1912 bool RecentIdleNotificationHappened(); | 1905 bool RecentIdleNotificationHappened(); |
1913 void ScheduleIdleScavengeIfNeeded(int bytes_allocated); | 1906 void ScheduleIdleScavengeIfNeeded(int bytes_allocated); |
1914 | 1907 |
1915 // =========================================================================== | 1908 // =========================================================================== |
1916 // Allocation methods. ======================================================= | 1909 // Allocation methods. ======================================================= |
1917 // =========================================================================== | 1910 // =========================================================================== |
1918 | 1911 |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2285 IncrementalMarking* incremental_marking_; | 2278 IncrementalMarking* incremental_marking_; |
2286 | 2279 |
2287 GCIdleTimeHandler* gc_idle_time_handler_; | 2280 GCIdleTimeHandler* gc_idle_time_handler_; |
2288 | 2281 |
2289 MemoryReducer* memory_reducer_; | 2282 MemoryReducer* memory_reducer_; |
2290 | 2283 |
2291 ObjectStats* object_stats_; | 2284 ObjectStats* object_stats_; |
2292 | 2285 |
2293 ScavengeJob* scavenge_job_; | 2286 ScavengeJob* scavenge_job_; |
2294 | 2287 |
| 2288 InlineAllocationObserver* idle_scavenge_observer_; |
| 2289 |
2295 // These two counters are monotomically increasing and never reset. | 2290 // These two counters are monotomically increasing and never reset. |
2296 size_t full_codegen_bytes_generated_; | 2291 size_t full_codegen_bytes_generated_; |
2297 size_t crankshaft_codegen_bytes_generated_; | 2292 size_t crankshaft_codegen_bytes_generated_; |
2298 | 2293 |
2299 // This counter is increased before each GC and never reset. | 2294 // This counter is increased before each GC and never reset. |
2300 // To account for the bytes allocated since the last GC, use the | 2295 // To account for the bytes allocated since the last GC, use the |
2301 // NewSpaceAllocationCounter() function. | 2296 // NewSpaceAllocationCounter() function. |
2302 size_t new_space_allocation_counter_; | 2297 size_t new_space_allocation_counter_; |
2303 | 2298 |
2304 // This counter is increased before each GC and never reset. To | 2299 // This counter is increased before each GC and never reset. To |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2355 | 2350 |
2356 StrongRootsList* strong_roots_list_; | 2351 StrongRootsList* strong_roots_list_; |
2357 | 2352 |
2358 ArrayBufferTracker* array_buffer_tracker_; | 2353 ArrayBufferTracker* array_buffer_tracker_; |
2359 | 2354 |
2360 // Classes in "heap" can be friends. | 2355 // Classes in "heap" can be friends. |
2361 friend class AlwaysAllocateScope; | 2356 friend class AlwaysAllocateScope; |
2362 friend class GCCallbacksScope; | 2357 friend class GCCallbacksScope; |
2363 friend class GCTracer; | 2358 friend class GCTracer; |
2364 friend class HeapIterator; | 2359 friend class HeapIterator; |
| 2360 friend class IdleScavengeObserver; |
2365 friend class IncrementalMarking; | 2361 friend class IncrementalMarking; |
2366 friend class MarkCompactCollector; | 2362 friend class MarkCompactCollector; |
2367 friend class MarkCompactMarkingVisitor; | 2363 friend class MarkCompactMarkingVisitor; |
2368 friend class NewSpace; | 2364 friend class NewSpace; |
2369 friend class ObjectStatsVisitor; | 2365 friend class ObjectStatsVisitor; |
2370 friend class Page; | 2366 friend class Page; |
2371 friend class Scavenger; | 2367 friend class Scavenger; |
2372 friend class StoreBuffer; | 2368 friend class StoreBuffer; |
2373 | 2369 |
2374 // The allocator interface. | 2370 // The allocator interface. |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2727 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2723 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2728 | 2724 |
2729 private: | 2725 private: |
2730 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2726 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2731 }; | 2727 }; |
2732 #endif // DEBUG | 2728 #endif // DEBUG |
2733 } // namespace internal | 2729 } // namespace internal |
2734 } // namespace v8 | 2730 } // namespace v8 |
2735 | 2731 |
2736 #endif // V8_HEAP_HEAP_H_ | 2732 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |