| 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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 | 240 |
| 241 MarkBit new_mark_bit = Marking::MarkBitFrom(new_start); | 241 MarkBit new_mark_bit = Marking::MarkBitFrom(new_start); |
| 242 | 242 |
| 243 if (!IncrementalMarking::IsStopped()) { | 243 if (!IncrementalMarking::IsStopped()) { |
| 244 MarkBit old_mark_bit = Marking::MarkBitFrom(old_start); | 244 MarkBit old_mark_bit = Marking::MarkBitFrom(old_start); |
| 245 if (IncrementalMarking::IsBlack(old_mark_bit)) { | 245 if (IncrementalMarking::IsBlack(old_mark_bit)) { |
| 246 IncrementalMarking::MarkBlack(new_mark_bit); | 246 IncrementalMarking::MarkBlack(new_mark_bit); |
| 247 old_mark_bit.Clear(); | 247 old_mark_bit.Clear(); |
| 248 } else if (IncrementalMarking::IsGrey(old_mark_bit)) { | 248 } else if (IncrementalMarking::IsGrey(old_mark_bit)) { |
| 249 old_mark_bit.Next().Clear(); | 249 old_mark_bit.Next().Clear(); |
| 250 IncrementalMarking::WhiteToGrey(HeapObject::FromAddress(new_start), | 250 IncrementalMarking::WhiteToGreyAndPush(HeapObject::FromAddress(new_start), |
| 251 new_mark_bit); | 251 new_mark_bit); |
| 252 IncrementalMarking::RestartIfNotMarking(); | 252 IncrementalMarking::RestartIfNotMarking(); |
| 253 // TODO(gc): if we shift huge array in the loop we might end up pushing | 253 // TODO(gc): if we shift huge array in the loop we might end up pushing |
| 254 // to much to marking stack. maybe we should check one or two elements | 254 // to much to marking stack. maybe we should check one or two elements |
| 255 // on top of it to see whether they are equal to old_start. | 255 // on top of it to see whether they are equal to old_start. |
| 256 } | 256 } |
| 257 } else { | 257 } else { |
| 258 ASSERT(IncrementalMarking::IsStopped()); | 258 ASSERT(IncrementalMarking::IsStopped()); |
| 259 if (Heap::InNewSpace(old_start)) { | 259 if (Heap::InNewSpace(old_start)) { |
| 260 return; | 260 return; |
| 261 } else { | 261 } else { |
| (...skipping 2265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2527 } | 2527 } |
| 2528 | 2528 |
| 2529 | 2529 |
| 2530 void MarkCompactCollector::Initialize() { | 2530 void MarkCompactCollector::Initialize() { |
| 2531 StaticPointersToNewGenUpdatingVisitor::Initialize(); | 2531 StaticPointersToNewGenUpdatingVisitor::Initialize(); |
| 2532 StaticMarkingVisitor::Initialize(); | 2532 StaticMarkingVisitor::Initialize(); |
| 2533 } | 2533 } |
| 2534 | 2534 |
| 2535 | 2535 |
| 2536 } } // namespace v8::internal | 2536 } } // namespace v8::internal |
| OLD | NEW |