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

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

Issue 1077153004: Reland: Fix logic for incremental marking steps on tenured allocation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Merge up Created 5 years, 5 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/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 #ifndef V8_HEAP_INCREMENTAL_MARKING_H_ 5 #ifndef V8_HEAP_INCREMENTAL_MARKING_H_
6 #define V8_HEAP_INCREMENTAL_MARKING_H_ 6 #define V8_HEAP_INCREMENTAL_MARKING_H_
7 7
8 8
9 #include "src/execution.h" 9 #include "src/execution.h"
10 #include "src/heap/mark-compact.h" 10 #include "src/heap/mark-compact.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 } 43 }
44 44
45 void SetWeakClosureWasOverApproximatedForTesting(bool val) { 45 void SetWeakClosureWasOverApproximatedForTesting(bool val) {
46 weak_closure_was_overapproximated_ = val; 46 weak_closure_was_overapproximated_ = val;
47 } 47 }
48 48
49 inline bool IsStopped() { return state() == STOPPED; } 49 inline bool IsStopped() { return state() == STOPPED; }
50 50
51 INLINE(bool IsMarking()) { return state() >= MARKING; } 51 INLINE(bool IsMarking()) { return state() >= MARKING; }
52 52
53 inline bool IsMarkingIncomplete() { return state() == MARKING; } 53 inline bool CanDoSteps() {
54 return FLAG_incremental_marking_steps &&
55 (state() == MARKING || state() == SWEEPING);
56 }
54 57
55 inline bool IsComplete() { return state() == COMPLETE; } 58 inline bool IsComplete() { return state() == COMPLETE; }
56 59
57 inline bool IsReadyToOverApproximateWeakClosure() const { 60 inline bool IsReadyToOverApproximateWeakClosure() const {
58 return request_type_ == OVERAPPROXIMATION && 61 return request_type_ == OVERAPPROXIMATION &&
59 !weak_closure_was_overapproximated_; 62 !weak_closure_was_overapproximated_;
60 } 63 }
61 64
62 GCRequestType request_type() const { return request_type_; } 65 GCRequestType request_type() const { return request_type_; }
63 66
(...skipping 29 matching lines...) Expand all
93 // incremental marker until it completes. 96 // incremental marker until it completes.
94 // Do some marking every time this much memory has been allocated or that many 97 // Do some marking every time this much memory has been allocated or that many
95 // heavy (color-checking) write barriers have been invoked. 98 // heavy (color-checking) write barriers have been invoked.
96 static const intptr_t kAllocatedThreshold = 65536; 99 static const intptr_t kAllocatedThreshold = 65536;
97 static const intptr_t kWriteBarriersInvokedThreshold = 32768; 100 static const intptr_t kWriteBarriersInvokedThreshold = 32768;
98 // Start off by marking this many times more memory than has been allocated. 101 // Start off by marking this many times more memory than has been allocated.
99 static const intptr_t kInitialMarkingSpeed = 1; 102 static const intptr_t kInitialMarkingSpeed = 1;
100 // But if we are promoting a lot of data we need to mark faster to keep up 103 // But if we are promoting a lot of data we need to mark faster to keep up
101 // with the data that is entering the old space through promotion. 104 // with the data that is entering the old space through promotion.
102 static const intptr_t kFastMarking = 3; 105 static const intptr_t kFastMarking = 3;
106 static const intptr_t kOldSpaceAllocationMarkingFactor =
107 kFastMarking / kInitialMarkingSpeed;
103 // After this many steps we increase the marking/allocating factor. 108 // After this many steps we increase the marking/allocating factor.
104 static const intptr_t kMarkingSpeedAccellerationInterval = 1024; 109 static const intptr_t kMarkingSpeedAccellerationInterval = 1024;
105 // This is how much we increase the marking/allocating factor by. 110 // This is how much we increase the marking/allocating factor by.
106 static const intptr_t kMarkingSpeedAccelleration = 2; 111 static const intptr_t kMarkingSpeedAccelleration = 2;
107 static const intptr_t kMaxMarkingSpeed = 1000; 112 static const intptr_t kMaxMarkingSpeed = 1000;
108 113
109 // This is the upper bound for how many times we allow finalization of 114 // This is the upper bound for how many times we allow finalization of
110 // incremental marking to be postponed. 115 // incremental marking to be postponed.
111 static const size_t kMaxIdleMarkingDelayCounter = 3; 116 static const size_t kMaxIdleMarkingDelayCounter = 3;
112 117
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 int weak_closure_approximation_rounds_; 247 int weak_closure_approximation_rounds_;
243 248
244 GCRequestType request_type_; 249 GCRequestType request_type_;
245 250
246 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); 251 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking);
247 }; 252 };
248 } 253 }
249 } // namespace v8::internal 254 } // namespace v8::internal
250 255
251 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ 256 #endif // V8_HEAP_INCREMENTAL_MARKING_H_
OLDNEW
« no previous file with comments | « no previous file | src/heap/incremental-marking.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698