Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(442)

Side by Side Diff: src/heap/heap.cc

Issue 1274633003: Make sure that memory reducer makes progress in incremental marking (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/memory-reducer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/memory-reducer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698