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 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 // (unless reachable from another symbol). | 586 // (unless reachable from another symbol). |
587 SymbolMarkingVisitor symbol_marker; | 587 SymbolMarkingVisitor symbol_marker; |
588 symbol_table->IterateElements(&symbol_marker); | 588 symbol_table->IterateElements(&symbol_marker); |
589 ProcessMarkingStack(&marker); | 589 ProcessMarkingStack(&marker); |
590 } | 590 } |
591 | 591 |
592 | 592 |
593 void MarkCompactCollector::MarkRoots(RootMarkingVisitor* visitor) { | 593 void MarkCompactCollector::MarkRoots(RootMarkingVisitor* visitor) { |
594 // Mark the heap roots including global variables, stack variables, | 594 // Mark the heap roots including global variables, stack variables, |
595 // etc., and all objects reachable from them. | 595 // etc., and all objects reachable from them. |
596 Heap::IterateStrongRoots(visitor); | 596 Heap::IterateStrongRoots(visitor, VISIT_ONLY_STRONG); |
597 | 597 |
598 // Handle the symbol table specially. | 598 // Handle the symbol table specially. |
599 MarkSymbolTable(); | 599 MarkSymbolTable(); |
600 | 600 |
601 // There may be overflowed objects in the heap. Visit them now. | 601 // There may be overflowed objects in the heap. Visit them now. |
602 while (marking_stack.overflowed()) { | 602 while (marking_stack.overflowed()) { |
603 RefillMarkingStack(); | 603 RefillMarkingStack(); |
604 EmptyMarkingStack(visitor->stack_visitor()); | 604 EmptyMarkingStack(visitor->stack_visitor()); |
605 } | 605 } |
606 } | 606 } |
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1448 } | 1448 } |
1449 }; | 1449 }; |
1450 | 1450 |
1451 | 1451 |
1452 void MarkCompactCollector::UpdatePointers() { | 1452 void MarkCompactCollector::UpdatePointers() { |
1453 #ifdef DEBUG | 1453 #ifdef DEBUG |
1454 ASSERT(state_ == ENCODE_FORWARDING_ADDRESSES); | 1454 ASSERT(state_ == ENCODE_FORWARDING_ADDRESSES); |
1455 state_ = UPDATE_POINTERS; | 1455 state_ = UPDATE_POINTERS; |
1456 #endif | 1456 #endif |
1457 UpdatingVisitor updating_visitor; | 1457 UpdatingVisitor updating_visitor; |
1458 Heap::IterateRoots(&updating_visitor); | 1458 Heap::IterateRoots(&updating_visitor, VISIT_ONLY_STRONG); |
1459 GlobalHandles::IterateWeakRoots(&updating_visitor); | 1459 GlobalHandles::IterateWeakRoots(&updating_visitor); |
1460 | 1460 |
1461 int live_maps = IterateLiveObjects(Heap::map_space(), | 1461 int live_maps = IterateLiveObjects(Heap::map_space(), |
1462 &UpdatePointersInOldObject); | 1462 &UpdatePointersInOldObject); |
1463 int live_pointer_olds = IterateLiveObjects(Heap::old_pointer_space(), | 1463 int live_pointer_olds = IterateLiveObjects(Heap::old_pointer_space(), |
1464 &UpdatePointersInOldObject); | 1464 &UpdatePointersInOldObject); |
1465 int live_data_olds = IterateLiveObjects(Heap::old_data_space(), | 1465 int live_data_olds = IterateLiveObjects(Heap::old_data_space(), |
1466 &UpdatePointersInOldObject); | 1466 &UpdatePointersInOldObject); |
1467 int live_codes = IterateLiveObjects(Heap::code_space(), | 1467 int live_codes = IterateLiveObjects(Heap::code_space(), |
1468 &UpdatePointersInOldObject); | 1468 &UpdatePointersInOldObject); |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1807 | 1807 |
1808 void MarkCompactCollector::RebuildRSets() { | 1808 void MarkCompactCollector::RebuildRSets() { |
1809 #ifdef DEBUG | 1809 #ifdef DEBUG |
1810 ASSERT(state_ == RELOCATE_OBJECTS); | 1810 ASSERT(state_ == RELOCATE_OBJECTS); |
1811 state_ = REBUILD_RSETS; | 1811 state_ = REBUILD_RSETS; |
1812 #endif | 1812 #endif |
1813 Heap::RebuildRSets(); | 1813 Heap::RebuildRSets(); |
1814 } | 1814 } |
1815 | 1815 |
1816 } } // namespace v8::internal | 1816 } } // namespace v8::internal |
OLD | NEW |