OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 void RecordWriteOfCodeEntrySlow(JSFunction* host, Object** slot, Code* value); | 147 void RecordWriteOfCodeEntrySlow(JSFunction* host, Object** slot, Code* value); |
148 void RecordCodeTargetPatch(Code* host, Address pc, HeapObject* value); | 148 void RecordCodeTargetPatch(Code* host, Address pc, HeapObject* value); |
149 void RecordCodeTargetPatch(Address pc, HeapObject* value); | 149 void RecordCodeTargetPatch(Address pc, HeapObject* value); |
150 | 150 |
151 inline void RecordWrites(HeapObject* obj); | 151 inline void RecordWrites(HeapObject* obj); |
152 | 152 |
153 inline void BlackToGreyAndUnshift(HeapObject* obj, MarkBit mark_bit); | 153 inline void BlackToGreyAndUnshift(HeapObject* obj, MarkBit mark_bit); |
154 | 154 |
155 inline void WhiteToGreyAndPush(HeapObject* obj, MarkBit mark_bit); | 155 inline void WhiteToGreyAndPush(HeapObject* obj, MarkBit mark_bit); |
156 | 156 |
157 inline void WhiteToGrey(HeapObject* obj, MarkBit mark_bit); | |
158 | |
159 // Does white->black or keeps gray or black color. Returns true if converting | 157 // Does white->black or keeps gray or black color. Returns true if converting |
160 // white to black. | 158 // white to black. |
161 inline bool MarkBlackOrKeepGrey(MarkBit mark_bit) { | 159 inline bool MarkBlackOrKeepGrey(MarkBit mark_bit) { |
162 ASSERT(!Marking::IsImpossible(mark_bit)); | 160 ASSERT(!Marking::IsImpossible(mark_bit)); |
163 if (mark_bit.Get()) { | 161 if (mark_bit.Get()) { |
164 // Grey or black: Keep the color. | 162 // Grey or black: Keep the color. |
165 return false; | 163 return false; |
166 } | 164 } |
167 mark_bit.Set(); | 165 mark_bit.Set(); |
168 ASSERT(Marking::IsBlack(mark_bit)); | 166 ASSERT(Marking::IsBlack(mark_bit)); |
169 return true; | 167 return true; |
170 } | 168 } |
171 | 169 |
| 170 // Marks the object grey and pushes it on the marking stack. |
| 171 // Returns true if object needed marking and false otherwise. |
| 172 // This is for incremental marking only. |
| 173 INLINE(bool MarkObjectAndPush(HeapObject* obj)); |
| 174 |
| 175 // Marks the object black without pushing it on the marking stack. |
| 176 // Returns true if object needed marking and false otherwise. |
| 177 // This is for incremental marking only. |
| 178 INLINE(bool MarkObjectWithoutPush(HeapObject* obj)); |
| 179 |
172 inline int steps_count() { | 180 inline int steps_count() { |
173 return steps_count_; | 181 return steps_count_; |
174 } | 182 } |
175 | 183 |
176 inline double steps_took() { | 184 inline double steps_took() { |
177 return steps_took_; | 185 return steps_took_; |
178 } | 186 } |
179 | 187 |
180 inline double longest_step() { | 188 inline double longest_step() { |
181 return longest_step_; | 189 return longest_step_; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 void VisitGlobalContext(Context* ctx, ObjectVisitor* v); | 261 void VisitGlobalContext(Context* ctx, ObjectVisitor* v); |
254 | 262 |
255 Heap* heap_; | 263 Heap* heap_; |
256 | 264 |
257 State state_; | 265 State state_; |
258 bool is_compacting_; | 266 bool is_compacting_; |
259 | 267 |
260 VirtualMemory* marking_deque_memory_; | 268 VirtualMemory* marking_deque_memory_; |
261 bool marking_deque_memory_committed_; | 269 bool marking_deque_memory_committed_; |
262 MarkingDeque marking_deque_; | 270 MarkingDeque marking_deque_; |
| 271 Marker<IncrementalMarking> marker_; |
263 | 272 |
264 int steps_count_; | 273 int steps_count_; |
265 double steps_took_; | 274 double steps_took_; |
266 double longest_step_; | 275 double longest_step_; |
267 int64_t old_generation_space_available_at_start_of_incremental_; | 276 int64_t old_generation_space_available_at_start_of_incremental_; |
268 int64_t old_generation_space_used_at_start_of_incremental_; | 277 int64_t old_generation_space_used_at_start_of_incremental_; |
269 int steps_count_since_last_gc_; | 278 int steps_count_since_last_gc_; |
270 double steps_took_since_last_gc_; | 279 double steps_took_since_last_gc_; |
271 int64_t bytes_rescanned_; | 280 int64_t bytes_rescanned_; |
272 bool should_hurry_; | 281 bool should_hurry_; |
273 int allocation_marking_factor_; | 282 int allocation_marking_factor_; |
274 intptr_t bytes_scanned_; | 283 intptr_t bytes_scanned_; |
275 intptr_t allocated_; | 284 intptr_t allocated_; |
276 | 285 |
277 int no_marking_scope_depth_; | 286 int no_marking_scope_depth_; |
278 | 287 |
279 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); | 288 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); |
280 }; | 289 }; |
281 | 290 |
282 } } // namespace v8::internal | 291 } } // namespace v8::internal |
283 | 292 |
284 #endif // V8_INCREMENTAL_MARKING_H_ | 293 #endif // V8_INCREMENTAL_MARKING_H_ |
OLD | NEW |