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 #include "src/heap/incremental-marking.h" | 5 #include "src/heap/incremental-marking.h" |
6 | 6 |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/compilation-cache.h" | 8 #include "src/compilation-cache.h" |
9 #include "src/conversions.h" | 9 #include "src/conversions.h" |
10 #include "src/heap/gc-idle-time-handler.h" | 10 #include "src/heap/gc-idle-time-handler.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 unscanned_bytes_of_large_object_(0), | 43 unscanned_bytes_of_large_object_(0), |
44 was_activated_(false), | 44 was_activated_(false), |
45 finalize_marking_completed_(false), | 45 finalize_marking_completed_(false), |
46 incremental_marking_finalization_rounds_(0), | 46 incremental_marking_finalization_rounds_(0), |
47 request_type_(COMPLETE_MARKING) {} | 47 request_type_(COMPLETE_MARKING) {} |
48 | 48 |
49 | 49 |
50 bool IncrementalMarking::BaseRecordWrite(HeapObject* obj, Object* value) { | 50 bool IncrementalMarking::BaseRecordWrite(HeapObject* obj, Object* value) { |
51 HeapObject* value_heap_obj = HeapObject::cast(value); | 51 HeapObject* value_heap_obj = HeapObject::cast(value); |
52 MarkBit value_bit = Marking::MarkBitFrom(value_heap_obj); | 52 MarkBit value_bit = Marking::MarkBitFrom(value_heap_obj); |
| 53 DCHECK(!Marking::IsImpossible(value_bit)); |
| 54 |
53 MarkBit obj_bit = Marking::MarkBitFrom(obj); | 55 MarkBit obj_bit = Marking::MarkBitFrom(obj); |
| 56 DCHECK(!Marking::IsImpossible(obj_bit)); |
54 bool is_black = Marking::IsBlack(obj_bit); | 57 bool is_black = Marking::IsBlack(obj_bit); |
| 58 |
55 if (is_black && Marking::IsWhite(value_bit)) { | 59 if (is_black && Marking::IsWhite(value_bit)) { |
56 WhiteToGreyAndPush(value_heap_obj, value_bit); | 60 WhiteToGreyAndPush(value_heap_obj, value_bit); |
57 RestartIfNotMarking(); | 61 RestartIfNotMarking(); |
58 } | 62 } |
59 return is_compacting_ && is_black; | 63 return is_compacting_ && is_black; |
60 } | 64 } |
61 | 65 |
62 | 66 |
63 void IncrementalMarking::RecordWriteSlow(HeapObject* obj, Object** slot, | 67 void IncrementalMarking::RecordWriteSlow(HeapObject* obj, Object** slot, |
64 Object* value) { | 68 Object* value) { |
(...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1242 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { | 1246 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { |
1243 idle_marking_delay_counter_++; | 1247 idle_marking_delay_counter_++; |
1244 } | 1248 } |
1245 | 1249 |
1246 | 1250 |
1247 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1251 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
1248 idle_marking_delay_counter_ = 0; | 1252 idle_marking_delay_counter_ = 0; |
1249 } | 1253 } |
1250 } // namespace internal | 1254 } // namespace internal |
1251 } // namespace v8 | 1255 } // namespace v8 |
OLD | NEW |