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 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 | 860 |
861 // Performs incremental marking steps of step_size_in_bytes as long as | 861 // Performs incremental marking steps of step_size_in_bytes as long as |
862 // deadline_ins_ms is not reached. step_size_in_bytes can be 0 to compute | 862 // deadline_ins_ms is not reached. step_size_in_bytes can be 0 to compute |
863 // an estimate increment. Returns the remaining time that cannot be used | 863 // an estimate increment. Returns the remaining time that cannot be used |
864 // for incremental marking anymore because a single step would exceed the | 864 // for incremental marking anymore because a single step would exceed the |
865 // deadline. | 865 // deadline. |
866 double AdvanceIncrementalMarking( | 866 double AdvanceIncrementalMarking( |
867 intptr_t step_size_in_bytes, double deadline_in_ms, | 867 intptr_t step_size_in_bytes, double deadline_in_ms, |
868 IncrementalMarking::StepActions step_actions); | 868 IncrementalMarking::StepActions step_actions); |
869 | 869 |
| 870 void FinalizeIncrementalMarkingIfComplete(const char* comment); |
| 871 |
870 inline void increment_scan_on_scavenge_pages() { | 872 inline void increment_scan_on_scavenge_pages() { |
871 scan_on_scavenge_pages_++; | 873 scan_on_scavenge_pages_++; |
872 if (FLAG_gc_verbose) { | 874 if (FLAG_gc_verbose) { |
873 PrintF("Scan-on-scavenge pages: %d\n", scan_on_scavenge_pages_); | 875 PrintF("Scan-on-scavenge pages: %d\n", scan_on_scavenge_pages_); |
874 } | 876 } |
875 } | 877 } |
876 | 878 |
877 inline void decrement_scan_on_scavenge_pages() { | 879 inline void decrement_scan_on_scavenge_pages() { |
878 scan_on_scavenge_pages_--; | 880 scan_on_scavenge_pages_--; |
879 if (FLAG_gc_verbose) { | 881 if (FLAG_gc_verbose) { |
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1643 // prepared by finishing the previous one. | 1645 // prepared by finishing the previous one. |
1644 void PrepareArrayBufferDiscoveryInNewSpace(); | 1646 void PrepareArrayBufferDiscoveryInNewSpace(); |
1645 | 1647 |
1646 // An ArrayBuffer moved from new space to old space. | 1648 // An ArrayBuffer moved from new space to old space. |
1647 void PromoteArrayBuffer(Object* buffer); | 1649 void PromoteArrayBuffer(Object* buffer); |
1648 | 1650 |
1649 bool HasLowAllocationRate(); | 1651 bool HasLowAllocationRate(); |
1650 bool HasHighFragmentation(); | 1652 bool HasHighFragmentation(); |
1651 bool HasHighFragmentation(intptr_t used, intptr_t committed); | 1653 bool HasHighFragmentation(intptr_t used, intptr_t committed); |
1652 | 1654 |
| 1655 bool ShouldOptimizeForMemoryUsage() { return optimize_for_memory_usage_; } |
| 1656 |
1653 protected: | 1657 protected: |
1654 // Methods made available to tests. | 1658 // Methods made available to tests. |
1655 | 1659 |
1656 // Allocates a JS Map in the heap. | 1660 // Allocates a JS Map in the heap. |
1657 MUST_USE_RESULT AllocationResult | 1661 MUST_USE_RESULT AllocationResult |
1658 AllocateMap(InstanceType instance_type, int instance_size, | 1662 AllocateMap(InstanceType instance_type, int instance_size, |
1659 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND); | 1663 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND); |
1660 | 1664 |
1661 // Allocates and initializes a new JavaScript object based on a | 1665 // Allocates and initializes a new JavaScript object based on a |
1662 // constructor. | 1666 // constructor. |
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2843 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2847 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2844 | 2848 |
2845 private: | 2849 private: |
2846 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2850 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2847 }; | 2851 }; |
2848 #endif // DEBUG | 2852 #endif // DEBUG |
2849 } | 2853 } |
2850 } // namespace v8::internal | 2854 } // namespace v8::internal |
2851 | 2855 |
2852 #endif // V8_HEAP_HEAP_H_ | 2856 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |