| 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 #include "src/heap/heap.h" | 5 #include "src/heap/heap.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api.h" | 8 #include "src/api.h" |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
| (...skipping 4753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4764 size_t allocation_throughput = | 4764 size_t allocation_throughput = |
| 4765 tracer()->CurrentAllocationThroughputInBytesPerMillisecond(); | 4765 tracer()->CurrentAllocationThroughputInBytesPerMillisecond(); |
| 4766 if (FLAG_predictable || allocation_throughput == 0) return; | 4766 if (FLAG_predictable || allocation_throughput == 0) return; |
| 4767 if (allocation_throughput < kLowAllocationThroughput) { | 4767 if (allocation_throughput < kLowAllocationThroughput) { |
| 4768 new_space_.Shrink(); | 4768 new_space_.Shrink(); |
| 4769 UncommitFromSpace(); | 4769 UncommitFromSpace(); |
| 4770 } | 4770 } |
| 4771 } | 4771 } |
| 4772 | 4772 |
| 4773 | 4773 |
| 4774 void Heap::FinalizeIncrementalMarkingIfComplete(const char* comment) { | |
| 4775 if (FLAG_overapproximate_weak_closure && | |
| 4776 (incremental_marking()->IsReadyToOverApproximateWeakClosure() || | |
| 4777 (!incremental_marking()->weak_closure_was_overapproximated() && | |
| 4778 mark_compact_collector_.marking_deque()->IsEmpty()))) { | |
| 4779 OverApproximateWeakClosure(comment); | |
| 4780 } else if (incremental_marking()->IsComplete() || | |
| 4781 (mark_compact_collector_.marking_deque()->IsEmpty())) { | |
| 4782 CollectAllGarbage(kNoGCFlags, comment); | |
| 4783 } | |
| 4784 } | |
| 4785 | |
| 4786 | |
| 4787 bool Heap::TryFinalizeIdleIncrementalMarking( | 4774 bool Heap::TryFinalizeIdleIncrementalMarking( |
| 4788 double idle_time_in_ms, size_t size_of_objects, | 4775 double idle_time_in_ms, size_t size_of_objects, |
| 4789 size_t final_incremental_mark_compact_speed_in_bytes_per_ms) { | 4776 size_t final_incremental_mark_compact_speed_in_bytes_per_ms) { |
| 4790 if (FLAG_overapproximate_weak_closure && | 4777 if (FLAG_overapproximate_weak_closure && |
| 4791 (incremental_marking()->IsReadyToOverApproximateWeakClosure() || | 4778 (incremental_marking()->IsReadyToOverApproximateWeakClosure() || |
| 4792 (!incremental_marking()->weak_closure_was_overapproximated() && | 4779 (!incremental_marking()->weak_closure_was_overapproximated() && |
| 4793 mark_compact_collector_.marking_deque()->IsEmpty() && | 4780 mark_compact_collector_.marking_deque()->IsEmpty() && |
| 4794 gc_idle_time_handler_.ShouldDoOverApproximateWeakClosure( | 4781 gc_idle_time_handler_.ShouldDoOverApproximateWeakClosure( |
| 4795 static_cast<size_t>(idle_time_in_ms))))) { | 4782 static_cast<size_t>(idle_time_in_ms))))) { |
| 4796 OverApproximateWeakClosure( | 4783 OverApproximateWeakClosure( |
| (...skipping 2104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6901 *object_type = "CODE_TYPE"; \ | 6888 *object_type = "CODE_TYPE"; \ |
| 6902 *object_sub_type = "CODE_AGE/" #name; \ | 6889 *object_sub_type = "CODE_AGE/" #name; \ |
| 6903 return true; | 6890 return true; |
| 6904 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) | 6891 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) |
| 6905 #undef COMPARE_AND_RETURN_NAME | 6892 #undef COMPARE_AND_RETURN_NAME |
| 6906 } | 6893 } |
| 6907 return false; | 6894 return false; |
| 6908 } | 6895 } |
| 6909 } // namespace internal | 6896 } // namespace internal |
| 6910 } // namespace v8 | 6897 } // namespace v8 |
| OLD | NEW |