| OLD | NEW |
| 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 18 matching lines...) Expand all Loading... |
| 29 static void Initialize(); | 29 static void Initialize(); |
| 30 | 30 |
| 31 State state() { | 31 State state() { |
| 32 DCHECK(state_ == STOPPED || FLAG_incremental_marking); | 32 DCHECK(state_ == STOPPED || FLAG_incremental_marking); |
| 33 return state_; | 33 return state_; |
| 34 } | 34 } |
| 35 | 35 |
| 36 bool should_hurry() { return should_hurry_; } | 36 bool should_hurry() { return should_hurry_; } |
| 37 void set_should_hurry(bool val) { should_hurry_ = val; } | 37 void set_should_hurry(bool val) { should_hurry_ = val; } |
| 38 | 38 |
| 39 bool weak_closure_was_overapproximated() const { |
| 40 return weak_closure_was_overapproximated_; |
| 41 } |
| 42 void set_weak_closure_was_overapproximated(bool val) { |
| 43 weak_closure_was_overapproximated_ = val; |
| 44 } |
| 45 |
| 39 inline bool IsStopped() { return state() == STOPPED; } | 46 inline bool IsStopped() { return state() == STOPPED; } |
| 40 | 47 |
| 41 INLINE(bool IsMarking()) { return state() >= MARKING; } | 48 INLINE(bool IsMarking()) { return state() >= MARKING; } |
| 42 | 49 |
| 43 inline bool IsMarkingIncomplete() { return state() == MARKING; } | 50 inline bool IsMarkingIncomplete() { return state() == MARKING; } |
| 44 | 51 |
| 45 inline bool IsComplete() { return state() == COMPLETE; } | 52 inline bool IsComplete() { return state() == COMPLETE; } |
| 46 | 53 |
| 47 bool WorthActivating(); | 54 bool WorthActivating(); |
| 48 | 55 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 102 |
| 96 void OldSpaceStep(intptr_t allocated); | 103 void OldSpaceStep(intptr_t allocated); |
| 97 | 104 |
| 98 intptr_t Step(intptr_t allocated, CompletionAction action, | 105 intptr_t Step(intptr_t allocated, CompletionAction action, |
| 99 ForceMarkingAction marking = DO_NOT_FORCE_MARKING, | 106 ForceMarkingAction marking = DO_NOT_FORCE_MARKING, |
| 100 ForceCompletionAction completion = FORCE_COMPLETION); | 107 ForceCompletionAction completion = FORCE_COMPLETION); |
| 101 | 108 |
| 102 inline void RestartIfNotMarking() { | 109 inline void RestartIfNotMarking() { |
| 103 if (state_ == COMPLETE) { | 110 if (state_ == COMPLETE) { |
| 104 state_ = MARKING; | 111 state_ = MARKING; |
| 112 weak_closure_was_overapproximated_ = false; |
| 105 if (FLAG_trace_incremental_marking) { | 113 if (FLAG_trace_incremental_marking) { |
| 106 PrintF("[IncrementalMarking] Restarting (new grey objects)\n"); | 114 PrintF("[IncrementalMarking] Restarting (new grey objects)\n"); |
| 107 } | 115 } |
| 108 } | 116 } |
| 109 } | 117 } |
| 110 | 118 |
| 111 static void RecordWriteFromCode(HeapObject* obj, Object** slot, | 119 static void RecordWriteFromCode(HeapObject* obj, Object** slot, |
| 112 Isolate* isolate); | 120 Isolate* isolate); |
| 113 | 121 |
| 114 // Record a slot for compaction. Returns false for objects that are | 122 // Record a slot for compaction. Returns false for objects that are |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 intptr_t allocated_; | 229 intptr_t allocated_; |
| 222 intptr_t write_barriers_invoked_since_last_step_; | 230 intptr_t write_barriers_invoked_since_last_step_; |
| 223 size_t idle_marking_delay_counter_; | 231 size_t idle_marking_delay_counter_; |
| 224 | 232 |
| 225 int no_marking_scope_depth_; | 233 int no_marking_scope_depth_; |
| 226 | 234 |
| 227 int unscanned_bytes_of_large_object_; | 235 int unscanned_bytes_of_large_object_; |
| 228 | 236 |
| 229 bool was_activated_; | 237 bool was_activated_; |
| 230 | 238 |
| 239 bool weak_closure_was_overapproximated_; |
| 240 |
| 231 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); | 241 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); |
| 232 }; | 242 }; |
| 233 } | 243 } |
| 234 } // namespace v8::internal | 244 } // namespace v8::internal |
| 235 | 245 |
| 236 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ | 246 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ |
| OLD | NEW |