| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 map->heap()->mark_compact_collector()->SetMark(obj); | 373 map->heap()->mark_compact_collector()->SetMark(obj); |
| 374 // Mark the map pointer and the body. | 374 // Mark the map pointer and the body. |
| 375 map->heap()->mark_compact_collector()->MarkObject(map); | 375 map->heap()->mark_compact_collector()->MarkObject(map); |
| 376 IterateBody(map, obj); | 376 IterateBody(map, obj); |
| 377 } | 377 } |
| 378 | 378 |
| 379 // Visit all unmarked objects pointed to by [start, end). | 379 // Visit all unmarked objects pointed to by [start, end). |
| 380 // Returns false if the operation fails (lack of stack space). | 380 // Returns false if the operation fails (lack of stack space). |
| 381 static inline bool VisitUnmarkedObjects(Object** start, Object** end) { | 381 static inline bool VisitUnmarkedObjects(Object** start, Object** end) { |
| 382 // Return false is we are close to the stack limit. | 382 // Return false is we are close to the stack limit. |
| 383 StackLimitCheck check; | 383 StackLimitCheck check(Isolate::Current()); |
| 384 if (check.HasOverflowed()) return false; | 384 if (check.HasOverflowed()) return false; |
| 385 | 385 |
| 386 // Visit the unmarked objects. | 386 // Visit the unmarked objects. |
| 387 for (Object** p = start; p < end; p++) { | 387 for (Object** p = start; p < end; p++) { |
| 388 if (!(*p)->IsHeapObject()) continue; | 388 if (!(*p)->IsHeapObject()) continue; |
| 389 HeapObject* obj = HeapObject::cast(*p); | 389 HeapObject* obj = HeapObject::cast(*p); |
| 390 if (obj->IsMarked()) continue; | 390 if (obj->IsMarked()) continue; |
| 391 VisitUnmarkedObject(obj); | 391 VisitUnmarkedObject(obj); |
| 392 } | 392 } |
| 393 return true; | 393 return true; |
| (...skipping 2238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2632 } | 2632 } |
| 2633 | 2633 |
| 2634 | 2634 |
| 2635 void MarkCompactCollector::Initialize() { | 2635 void MarkCompactCollector::Initialize() { |
| 2636 StaticPointersToNewGenUpdatingVisitor::Initialize(); | 2636 StaticPointersToNewGenUpdatingVisitor::Initialize(); |
| 2637 StaticMarkingVisitor::Initialize(); | 2637 StaticMarkingVisitor::Initialize(); |
| 2638 } | 2638 } |
| 2639 | 2639 |
| 2640 | 2640 |
| 2641 } } // namespace v8::internal | 2641 } } // namespace v8::internal |
| OLD | NEW |