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

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

Issue 1865333002: [heap] Make sure that we transition to MARKING when we are finalize SWEEPING. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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 #include "src/cancelable-task.h" 8 #include "src/cancelable-task.h"
9 #include "src/execution.h" 9 #include "src/execution.h"
10 #include "src/heap/heap.h" 10 #include "src/heap/heap.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 bool finalize_marking_completed() const { 61 bool finalize_marking_completed() const {
62 return finalize_marking_completed_; 62 return finalize_marking_completed_;
63 } 63 }
64 64
65 void SetWeakClosureWasOverApproximatedForTesting(bool val) { 65 void SetWeakClosureWasOverApproximatedForTesting(bool val) {
66 finalize_marking_completed_ = val; 66 finalize_marking_completed_ = val;
67 } 67 }
68 68
69 inline bool IsStopped() { return state() == STOPPED; } 69 inline bool IsStopped() { return state() == STOPPED; }
70 70
71 inline bool IsSweeping() { return state() == SWEEPING; }
72
71 INLINE(bool IsMarking()) { return state() >= MARKING; } 73 INLINE(bool IsMarking()) { return state() >= MARKING; }
72 74
73 inline bool IsMarkingIncomplete() { return state() == MARKING; } 75 inline bool IsMarkingIncomplete() { return state() == MARKING; }
74 76
75 inline bool IsComplete() { return state() == COMPLETE; } 77 inline bool IsComplete() { return state() == COMPLETE; }
76 78
77 inline bool IsReadyToOverApproximateWeakClosure() const { 79 inline bool IsReadyToOverApproximateWeakClosure() const {
78 return request_type_ == FINALIZATION && !finalize_marking_completed_; 80 return request_type_ == FINALIZATION && !finalize_marking_completed_;
79 } 81 }
80 82
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 // After this many steps we increase the marking/allocating factor. 130 // After this many steps we increase the marking/allocating factor.
129 static const intptr_t kMarkingSpeedAccellerationInterval = 1024; 131 static const intptr_t kMarkingSpeedAccellerationInterval = 1024;
130 // This is how much we increase the marking/allocating factor by. 132 // This is how much we increase the marking/allocating factor by.
131 static const intptr_t kMarkingSpeedAccelleration = 2; 133 static const intptr_t kMarkingSpeedAccelleration = 2;
132 static const intptr_t kMaxMarkingSpeed = 1000; 134 static const intptr_t kMaxMarkingSpeed = 1000;
133 135
134 // This is the upper bound for how many times we allow finalization of 136 // This is the upper bound for how many times we allow finalization of
135 // incremental marking to be postponed. 137 // incremental marking to be postponed.
136 static const size_t kMaxIdleMarkingDelayCounter = 3; 138 static const size_t kMaxIdleMarkingDelayCounter = 3;
137 139
140 void FinalizeSweeping();
141
138 void OldSpaceStep(intptr_t allocated); 142 void OldSpaceStep(intptr_t allocated);
139 143
140 intptr_t Step(intptr_t allocated, CompletionAction action, 144 intptr_t Step(intptr_t allocated, CompletionAction action,
141 ForceMarkingAction marking = DO_NOT_FORCE_MARKING, 145 ForceMarkingAction marking = DO_NOT_FORCE_MARKING,
142 ForceCompletionAction completion = FORCE_COMPLETION); 146 ForceCompletionAction completion = FORCE_COMPLETION);
143 147
144 inline void RestartIfNotMarking() { 148 inline void RestartIfNotMarking() {
145 if (state_ == COMPLETE) { 149 if (state_ == COMPLETE) {
146 state_ = MARKING; 150 state_ = MARKING;
147 if (FLAG_trace_incremental_marking) { 151 if (FLAG_trace_incremental_marking) {
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 GCRequestType request_type_; 301 GCRequestType request_type_;
298 302
299 IncrementalMarkingJob incremental_marking_job_; 303 IncrementalMarkingJob incremental_marking_job_;
300 304
301 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); 305 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking);
302 }; 306 };
303 } // namespace internal 307 } // namespace internal
304 } // namespace v8 308 } // namespace v8
305 309
306 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ 310 #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