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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
420 V(empty_string) \ | 420 V(empty_string) \ |
421 PRIVATE_SYMBOL_LIST(V) | 421 PRIVATE_SYMBOL_LIST(V) |
422 | 422 |
423 // Forward declarations. | 423 // Forward declarations. |
424 class ArrayBufferTracker; | 424 class ArrayBufferTracker; |
425 class HeapObjectsFilter; | 425 class HeapObjectsFilter; |
426 class HeapStats; | 426 class HeapStats; |
427 class Isolate; | 427 class Isolate; |
428 class MemoryReducer; | 428 class MemoryReducer; |
429 class ObjectStats; | 429 class ObjectStats; |
430 class ScavengeJob; | |
Hannes Payer (out of office)
2015/09/23 14:16:39
class Scavenger;
class ScavengeJob;
ulan
2015/09/23 15:05:16
Done.
| |
430 class Scavenger; | 431 class Scavenger; |
431 class WeakObjectRetainer; | 432 class WeakObjectRetainer; |
432 | 433 |
433 | 434 |
434 // A queue of objects promoted during scavenge. Each object is accompanied | 435 // A queue of objects promoted during scavenge. Each object is accompanied |
435 // by it's size to avoid dereferencing a map pointer for scanning. | 436 // by it's size to avoid dereferencing a map pointer for scanning. |
436 // The last page in to-space is used for the promotion queue. On conflict | 437 // The last page in to-space is used for the promotion queue. On conflict |
437 // during scavenge, the promotion queue is allocated externally and all | 438 // during scavenge, the promotion queue is allocated externally and all |
438 // entries are copied to the external queue. | 439 // entries are copied to the external queue. |
439 class PromotionQueue { | 440 class PromotionQueue { |
(...skipping 1381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1821 | 1822 |
1822 // Code to be run before and after mark-compact. | 1823 // Code to be run before and after mark-compact. |
1823 void MarkCompactPrologue(); | 1824 void MarkCompactPrologue(); |
1824 void MarkCompactEpilogue(); | 1825 void MarkCompactEpilogue(); |
1825 | 1826 |
1826 // Performs a minor collection in new generation. | 1827 // Performs a minor collection in new generation. |
1827 void Scavenge(); | 1828 void Scavenge(); |
1828 | 1829 |
1829 Address DoScavenge(ObjectVisitor* scavenge_visitor, Address new_space_front); | 1830 Address DoScavenge(ObjectVisitor* scavenge_visitor, Address new_space_front); |
1830 | 1831 |
1832 void ScheduleIdleScavengeIfNeeded(int bytes_allocated); | |
Hannes Payer (out of office)
2015/09/23 14:16:39
Can you move it to the Idle notification section,
ulan
2015/09/23 15:05:16
Done.
| |
1833 | |
1831 void UpdateNewSpaceReferencesInExternalStringTable( | 1834 void UpdateNewSpaceReferencesInExternalStringTable( |
1832 ExternalStringTableUpdaterCallback updater_func); | 1835 ExternalStringTableUpdaterCallback updater_func); |
1833 | 1836 |
1834 void UpdateReferencesInExternalStringTable( | 1837 void UpdateReferencesInExternalStringTable( |
1835 ExternalStringTableUpdaterCallback updater_func); | 1838 ExternalStringTableUpdaterCallback updater_func); |
1836 | 1839 |
1837 void ProcessAllWeakReferences(WeakObjectRetainer* retainer); | 1840 void ProcessAllWeakReferences(WeakObjectRetainer* retainer); |
1838 void ProcessYoungWeakReferences(WeakObjectRetainer* retainer); | 1841 void ProcessYoungWeakReferences(WeakObjectRetainer* retainer); |
1839 void ProcessNativeContexts(WeakObjectRetainer* retainer); | 1842 void ProcessNativeContexts(WeakObjectRetainer* retainer); |
1840 void ProcessAllocationSites(WeakObjectRetainer* retainer); | 1843 void ProcessAllocationSites(WeakObjectRetainer* retainer); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1875 | 1878 |
1876 // Calculates the allocation limit based on a given growing factor and a | 1879 // Calculates the allocation limit based on a given growing factor and a |
1877 // given old generation size. | 1880 // given old generation size. |
1878 intptr_t CalculateOldGenerationAllocationLimit(double factor, | 1881 intptr_t CalculateOldGenerationAllocationLimit(double factor, |
1879 intptr_t old_gen_size); | 1882 intptr_t old_gen_size); |
1880 | 1883 |
1881 // Sets the allocation limit to trigger the next full garbage collection. | 1884 // Sets the allocation limit to trigger the next full garbage collection. |
1882 void SetOldGenerationAllocationLimit(intptr_t old_gen_size, double gc_speed, | 1885 void SetOldGenerationAllocationLimit(intptr_t old_gen_size, double gc_speed, |
1883 double mutator_speed); | 1886 double mutator_speed); |
1884 | 1887 |
1888 // Update the inline allocation limit. | |
Hannes Payer (out of office)
2015/09/23 14:16:39
Make it a separate // Inline allocation. ===== sec
ulan
2015/09/23 15:05:16
Done.
| |
1889 void LowerInlineAllocationLimit(intptr_t step); | |
1890 void ResetInlineAllocationLimit(); | |
1891 | |
1885 // =========================================================================== | 1892 // =========================================================================== |
1886 // Idle notification. ======================================================== | 1893 // Idle notification. ======================================================== |
1887 // =========================================================================== | 1894 // =========================================================================== |
1888 | 1895 |
1889 bool RecentIdleNotificationHappened(); | 1896 bool RecentIdleNotificationHappened(); |
1890 | 1897 |
1891 // =========================================================================== | 1898 // =========================================================================== |
1892 // Allocation methods. ======================================================= | 1899 // Allocation methods. ======================================================= |
1893 // =========================================================================== | 1900 // =========================================================================== |
1894 | 1901 |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2259 StoreBuffer store_buffer_; | 2266 StoreBuffer store_buffer_; |
2260 | 2267 |
2261 IncrementalMarking incremental_marking_; | 2268 IncrementalMarking incremental_marking_; |
2262 | 2269 |
2263 GCIdleTimeHandler gc_idle_time_handler_; | 2270 GCIdleTimeHandler gc_idle_time_handler_; |
2264 | 2271 |
2265 MemoryReducer* memory_reducer_; | 2272 MemoryReducer* memory_reducer_; |
2266 | 2273 |
2267 ObjectStats* object_stats_; | 2274 ObjectStats* object_stats_; |
2268 | 2275 |
2276 ScavengeJob* scavenge_job_; | |
2277 | |
2269 // These two counters are monotomically increasing and never reset. | 2278 // These two counters are monotomically increasing and never reset. |
2270 size_t full_codegen_bytes_generated_; | 2279 size_t full_codegen_bytes_generated_; |
2271 size_t crankshaft_codegen_bytes_generated_; | 2280 size_t crankshaft_codegen_bytes_generated_; |
2272 | 2281 |
2273 // This counter is increased before each GC and never reset. | 2282 // This counter is increased before each GC and never reset. |
2274 // To account for the bytes allocated since the last GC, use the | 2283 // To account for the bytes allocated since the last GC, use the |
2275 // NewSpaceAllocationCounter() function. | 2284 // NewSpaceAllocationCounter() function. |
2276 size_t new_space_allocation_counter_; | 2285 size_t new_space_allocation_counter_; |
2277 | 2286 |
2278 // This counter is increased before each GC and never reset. To | 2287 // This counter is increased before each GC and never reset. To |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2332 ArrayBufferTracker* array_buffer_tracker_; | 2341 ArrayBufferTracker* array_buffer_tracker_; |
2333 | 2342 |
2334 // Classes in "heap" can be friends. | 2343 // Classes in "heap" can be friends. |
2335 friend class AlwaysAllocateScope; | 2344 friend class AlwaysAllocateScope; |
2336 friend class GCCallbacksScope; | 2345 friend class GCCallbacksScope; |
2337 friend class GCTracer; | 2346 friend class GCTracer; |
2338 friend class HeapIterator; | 2347 friend class HeapIterator; |
2339 friend class IncrementalMarking; | 2348 friend class IncrementalMarking; |
2340 friend class MarkCompactCollector; | 2349 friend class MarkCompactCollector; |
2341 friend class MarkCompactMarkingVisitor; | 2350 friend class MarkCompactMarkingVisitor; |
2351 friend class NewSpace; | |
2342 friend class ObjectStatsVisitor; | 2352 friend class ObjectStatsVisitor; |
2343 friend class Page; | 2353 friend class Page; |
2344 friend class Scavenger; | 2354 friend class Scavenger; |
2345 friend class StoreBuffer; | 2355 friend class StoreBuffer; |
2346 | 2356 |
2347 // The allocator interface. | 2357 // The allocator interface. |
2348 friend class Factory; | 2358 friend class Factory; |
2349 | 2359 |
2350 // The Isolate constructs us. | 2360 // The Isolate constructs us. |
2351 friend class Isolate; | 2361 friend class Isolate; |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2700 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2710 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2701 | 2711 |
2702 private: | 2712 private: |
2703 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2713 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2704 }; | 2714 }; |
2705 #endif // DEBUG | 2715 #endif // DEBUG |
2706 } | 2716 } |
2707 } // namespace v8::internal | 2717 } // namespace v8::internal |
2708 | 2718 |
2709 #endif // V8_HEAP_HEAP_H_ | 2719 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |