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 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 // Check whether the heap is currently iterable. | 830 // Check whether the heap is currently iterable. |
831 bool IsHeapIterable(); | 831 bool IsHeapIterable(); |
832 | 832 |
833 // Notify the heap that a context has been disposed. | 833 // Notify the heap that a context has been disposed. |
834 int NotifyContextDisposed(bool dependant_context); | 834 int NotifyContextDisposed(bool dependant_context); |
835 | 835 |
836 // Start incremental marking and ensure that idle time handler can perform | 836 // Start incremental marking and ensure that idle time handler can perform |
837 // incremental steps. | 837 // incremental steps. |
838 void StartIdleIncrementalMarking(); | 838 void StartIdleIncrementalMarking(); |
839 | 839 |
840 // Starts incremental marking assuming incremental marking is currently | |
841 // stopped. | |
842 void StartIncrementalMarking(int gc_flags, | |
843 const GCCallbackFlags gc_callback_flags, | |
844 const char* reason = nullptr); | |
845 | |
846 // Performs incremental marking steps of step_size_in_bytes as long as | |
847 // deadline_ins_ms is not reached. step_size_in_bytes can be 0 to compute | |
848 // an estimate increment. Returns the remaining time that cannot be used | |
849 // for incremental marking anymore because a single step would exceed the | |
850 // deadline. | |
851 double AdvanceIncrementalMarking( | |
852 intptr_t step_size_in_bytes, double deadline_in_ms, | |
853 IncrementalMarking::StepActions step_actions); | |
854 | |
855 void FinalizeIncrementalMarkingIfComplete(const char* comment); | |
856 | |
857 inline void increment_scan_on_scavenge_pages() { | 840 inline void increment_scan_on_scavenge_pages() { |
858 scan_on_scavenge_pages_++; | 841 scan_on_scavenge_pages_++; |
859 if (FLAG_gc_verbose) { | 842 if (FLAG_gc_verbose) { |
860 PrintF("Scan-on-scavenge pages: %d\n", scan_on_scavenge_pages_); | 843 PrintF("Scan-on-scavenge pages: %d\n", scan_on_scavenge_pages_); |
861 } | 844 } |
862 } | 845 } |
863 | 846 |
864 inline void decrement_scan_on_scavenge_pages() { | 847 inline void decrement_scan_on_scavenge_pages() { |
865 scan_on_scavenge_pages_--; | 848 scan_on_scavenge_pages_--; |
866 if (FLAG_gc_verbose) { | 849 if (FLAG_gc_verbose) { |
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1637 // prepared by finishing the previous one. | 1620 // prepared by finishing the previous one. |
1638 void PrepareArrayBufferDiscoveryInNewSpace(); | 1621 void PrepareArrayBufferDiscoveryInNewSpace(); |
1639 | 1622 |
1640 // An ArrayBuffer moved from new space to old space. | 1623 // An ArrayBuffer moved from new space to old space. |
1641 void PromoteArrayBuffer(Object* buffer); | 1624 void PromoteArrayBuffer(Object* buffer); |
1642 | 1625 |
1643 bool HasLowAllocationRate(); | 1626 bool HasLowAllocationRate(); |
1644 bool HasHighFragmentation(); | 1627 bool HasHighFragmentation(); |
1645 bool HasHighFragmentation(intptr_t used, intptr_t committed); | 1628 bool HasHighFragmentation(intptr_t used, intptr_t committed); |
1646 | 1629 |
1647 bool ShouldOptimizeForMemoryUsage() { return optimize_for_memory_usage_; } | |
1648 | |
1649 protected: | 1630 protected: |
1650 // Methods made available to tests. | 1631 // Methods made available to tests. |
1651 | 1632 |
1652 // Allocates a JS Map in the heap. | 1633 // Allocates a JS Map in the heap. |
1653 MUST_USE_RESULT AllocationResult | 1634 MUST_USE_RESULT AllocationResult |
1654 AllocateMap(InstanceType instance_type, int instance_size, | 1635 AllocateMap(InstanceType instance_type, int instance_size, |
1655 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND); | 1636 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND); |
1656 | 1637 |
1657 // Allocates and initializes a new JavaScript object based on a | 1638 // Allocates and initializes a new JavaScript object based on a |
1658 // constructor. | 1639 // constructor. |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2279 bool IsHighSurvivalRate() { return high_survival_rate_period_length_ > 0; } | 2260 bool IsHighSurvivalRate() { return high_survival_rate_period_length_ > 0; } |
2280 | 2261 |
2281 void ConfigureInitialOldGenerationSize(); | 2262 void ConfigureInitialOldGenerationSize(); |
2282 | 2263 |
2283 void ConfigureNewGenerationSize(); | 2264 void ConfigureNewGenerationSize(); |
2284 | 2265 |
2285 void SelectScavengingVisitorsTable(); | 2266 void SelectScavengingVisitorsTable(); |
2286 | 2267 |
2287 bool HasLowYoungGenerationAllocationRate(); | 2268 bool HasLowYoungGenerationAllocationRate(); |
2288 bool HasLowOldGenerationAllocationRate(); | 2269 bool HasLowOldGenerationAllocationRate(); |
2289 double YoungGenerationMutatorUtilization(); | |
2290 double OldGenerationMutatorUtilization(); | |
2291 | 2270 |
2292 void ReduceNewSpaceSize(); | 2271 void ReduceNewSpaceSize(); |
2293 | 2272 |
2294 bool TryFinalizeIdleIncrementalMarking( | 2273 bool TryFinalizeIdleIncrementalMarking( |
2295 double idle_time_in_ms, size_t size_of_objects, | 2274 double idle_time_in_ms, size_t size_of_objects, |
2296 size_t mark_compact_speed_in_bytes_per_ms); | 2275 size_t mark_compact_speed_in_bytes_per_ms); |
2297 | 2276 |
2298 GCIdleTimeHandler::HeapState ComputeHeapState(); | 2277 GCIdleTimeHandler::HeapState ComputeHeapState(); |
2299 | 2278 |
2300 bool PerformIdleTimeAction(GCIdleTimeAction action, | 2279 bool PerformIdleTimeAction(GCIdleTimeAction action, |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2892 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2871 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2893 | 2872 |
2894 private: | 2873 private: |
2895 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2874 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2896 }; | 2875 }; |
2897 #endif // DEBUG | 2876 #endif // DEBUG |
2898 } | 2877 } |
2899 } // namespace v8::internal | 2878 } // namespace v8::internal |
2900 | 2879 |
2901 #endif // V8_HEAP_HEAP_H_ | 2880 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |