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 4604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4615 | 4615 |
4616 if (ShouldReduceMemory() || | 4616 if (ShouldReduceMemory() || |
4617 ((allocation_throughput != 0) && | 4617 ((allocation_throughput != 0) && |
4618 (allocation_throughput < kLowAllocationThroughput))) { | 4618 (allocation_throughput < kLowAllocationThroughput))) { |
4619 new_space_.Shrink(); | 4619 new_space_.Shrink(); |
4620 UncommitFromSpace(); | 4620 UncommitFromSpace(); |
4621 } | 4621 } |
4622 } | 4622 } |
4623 | 4623 |
4624 | 4624 |
4625 void Heap::FinalizeIncrementalMarkingIfComplete(const char* comment) { | |
4626 if (FLAG_overapproximate_weak_closure && | |
4627 (incremental_marking()->IsReadyToOverApproximateWeakClosure() || | |
4628 (!incremental_marking()->weak_closure_was_overapproximated() && | |
4629 mark_compact_collector_.marking_deque()->IsEmpty()))) { | |
4630 OverApproximateWeakClosure(comment); | |
4631 } else if (incremental_marking()->IsComplete() || | |
4632 (mark_compact_collector_.marking_deque()->IsEmpty())) { | |
4633 CollectAllGarbage(current_gc_flags(), comment); | |
4634 } | |
4635 } | |
4636 | |
4637 | |
4638 bool Heap::TryFinalizeIdleIncrementalMarking( | 4625 bool Heap::TryFinalizeIdleIncrementalMarking( |
4639 double idle_time_in_ms, size_t size_of_objects, | 4626 double idle_time_in_ms, size_t size_of_objects, |
4640 size_t final_incremental_mark_compact_speed_in_bytes_per_ms) { | 4627 size_t final_incremental_mark_compact_speed_in_bytes_per_ms) { |
4641 if (FLAG_overapproximate_weak_closure && | 4628 if (FLAG_overapproximate_weak_closure && |
4642 (incremental_marking()->IsReadyToOverApproximateWeakClosure() || | 4629 (incremental_marking()->IsReadyToOverApproximateWeakClosure() || |
4643 (!incremental_marking()->weak_closure_was_overapproximated() && | 4630 (!incremental_marking()->weak_closure_was_overapproximated() && |
4644 mark_compact_collector_.marking_deque()->IsEmpty() && | 4631 mark_compact_collector_.marking_deque()->IsEmpty() && |
4645 gc_idle_time_handler_.ShouldDoOverApproximateWeakClosure( | 4632 gc_idle_time_handler_.ShouldDoOverApproximateWeakClosure( |
4646 static_cast<size_t>(idle_time_in_ms))))) { | 4633 static_cast<size_t>(idle_time_in_ms))))) { |
4647 OverApproximateWeakClosure( | 4634 OverApproximateWeakClosure( |
(...skipping 2089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6737 *object_type = "CODE_TYPE"; \ | 6724 *object_type = "CODE_TYPE"; \ |
6738 *object_sub_type = "CODE_AGE/" #name; \ | 6725 *object_sub_type = "CODE_AGE/" #name; \ |
6739 return true; | 6726 return true; |
6740 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) | 6727 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) |
6741 #undef COMPARE_AND_RETURN_NAME | 6728 #undef COMPARE_AND_RETURN_NAME |
6742 } | 6729 } |
6743 return false; | 6730 return false; |
6744 } | 6731 } |
6745 } // namespace internal | 6732 } // namespace internal |
6746 } // namespace v8 | 6733 } // namespace v8 |
OLD | NEW |