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

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

Issue 1014503003: Hook up over approximating the weak closure to the idle time handler (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 9 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/gc-idle-time-handler.cc ('k') | src/heap/incremental-marking.h » ('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 4566 matching lines...) Expand 10 before | Expand all | Expand 10 after
4577 if (uncommit) { 4577 if (uncommit) {
4578 new_space_.Shrink(); 4578 new_space_.Shrink();
4579 UncommitFromSpace(); 4579 UncommitFromSpace();
4580 } 4580 }
4581 } 4581 }
4582 4582
4583 4583
4584 bool Heap::TryFinalizeIdleIncrementalMarking( 4584 bool Heap::TryFinalizeIdleIncrementalMarking(
4585 double idle_time_in_ms, size_t size_of_objects, 4585 double idle_time_in_ms, size_t size_of_objects,
4586 size_t final_incremental_mark_compact_speed_in_bytes_per_ms) { 4586 size_t final_incremental_mark_compact_speed_in_bytes_per_ms) {
4587 if (incremental_marking()->IsComplete() || 4587 if (incremental_marking()->IsReadyToOverApproximateWeakClosure() ||
4588 (mark_compact_collector_.marking_deque()->IsEmpty() && 4588 (FLAG_overapproximate_weak_closure &&
4589 gc_idle_time_handler_.ShouldDoFinalIncrementalMarkCompact( 4589 mark_compact_collector_.marking_deque()->IsEmpty() &&
4590 static_cast<size_t>(idle_time_in_ms), size_of_objects, 4590 gc_idle_time_handler_.ShouldDoOverApproximateWeakClosure(
4591 final_incremental_mark_compact_speed_in_bytes_per_ms))) { 4591 static_cast<size_t>(idle_time_in_ms)))) {
4592 OverApproximateWeakClosure(
4593 "Idle notification: overapproximate weak closure");
4594 return true;
4595 } else if (incremental_marking()->IsComplete() ||
4596 (mark_compact_collector_.marking_deque()->IsEmpty() &&
4597 gc_idle_time_handler_.ShouldDoFinalIncrementalMarkCompact(
4598 static_cast<size_t>(idle_time_in_ms), size_of_objects,
4599 final_incremental_mark_compact_speed_in_bytes_per_ms))) {
4592 CollectAllGarbage(kNoGCFlags, "idle notification: finalize incremental"); 4600 CollectAllGarbage(kNoGCFlags, "idle notification: finalize incremental");
4593 return true; 4601 return true;
4594 } 4602 }
4595 return false; 4603 return false;
4596 } 4604 }
4597 4605
4598 4606
4599 bool Heap::WorthActivatingIncrementalMarking() { 4607 bool Heap::WorthActivatingIncrementalMarking() {
4600 return incremental_marking()->IsStopped() && 4608 return incremental_marking()->IsStopped() &&
4601 incremental_marking()->WorthActivating() && NextGCIsLikelyToBeFull(); 4609 incremental_marking()->WorthActivating() && NextGCIsLikelyToBeFull();
(...skipping 1976 matching lines...) Expand 10 before | Expand all | Expand 10 after
6578 static_cast<int>(object_sizes_last_time_[index])); 6586 static_cast<int>(object_sizes_last_time_[index]));
6579 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 6587 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
6580 #undef ADJUST_LAST_TIME_OBJECT_COUNT 6588 #undef ADJUST_LAST_TIME_OBJECT_COUNT
6581 6589
6582 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 6590 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
6583 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 6591 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
6584 ClearObjectStats(); 6592 ClearObjectStats();
6585 } 6593 }
6586 } 6594 }
6587 } // namespace v8::internal 6595 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap/gc-idle-time-handler.cc ('k') | src/heap/incremental-marking.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698