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

Side by Side Diff: src/heap/objects-visiting-inl.h

Issue 1169733002: Revert of Replace ad-hoc weakness in prototype transitions with WeakCell. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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 | « src/heap/mark-compact.cc ('k') | src/transitions.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_OBJECTS_VISITING_INL_H_ 5 #ifndef V8_OBJECTS_VISITING_INL_H_
6 #define V8_OBJECTS_VISITING_INL_H_ 6 #define V8_OBJECTS_VISITING_INL_H_
7 7
8 #include "src/heap/objects-visiting.h" 8 #include "src/heap/objects-visiting.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 HeapObject::RawField(map, Map::kPointerFieldsEndOffset)); 594 HeapObject::RawField(map, Map::kPointerFieldsEndOffset));
595 } 595 }
596 596
597 597
598 template <typename StaticVisitor> 598 template <typename StaticVisitor>
599 void StaticMarkingVisitor<StaticVisitor>::MarkTransitionArray( 599 void StaticMarkingVisitor<StaticVisitor>::MarkTransitionArray(
600 Heap* heap, TransitionArray* transitions) { 600 Heap* heap, TransitionArray* transitions) {
601 if (!StaticVisitor::MarkObjectWithoutPush(heap, transitions)) return; 601 if (!StaticVisitor::MarkObjectWithoutPush(heap, transitions)) return;
602 602
603 if (transitions->HasPrototypeTransitions()) { 603 if (transitions->HasPrototypeTransitions()) {
604 StaticVisitor::VisitPointer(heap, 604 // Mark prototype transitions array but do not push it onto marking
605 transitions->GetPrototypeTransitionsSlot()); 605 // stack, this will make references from it weak. We will clean dead
606 // prototype transitions in ClearNonLiveReferences.
607 Object** slot = transitions->GetPrototypeTransitionsSlot();
608 HeapObject* obj = HeapObject::cast(*slot);
609 heap->mark_compact_collector()->RecordSlot(slot, slot, obj);
610 StaticVisitor::MarkObjectWithoutPush(heap, obj);
606 } 611 }
607 612
608 int num_transitions = TransitionArray::NumberOfTransitions(transitions); 613 int num_transitions = TransitionArray::NumberOfTransitions(transitions);
609 for (int i = 0; i < num_transitions; ++i) { 614 for (int i = 0; i < num_transitions; ++i) {
610 StaticVisitor::VisitPointer(heap, transitions->GetKeySlot(i)); 615 StaticVisitor::VisitPointer(heap, transitions->GetKeySlot(i));
611 } 616 }
612 } 617 }
613 618
614 619
615 template <typename StaticVisitor> 620 template <typename StaticVisitor>
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 869
865 RelocIterator it(this, mode_mask); 870 RelocIterator it(this, mode_mask);
866 for (; !it.done(); it.next()) { 871 for (; !it.done(); it.next()) {
867 it.rinfo()->template Visit<StaticVisitor>(heap); 872 it.rinfo()->template Visit<StaticVisitor>(heap);
868 } 873 }
869 } 874 }
870 } 875 }
871 } // namespace v8::internal 876 } // namespace v8::internal
872 877
873 #endif // V8_OBJECTS_VISITING_INL_H_ 878 #endif // V8_OBJECTS_VISITING_INL_H_
OLDNEW
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/transitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698