| 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 inline ObjectColor Color(HeapObject* obj); | 182 inline ObjectColor Color(HeapObject* obj); |
| 183 | 183 |
| 184 inline int steps_count() { | 184 inline int steps_count() { |
| 185 return steps_count_; | 185 return steps_count_; |
| 186 } | 186 } |
| 187 | 187 |
| 188 inline double steps_took() { | 188 inline double steps_took() { |
| 189 return steps_took_; | 189 return steps_took_; |
| 190 } | 190 } |
| 191 | 191 |
| 192 inline void SetOldSpacePageFlags(MemoryChunk* chunk) { |
| 193 SetOldSpacePageFlags(chunk, IsMarking()); |
| 194 } |
| 195 |
| 196 inline void SetNewSpacePageFlags(MemoryChunk* chunk) { |
| 197 SetNewSpacePageFlags(chunk, IsMarking()); |
| 198 } |
| 199 |
| 200 |
| 192 private: | 201 private: |
| 193 void set_should_hurry(bool val) { | 202 void set_should_hurry(bool val) { |
| 194 should_hurry_ = val; | 203 should_hurry_ = val; |
| 195 } | 204 } |
| 196 | 205 |
| 197 void ResetStepCounters() { | 206 void ResetStepCounters() { |
| 198 steps_count_ = 0; | 207 steps_count_ = 0; |
| 199 steps_took_ = 0; | 208 steps_took_ = 0; |
| 200 allocation_marking_factor_ = kInitialAllocationMarkingFactor; | 209 allocation_marking_factor_ = kInitialAllocationMarkingFactor; |
| 201 } | 210 } |
| 202 | 211 |
| 203 static void ClearMarkbits(PagedSpace* space); | 212 static void ClearMarkbits(PagedSpace* space); |
| 204 void ClearMarkbits(); | 213 void ClearMarkbits(); |
| 205 | 214 |
| 206 #ifdef DEBUG | 215 #ifdef DEBUG |
| 207 void VerifyMarkbitsAreClean(); | 216 void VerifyMarkbitsAreClean(); |
| 208 static void VerifyMarkbitsAreClean(PagedSpace* space); | 217 static void VerifyMarkbitsAreClean(PagedSpace* space); |
| 209 #endif | 218 #endif |
| 210 | 219 |
| 211 void StartMarking(); | 220 void StartMarking(); |
| 212 | 221 |
| 222 void RevertWriteBarrierFlags(PagedSpace* space); |
| 223 void RevertWriteBarrierFlags(); |
| 224 |
| 225 static void SetOldSpacePageFlags(MemoryChunk* chunk, bool is_marking); |
| 226 static void SetNewSpacePageFlags(MemoryChunk* chunk, bool is_marking); |
| 213 | 227 |
| 214 Heap* heap_; | 228 Heap* heap_; |
| 215 | 229 |
| 216 State state_; | 230 State state_; |
| 217 MarkingDeque marking_deque_; | 231 MarkingDeque marking_deque_; |
| 218 | 232 |
| 219 int steps_count_; | 233 int steps_count_; |
| 220 double steps_took_; | 234 double steps_took_; |
| 221 bool should_hurry_; | 235 bool should_hurry_; |
| 222 intptr_t allocation_marking_factor_; | 236 intptr_t allocation_marking_factor_; |
| 223 intptr_t allocated_; | 237 intptr_t allocated_; |
| 224 }; | 238 }; |
| 225 | 239 |
| 226 } } // namespace v8::internal | 240 } } // namespace v8::internal |
| 227 | 241 |
| 228 #endif // V8_INCREMENTAL_MARKING_H_ | 242 #endif // V8_INCREMENTAL_MARKING_H_ |
| OLD | NEW |