| 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/v8.h" | 5 #include "src/v8.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 4752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4763 | 4763 |
| 4764 | 4764 |
| 4765 void Heap::ReduceNewSpaceSize() { | 4765 void Heap::ReduceNewSpaceSize() { |
| 4766 if (!FLAG_predictable && HasLowAllocationRate()) { | 4766 if (!FLAG_predictable && HasLowAllocationRate()) { |
| 4767 new_space_.Shrink(); | 4767 new_space_.Shrink(); |
| 4768 UncommitFromSpace(); | 4768 UncommitFromSpace(); |
| 4769 } | 4769 } |
| 4770 } | 4770 } |
| 4771 | 4771 |
| 4772 | 4772 |
| 4773 void Heap::FinalizeIncrementalMarkingIfComplete(const char* comment) { |
| 4774 if (FLAG_overapproximate_weak_closure && |
| 4775 (incremental_marking()->IsReadyToOverApproximateWeakClosure() || |
| 4776 (!incremental_marking()->weak_closure_was_overapproximated() && |
| 4777 mark_compact_collector_.marking_deque()->IsEmpty()))) { |
| 4778 OverApproximateWeakClosure(comment); |
| 4779 } else if (incremental_marking()->IsComplete() || |
| 4780 (mark_compact_collector_.marking_deque()->IsEmpty())) { |
| 4781 CollectAllGarbage(kNoGCFlags, comment); |
| 4782 } |
| 4783 } |
| 4784 |
| 4785 |
| 4773 bool Heap::TryFinalizeIdleIncrementalMarking( | 4786 bool Heap::TryFinalizeIdleIncrementalMarking( |
| 4774 double idle_time_in_ms, size_t size_of_objects, | 4787 double idle_time_in_ms, size_t size_of_objects, |
| 4775 size_t final_incremental_mark_compact_speed_in_bytes_per_ms) { | 4788 size_t final_incremental_mark_compact_speed_in_bytes_per_ms) { |
| 4776 if (FLAG_overapproximate_weak_closure && | 4789 if (FLAG_overapproximate_weak_closure && |
| 4777 (incremental_marking()->IsReadyToOverApproximateWeakClosure() || | 4790 (incremental_marking()->IsReadyToOverApproximateWeakClosure() || |
| 4778 (!incremental_marking()->weak_closure_was_overapproximated() && | 4791 (!incremental_marking()->weak_closure_was_overapproximated() && |
| 4779 mark_compact_collector_.marking_deque()->IsEmpty() && | 4792 mark_compact_collector_.marking_deque()->IsEmpty() && |
| 4780 gc_idle_time_handler_.ShouldDoOverApproximateWeakClosure( | 4793 gc_idle_time_handler_.ShouldDoOverApproximateWeakClosure( |
| 4781 static_cast<size_t>(idle_time_in_ms))))) { | 4794 static_cast<size_t>(idle_time_in_ms))))) { |
| 4782 OverApproximateWeakClosure( | 4795 OverApproximateWeakClosure( |
| (...skipping 2118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6901 *object_type = "CODE_TYPE"; \ | 6914 *object_type = "CODE_TYPE"; \ |
| 6902 *object_sub_type = "CODE_AGE/" #name; \ | 6915 *object_sub_type = "CODE_AGE/" #name; \ |
| 6903 return true; | 6916 return true; |
| 6904 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) | 6917 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) |
| 6905 #undef COMPARE_AND_RETURN_NAME | 6918 #undef COMPARE_AND_RETURN_NAME |
| 6906 } | 6919 } |
| 6907 return false; | 6920 return false; |
| 6908 } | 6921 } |
| 6909 } // namespace internal | 6922 } // namespace internal |
| 6910 } // namespace v8 | 6923 } // namespace v8 |
| OLD | NEW |