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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 void RecordWriteOfCodeEntry(JSFunction* host, Object** slot, Code* value); | 131 void RecordWriteOfCodeEntry(JSFunction* host, Object** slot, Code* value); |
132 | 132 |
133 inline void RecordWrites(HeapObject* obj); | 133 inline void RecordWrites(HeapObject* obj); |
134 | 134 |
135 inline void BlackToGreyAndUnshift(HeapObject* obj, MarkBit mark_bit); | 135 inline void BlackToGreyAndUnshift(HeapObject* obj, MarkBit mark_bit); |
136 | 136 |
137 inline void WhiteToGreyAndPush(HeapObject* obj, MarkBit mark_bit); | 137 inline void WhiteToGreyAndPush(HeapObject* obj, MarkBit mark_bit); |
138 | 138 |
139 inline void WhiteToGrey(HeapObject* obj, MarkBit mark_bit); | 139 inline void WhiteToGrey(HeapObject* obj, MarkBit mark_bit); |
140 | 140 |
141 // Does white->black or grey->grey | 141 // Does white->black or keeps gray or black color. Returns true if converting |
| 142 // white to black. |
142 inline bool MarkBlackOrKeepGrey(MarkBit mark_bit) { | 143 inline bool MarkBlackOrKeepGrey(MarkBit mark_bit) { |
143 ASSERT(!Marking::IsImpossible(mark_bit)); | 144 ASSERT(!Marking::IsImpossible(mark_bit)); |
144 if (mark_bit.Get()) return false; | 145 if (mark_bit.Get()) { |
| 146 // Grey or black: Keep the color. |
| 147 return false; |
| 148 } |
145 mark_bit.Set(); | 149 mark_bit.Set(); |
146 ASSERT(!Marking::IsWhite(mark_bit)); | 150 ASSERT(Marking::IsBlack(mark_bit)); |
147 ASSERT(!Marking::IsImpossible(mark_bit)); | |
148 return true; | 151 return true; |
149 } | 152 } |
150 | 153 |
151 inline int steps_count() { | 154 inline int steps_count() { |
152 return steps_count_; | 155 return steps_count_; |
153 } | 156 } |
154 | 157 |
155 inline double steps_took() { | 158 inline double steps_took() { |
156 return steps_took_; | 159 return steps_took_; |
157 } | 160 } |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 bool should_hurry_; | 242 bool should_hurry_; |
240 int allocation_marking_factor_; | 243 int allocation_marking_factor_; |
241 intptr_t allocated_; | 244 intptr_t allocated_; |
242 | 245 |
243 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); | 246 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); |
244 }; | 247 }; |
245 | 248 |
246 } } // namespace v8::internal | 249 } } // namespace v8::internal |
247 | 250 |
248 #endif // V8_INCREMENTAL_MARKING_H_ | 251 #endif // V8_INCREMENTAL_MARKING_H_ |
OLD | NEW |