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

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

Issue 1274453002: improve allocation accounting for incremental mark (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 | « no previous file | src/heap/spaces.h » ('j') | src/heap/spaces.cc » ('J')
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 889 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 } 900 }
901 } 901 }
902 } 902 }
903 } 903 }
904 904
905 905
906 intptr_t IncrementalMarking::Step(intptr_t allocated_bytes, 906 intptr_t IncrementalMarking::Step(intptr_t allocated_bytes,
907 CompletionAction action, 907 CompletionAction action,
908 ForceMarkingAction marking, 908 ForceMarkingAction marking,
909 ForceCompletionAction completion) { 909 ForceCompletionAction completion) {
910 DCHECK(allocated_bytes >= 0);
911
910 if (heap_->gc_state() != Heap::NOT_IN_GC || !FLAG_incremental_marking || 912 if (heap_->gc_state() != Heap::NOT_IN_GC || !FLAG_incremental_marking ||
911 !FLAG_incremental_marking_steps || 913 !FLAG_incremental_marking_steps ||
912 (state_ != SWEEPING && state_ != MARKING)) { 914 (state_ != SWEEPING && state_ != MARKING)) {
913 return 0; 915 return 0;
914 } 916 }
915 917
916 allocated_ += allocated_bytes; 918 allocated_ += allocated_bytes;
917 919
918 if (marking == DO_NOT_FORCE_MARKING && allocated_ < kAllocatedThreshold && 920 if (marking == DO_NOT_FORCE_MARKING && allocated_ < kAllocatedThreshold &&
919 write_barriers_invoked_since_last_step_ < 921 write_barriers_invoked_since_last_step_ <
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { 1023 void IncrementalMarking::IncrementIdleMarkingDelayCounter() {
1022 idle_marking_delay_counter_++; 1024 idle_marking_delay_counter_++;
1023 } 1025 }
1024 1026
1025 1027
1026 void IncrementalMarking::ClearIdleMarkingDelayCounter() { 1028 void IncrementalMarking::ClearIdleMarkingDelayCounter() {
1027 idle_marking_delay_counter_ = 0; 1029 idle_marking_delay_counter_ = 0;
1028 } 1030 }
1029 } // namespace internal 1031 } // namespace internal
1030 } // namespace v8 1032 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/heap/spaces.h » ('j') | src/heap/spaces.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698