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

Side by Side Diff: src/heap/incremental-marking.cc

Issue 771703004: Slow down incremental marking on main thread when idle notification is active. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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.cc ('k') | no next file » | 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/heap/incremental-marking.h" 7 #include "src/heap/incremental-marking.h"
8 8
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/compilation-cache.h" 10 #include "src/compilation-cache.h"
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 } 873 }
874 874
875 allocated_ += allocated_bytes; 875 allocated_ += allocated_bytes;
876 876
877 if (marking == DO_NOT_FORCE_MARKING && allocated_ < kAllocatedThreshold && 877 if (marking == DO_NOT_FORCE_MARKING && allocated_ < kAllocatedThreshold &&
878 write_barriers_invoked_since_last_step_ < 878 write_barriers_invoked_since_last_step_ <
879 kWriteBarriersInvokedThreshold) { 879 kWriteBarriersInvokedThreshold) {
880 return 0; 880 return 0;
881 } 881 }
882 882
883 // If an idle notification happened recently, we delay marking steps.
884 if (marking == DO_NOT_FORCE_MARKING &&
885 heap_->RecentIdleNotifcationHappened()) {
886 return 0;
887 }
888
883 if (state_ == MARKING && no_marking_scope_depth_ > 0) return 0; 889 if (state_ == MARKING && no_marking_scope_depth_ > 0) return 0;
884 890
885 intptr_t bytes_processed = 0; 891 intptr_t bytes_processed = 0;
886 { 892 {
887 HistogramTimerScope incremental_marking_scope( 893 HistogramTimerScope incremental_marking_scope(
888 heap_->isolate()->counters()->gc_incremental_marking()); 894 heap_->isolate()->counters()->gc_incremental_marking());
889 double start = base::OS::TimeCurrentMillis(); 895 double start = base::OS::TimeCurrentMillis();
890 896
891 // The marking speed is driven either by the allocation rate or by the rate 897 // The marking speed is driven either by the allocation rate or by the rate
892 // at which we are having to check the color of objects in the write 898 // at which we are having to check the color of objects in the write
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { 975 void IncrementalMarking::IncrementIdleMarkingDelayCounter() {
970 idle_marking_delay_counter_++; 976 idle_marking_delay_counter_++;
971 } 977 }
972 978
973 979
974 void IncrementalMarking::ClearIdleMarkingDelayCounter() { 980 void IncrementalMarking::ClearIdleMarkingDelayCounter() {
975 idle_marking_delay_counter_ = 0; 981 idle_marking_delay_counter_ = 0;
976 } 982 }
977 } 983 }
978 } // namespace v8::internal 984 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698