Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(959)

Side by Side Diff: src/mark-compact.cc

Issue 3318014: Ensure that empty descriptor array is marked before visiting any maps in marking phase. (Closed)
Patch Set: Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 } 636 }
637 637
638 #ifdef ENABLE_DEBUGGER_SUPPORT 638 #ifdef ENABLE_DEBUGGER_SUPPORT
639 if (Debug::IsLoaded() || Debug::has_break_points()) { 639 if (Debug::IsLoaded() || Debug::has_break_points()) {
640 StaticMarkingVisitor::EnableCodeFlushing(false); 640 StaticMarkingVisitor::EnableCodeFlushing(false);
641 return; 641 return;
642 } 642 }
643 #endif 643 #endif
644 StaticMarkingVisitor::EnableCodeFlushing(true); 644 StaticMarkingVisitor::EnableCodeFlushing(true);
645 645
646 // Ensure that empty descriptor array is marked. Method MarkDescriptorArray
647 // relies on it being marked before any other descriptor array.
648 MarkObject(Heap::raw_unchecked_empty_descriptor_array());
649
646 // Make sure we are not referencing the code from the stack. 650 // Make sure we are not referencing the code from the stack.
647 for (StackFrameIterator it; !it.done(); it.Advance()) { 651 for (StackFrameIterator it; !it.done(); it.Advance()) {
648 MarkCompactCollector::MarkObject(it.frame()->unchecked_code()); 652 MarkObject(it.frame()->unchecked_code());
649 } 653 }
650 654
651 // Iterate the archived stacks in all threads to check if 655 // Iterate the archived stacks in all threads to check if
652 // the code is referenced. 656 // the code is referenced.
653 CodeMarkingVisitor code_marking_visitor; 657 CodeMarkingVisitor code_marking_visitor;
654 ThreadManager::IterateArchivedThreads(&code_marking_visitor); 658 ThreadManager::IterateArchivedThreads(&code_marking_visitor);
655 659
656 SharedFunctionInfoMarkingVisitor visitor; 660 SharedFunctionInfoMarkingVisitor visitor;
657 CompilationCache::IterateFunctions(&visitor); 661 CompilationCache::IterateFunctions(&visitor);
658 662
659 MarkCompactCollector::ProcessMarkingStack(); 663 ProcessMarkingStack();
660 } 664 }
661 665
662 666
663 // Visitor class for marking heap roots. 667 // Visitor class for marking heap roots.
664 class RootMarkingVisitor : public ObjectVisitor { 668 class RootMarkingVisitor : public ObjectVisitor {
665 public: 669 public:
666 void VisitPointer(Object** p) { 670 void VisitPointer(Object** p) {
667 MarkObjectByPointer(p); 671 MarkObjectByPointer(p);
668 } 672 }
669 673
(...skipping 1940 matching lines...) Expand 10 before | Expand all | Expand 10 after
2610 } 2614 }
2611 2615
2612 2616
2613 void MarkCompactCollector::Initialize() { 2617 void MarkCompactCollector::Initialize() {
2614 StaticPointersToNewGenUpdatingVisitor::Initialize(); 2618 StaticPointersToNewGenUpdatingVisitor::Initialize();
2615 StaticMarkingVisitor::Initialize(); 2619 StaticMarkingVisitor::Initialize();
2616 } 2620 }
2617 2621
2618 2622
2619 } } // namespace v8::internal 2623 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698