| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 inline bool IsMarking() { return state() == MARKING; } | 60 inline bool IsMarking() { return state() == MARKING; } |
| 61 | 61 |
| 62 bool WorthActivating(); | 62 bool WorthActivating(); |
| 63 | 63 |
| 64 void Start(); | 64 void Start(); |
| 65 | 65 |
| 66 void Stop(); | 66 void Stop(); |
| 67 | 67 |
| 68 void PrepareForScavenge(); | 68 void PrepareForScavenge(); |
| 69 | 69 |
| 70 void UpdateMarkingStackAfterScavenge(); | 70 void UpdateMarkingDequeAfterScavenge(); |
| 71 | 71 |
| 72 void Hurry(); | 72 void Hurry(); |
| 73 | 73 |
| 74 void Finalize(); | 74 void Finalize(); |
| 75 | 75 |
| 76 void MarkingComplete(); | 76 void MarkingComplete(); |
| 77 | 77 |
| 78 // It's hard to know how much work the incremental marker should do to make | 78 // It's hard to know how much work the incremental marker should do to make |
| 79 // progress in the face of the mutator creating new work for it. We start | 79 // progress in the face of the mutator creating new work for it. We start |
| 80 // of at a moderate rate of work and gradually increase the speed of the | 80 // of at a moderate rate of work and gradually increase the speed of the |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 } | 131 } |
| 132 | 132 |
| 133 // Grey markbits: 11 | 133 // Grey markbits: 11 |
| 134 static const char* kGreyBitPattern; | 134 static const char* kGreyBitPattern; |
| 135 static inline bool IsGrey(MarkBit mark_bit) { | 135 static inline bool IsGrey(MarkBit mark_bit) { |
| 136 ASSERT(strcmp(kGreyBitPattern, "11") == 0); | 136 ASSERT(strcmp(kGreyBitPattern, "11") == 0); |
| 137 ASSERT(!IsImpossible(mark_bit)); | 137 ASSERT(!IsImpossible(mark_bit)); |
| 138 return mark_bit.Get() && mark_bit.Next().Get(); | 138 return mark_bit.Get() && mark_bit.Next().Get(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 inline void BlackToGreyAndPush(HeapObject* obj, MarkBit mark_bit); | 141 inline void BlackToGreyAndUnshift(HeapObject* obj, MarkBit mark_bit); |
| 142 | 142 |
| 143 inline void WhiteToGreyAndPush(HeapObject* obj, MarkBit mark_bit); | 143 inline void WhiteToGreyAndPush(HeapObject* obj, MarkBit mark_bit); |
| 144 | 144 |
| 145 inline void WhiteToGrey(HeapObject* obj, MarkBit mark_bit); | 145 inline void WhiteToGrey(HeapObject* obj, MarkBit mark_bit); |
| 146 | 146 |
| 147 inline void MarkBlack(MarkBit mark_bit) { | 147 inline void MarkBlack(MarkBit mark_bit) { |
| 148 mark_bit.Set(); | 148 mark_bit.Set(); |
| 149 mark_bit.Next().Clear(); | 149 mark_bit.Next().Clear(); |
| 150 ASSERT(IsBlack(mark_bit)); | 150 ASSERT(IsBlack(mark_bit)); |
| 151 } | 151 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 void ResetStepCounters() { | 192 void ResetStepCounters() { |
| 193 steps_count_ = 0; | 193 steps_count_ = 0; |
| 194 steps_took_ = 0; | 194 steps_took_ = 0; |
| 195 allocation_marking_factor_ = kInitialAllocationMarkingFactor; | 195 allocation_marking_factor_ = kInitialAllocationMarkingFactor; |
| 196 } | 196 } |
| 197 | 197 |
| 198 | 198 |
| 199 Heap* heap_; | 199 Heap* heap_; |
| 200 | 200 |
| 201 State state_; | 201 State state_; |
| 202 MarkingStack marking_stack_; | 202 MarkingDeque marking_deque_; |
| 203 | 203 |
| 204 int steps_count_; | 204 int steps_count_; |
| 205 double steps_took_; | 205 double steps_took_; |
| 206 bool should_hurry_; | 206 bool should_hurry_; |
| 207 intptr_t allocation_marking_factor_; | 207 intptr_t allocation_marking_factor_; |
| 208 intptr_t allocated_; | 208 intptr_t allocated_; |
| 209 }; | 209 }; |
| 210 | 210 |
| 211 } } // namespace v8::internal | 211 } } // namespace v8::internal |
| 212 | 212 |
| 213 #endif // V8_INCREMENTAL_MARKING_H_ | 213 #endif // V8_INCREMENTAL_MARKING_H_ |
| OLD | NEW |