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

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

Issue 894703002: Add a flag to over approximate the weak closure during GC (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 10 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/heap.cc ('k') | 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"
11 #include "src/objects.h" 11 #include "src/objects.h"
12 12
13 namespace v8 { 13 namespace v8 {
14 namespace internal { 14 namespace internal {
15 15
16 16
17 class IncrementalMarking { 17 class IncrementalMarking {
18 public: 18 public:
19 enum State { STOPPED, SWEEPING, MARKING, COMPLETE }; 19 enum State { STOPPED, SWEEPING, MARKING, COMPLETE };
20 20
21 enum CompletionAction { GC_VIA_STACK_GUARD, NO_GC_VIA_STACK_GUARD }; 21 enum CompletionAction { GC_VIA_STACK_GUARD, NO_GC_VIA_STACK_GUARD };
22 22
23 enum ForceMarkingAction { FORCE_MARKING, DO_NOT_FORCE_MARKING }; 23 enum ForceMarkingAction { FORCE_MARKING, DO_NOT_FORCE_MARKING };
24 24
25 enum ForceCompletionAction { FORCE_COMPLETION, DO_NOT_FORCE_COMPLETION }; 25 enum ForceCompletionAction { FORCE_COMPLETION, DO_NOT_FORCE_COMPLETION };
26 26
27 enum GCRequestType { COMPLETE_MARKING, OVERAPPROXIMATION };
28
27 explicit IncrementalMarking(Heap* heap); 29 explicit IncrementalMarking(Heap* heap);
28 30
29 static void Initialize(); 31 static void Initialize();
30 32
31 State state() { 33 State state() {
32 DCHECK(state_ == STOPPED || FLAG_incremental_marking); 34 DCHECK(state_ == STOPPED || FLAG_incremental_marking);
33 return state_; 35 return state_;
34 } 36 }
35 37
36 bool should_hurry() { return should_hurry_; } 38 bool should_hurry() { return should_hurry_; }
37 void set_should_hurry(bool val) { should_hurry_ = val; } 39 void set_should_hurry(bool val) { should_hurry_ = val; }
38 40
41 bool weak_closure_was_overapproximated() const {
42 return weak_closure_was_overapproximated_;
43 }
44 void set_weak_closure_was_overapproximated(bool val) {
45 weak_closure_was_overapproximated_ = val;
46 }
47
39 inline bool IsStopped() { return state() == STOPPED; } 48 inline bool IsStopped() { return state() == STOPPED; }
40 49
41 INLINE(bool IsMarking()) { return state() >= MARKING; } 50 INLINE(bool IsMarking()) { return state() >= MARKING; }
42 51
43 inline bool IsMarkingIncomplete() { return state() == MARKING; } 52 inline bool IsMarkingIncomplete() { return state() == MARKING; }
44 53
45 inline bool IsComplete() { return state() == COMPLETE; } 54 inline bool IsComplete() { return state() == COMPLETE; }
46 55
56 GCRequestType request_type() const { return request_type_; }
57
47 bool WorthActivating(); 58 bool WorthActivating();
48 59
49 bool ShouldActivate(); 60 bool ShouldActivate();
50 61
51 bool WasActivated(); 62 bool WasActivated();
52 63
53 enum CompactionFlag { ALLOW_COMPACTION, PREVENT_COMPACTION }; 64 enum CompactionFlag { ALLOW_COMPACTION, PREVENT_COMPACTION };
54 65
55 void Start(CompactionFlag flag = ALLOW_COMPACTION); 66 void Start(CompactionFlag flag = ALLOW_COMPACTION);
56 67
57 void Stop(); 68 void Stop();
58 69
59 void PrepareForScavenge(); 70 void PrepareForScavenge();
60 71
61 void UpdateMarkingDequeAfterScavenge(); 72 void UpdateMarkingDequeAfterScavenge();
62 73
63 void Hurry(); 74 void Hurry();
64 75
65 void Finalize(); 76 void Finalize();
66 77
67 void Abort(); 78 void Abort();
68 79
80 void OverApproximateWeakClosure();
81
69 void MarkingComplete(CompletionAction action); 82 void MarkingComplete(CompletionAction action);
70 83
71 void Epilogue(); 84 void Epilogue();
72 85
73 // It's hard to know how much work the incremental marker should do to make 86 // It's hard to know how much work the incremental marker should do to make
74 // progress in the face of the mutator creating new work for it. We start 87 // progress in the face of the mutator creating new work for it. We start
75 // of at a moderate rate of work and gradually increase the speed of the 88 // of at a moderate rate of work and gradually increase the speed of the
76 // incremental marker until it completes. 89 // incremental marker until it completes.
77 // Do some marking every time this much memory has been allocated or that many 90 // Do some marking every time this much memory has been allocated or that many
78 // heavy (color-checking) write barriers have been invoked. 91 // heavy (color-checking) write barriers have been invoked.
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 intptr_t allocated_; 234 intptr_t allocated_;
222 intptr_t write_barriers_invoked_since_last_step_; 235 intptr_t write_barriers_invoked_since_last_step_;
223 size_t idle_marking_delay_counter_; 236 size_t idle_marking_delay_counter_;
224 237
225 int no_marking_scope_depth_; 238 int no_marking_scope_depth_;
226 239
227 int unscanned_bytes_of_large_object_; 240 int unscanned_bytes_of_large_object_;
228 241
229 bool was_activated_; 242 bool was_activated_;
230 243
244 bool weak_closure_was_overapproximated_;
245
246 GCRequestType request_type_;
247
231 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); 248 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking);
232 }; 249 };
233 } 250 }
234 } // namespace v8::internal 251 } // namespace v8::internal
235 252
236 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ 253 #endif // V8_HEAP_INCREMENTAL_MARKING_H_
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/incremental-marking.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698