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

Unified Diff: src/heap/objects-visiting-inl.h

Issue 982143002: Revert of Simplify and compact transitions storage (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/hydrogen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/objects-visiting-inl.h
diff --git a/src/heap/objects-visiting-inl.h b/src/heap/objects-visiting-inl.h
index b4240d2a491e44be26f4e8fbb6bda132953e8bc1..58afeae0167dd7aedbdbbc70ff6b3b6d9fb579f8 100644
--- a/src/heap/objects-visiting-inl.h
+++ b/src/heap/objects-visiting-inl.h
@@ -584,13 +584,18 @@
template <typename StaticVisitor>
void StaticMarkingVisitor<StaticVisitor>::MarkMapContents(Heap* heap,
Map* map) {
- Object* raw_transitions = map->raw_transitions();
- if (TransitionArray::IsSimpleTransition(raw_transitions)) {
- StaticVisitor::VisitPointer(
- heap, HeapObject::RawField(map, Map::kTransitionsOffset));
- }
- if (TransitionArray::IsFullTransitionArray(raw_transitions)) {
- MarkTransitionArray(heap, TransitionArray::cast(raw_transitions));
+ // Make sure that the back pointer stored either in the map itself or
+ // inside its transitions array is marked. Skip recording the back
+ // pointer slot since map space is not compacted.
+ StaticVisitor::MarkObject(heap, HeapObject::cast(map->GetBackPointer()));
+
+ // Treat pointers in the transitions array as weak and also mark that
+ // array to prevent visiting it later. Skip recording the transition
+ // array slot, since it will be implicitly recorded when the pointer
+ // fields of this map are visited.
+ if (map->HasTransitionArray()) {
+ TransitionArray* transitions = map->transitions();
+ MarkTransitionArray(heap, transitions);
}
// Since descriptor arrays are potentially shared, ensure that only the
@@ -626,18 +631,20 @@
Heap* heap, TransitionArray* transitions) {
if (!StaticVisitor::MarkObjectWithoutPush(heap, transitions)) return;
+ // Simple transitions do not have keys nor prototype transitions.
+ if (transitions->IsSimpleTransition()) return;
+
if (transitions->HasPrototypeTransitions()) {
// Mark prototype transitions array but do not push it onto marking
// stack, this will make references from it weak. We will clean dead
- // prototype transitions in ClearNonLiveReferences.
+ // prototype transitions in ClearNonLiveTransitions.
Object** slot = transitions->GetPrototypeTransitionsSlot();
HeapObject* obj = HeapObject::cast(*slot);
heap->mark_compact_collector()->RecordSlot(slot, slot, obj);
StaticVisitor::MarkObjectWithoutPush(heap, obj);
}
- int num_transitions = TransitionArray::NumberOfTransitions(transitions);
- for (int i = 0; i < num_transitions; ++i) {
+ for (int i = 0; i < transitions->number_of_transitions(); ++i) {
StaticVisitor::VisitPointer(heap, transitions->GetKeySlot(i));
}
}
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698