| 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 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 } | 632 } |
| 633 | 633 |
| 634 #ifdef ENABLE_DEBUGGER_SUPPORT | 634 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 635 if (Debug::IsLoaded() || Debug::has_break_points()) { | 635 if (Debug::IsLoaded() || Debug::has_break_points()) { |
| 636 StaticMarkingVisitor::EnableCodeFlushing(false); | 636 StaticMarkingVisitor::EnableCodeFlushing(false); |
| 637 return; | 637 return; |
| 638 } | 638 } |
| 639 #endif | 639 #endif |
| 640 StaticMarkingVisitor::EnableCodeFlushing(true); | 640 StaticMarkingVisitor::EnableCodeFlushing(true); |
| 641 | 641 |
| 642 // Ensure that empty descriptor array is marked. Method MarkDescriptorArray |
| 643 // relies on it being marked before any other descriptor array. |
| 644 MarkObject(Heap::raw_unchecked_empty_descriptor_array()); |
| 645 |
| 642 // Make sure we are not referencing the code from the stack. | 646 // Make sure we are not referencing the code from the stack. |
| 643 for (StackFrameIterator it; !it.done(); it.Advance()) { | 647 for (StackFrameIterator it; !it.done(); it.Advance()) { |
| 644 MarkCompactCollector::MarkObject(it.frame()->unchecked_code()); | 648 MarkObject(it.frame()->unchecked_code()); |
| 645 } | 649 } |
| 646 | 650 |
| 647 // Iterate the archived stacks in all threads to check if | 651 // Iterate the archived stacks in all threads to check if |
| 648 // the code is referenced. | 652 // the code is referenced. |
| 649 CodeMarkingVisitor code_marking_visitor; | 653 CodeMarkingVisitor code_marking_visitor; |
| 650 ThreadManager::IterateArchivedThreads(&code_marking_visitor); | 654 ThreadManager::IterateArchivedThreads(&code_marking_visitor); |
| 651 | 655 |
| 652 SharedFunctionInfoMarkingVisitor visitor; | 656 SharedFunctionInfoMarkingVisitor visitor; |
| 653 CompilationCache::IterateFunctions(&visitor); | 657 CompilationCache::IterateFunctions(&visitor); |
| 654 | 658 |
| 655 MarkCompactCollector::ProcessMarkingStack(); | 659 ProcessMarkingStack(); |
| 656 } | 660 } |
| 657 | 661 |
| 658 | 662 |
| 659 // Visitor class for marking heap roots. | 663 // Visitor class for marking heap roots. |
| 660 class RootMarkingVisitor : public ObjectVisitor { | 664 class RootMarkingVisitor : public ObjectVisitor { |
| 661 public: | 665 public: |
| 662 void VisitPointer(Object** p) { | 666 void VisitPointer(Object** p) { |
| 663 MarkObjectByPointer(p); | 667 MarkObjectByPointer(p); |
| 664 } | 668 } |
| 665 | 669 |
| (...skipping 1998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2664 } | 2668 } |
| 2665 | 2669 |
| 2666 | 2670 |
| 2667 void MarkCompactCollector::Initialize() { | 2671 void MarkCompactCollector::Initialize() { |
| 2668 StaticPointersToNewGenUpdatingVisitor::Initialize(); | 2672 StaticPointersToNewGenUpdatingVisitor::Initialize(); |
| 2669 StaticMarkingVisitor::Initialize(); | 2673 StaticMarkingVisitor::Initialize(); |
| 2670 } | 2674 } |
| 2671 | 2675 |
| 2672 | 2676 |
| 2673 } } // namespace v8::internal | 2677 } } // namespace v8::internal |
| OLD | NEW |