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

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

Issue 1311993003: Reland "Make sure that memory reducer makes progress in incremental marking"" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments Created 5 years, 3 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/incremental-marking.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/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
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 && incremental_marking()->IsMarking() &&
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
4625 bool Heap::TryFinalizeIdleIncrementalMarking( 4638 bool Heap::TryFinalizeIdleIncrementalMarking(
4626 double idle_time_in_ms, size_t size_of_objects, 4639 double idle_time_in_ms, size_t size_of_objects,
4627 size_t final_incremental_mark_compact_speed_in_bytes_per_ms) { 4640 size_t final_incremental_mark_compact_speed_in_bytes_per_ms) {
4628 if (FLAG_overapproximate_weak_closure && 4641 if (FLAG_overapproximate_weak_closure && incremental_marking()->IsMarking() &&
4629 (incremental_marking()->IsReadyToOverApproximateWeakClosure() || 4642 (incremental_marking()->IsReadyToOverApproximateWeakClosure() ||
4630 (!incremental_marking()->weak_closure_was_overapproximated() && 4643 (!incremental_marking()->weak_closure_was_overapproximated() &&
4631 mark_compact_collector_.marking_deque()->IsEmpty() && 4644 mark_compact_collector_.marking_deque()->IsEmpty() &&
4632 gc_idle_time_handler_.ShouldDoOverApproximateWeakClosure( 4645 gc_idle_time_handler_.ShouldDoOverApproximateWeakClosure(
4633 static_cast<size_t>(idle_time_in_ms))))) { 4646 static_cast<size_t>(idle_time_in_ms))))) {
4634 OverApproximateWeakClosure( 4647 OverApproximateWeakClosure(
4635 "Idle notification: overapproximate weak closure"); 4648 "Idle notification: overapproximate weak closure");
4636 return true; 4649 return true;
4637 } else if (incremental_marking()->IsComplete() || 4650 } else if (incremental_marking()->IsComplete() ||
4638 (mark_compact_collector_.marking_deque()->IsEmpty() && 4651 (mark_compact_collector_.marking_deque()->IsEmpty() &&
(...skipping 2019 matching lines...) Expand 10 before | Expand all | Expand 10 after
6658 *object_sub_type = "CODE_AGE/" #name; \ 6671 *object_sub_type = "CODE_AGE/" #name; \
6659 return true; 6672 return true;
6660 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) 6673 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME)
6661 #undef COMPARE_AND_RETURN_NAME 6674 #undef COMPARE_AND_RETURN_NAME
6662 } 6675 }
6663 return false; 6676 return false;
6664 } 6677 }
6665 6678
6666 } // namespace internal 6679 } // namespace internal
6667 } // namespace v8 6680 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/incremental-marking.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698