Reviewers: ulan,

Message:
ptal

Description:
Always mark entire prototype descriptor arrays.

BUG=chromium:506952
LOG=n

Please review this at https://codereview.chromium.org/1226783002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+22, -16 lines):
  M src/heap/objects-visiting-inl.h


Index: src/heap/objects-visiting-inl.h
diff --git a/src/heap/objects-visiting-inl.h b/src/heap/objects-visiting-inl.h index ed6db7b9b4b5f7924f716ab44136f7f0b79881c6..d6a9d2ba308c9420493a8a4d2d4c9bc78f41e777 100644
--- a/src/heap/objects-visiting-inl.h
+++ b/src/heap/objects-visiting-inl.h
@@ -542,23 +542,29 @@ void StaticMarkingVisitor<StaticVisitor>::MarkMapContents(Heap* heap,
     MarkTransitionArray(heap, TransitionArray::cast(raw_transitions));
   }

-  // Since descriptor arrays are potentially shared, ensure that only the
-  // descriptors that belong to this map are marked. The first time a
- // non-empty descriptor array is marked, its header is also visited. The slot - // holding the descriptor array will be implicitly recorded when the pointer
-  // fields of this map are visited.
   DescriptorArray* descriptors = map->instance_descriptors();
-  if (StaticVisitor::MarkObjectWithoutPush(heap, descriptors) &&
-      descriptors->length() > 0) {
- StaticVisitor::VisitPointers(heap, descriptors->GetFirstElementAddress(),
-                                 descriptors->GetDescriptorEndSlot(0));
-  }
-  int start = 0;
-  int end = map->NumberOfOwnDescriptors();
-  if (start < end) {
-    StaticVisitor::VisitPointers(heap,
- descriptors->GetDescriptorStartSlot(start),
-                                 descriptors->GetDescriptorEndSlot(end));
+  if (map->is_prototype_map()) {
+ // Prototype maps don't keep track of transitions, so just mark the entire
+    // descriptor array.
+    StaticVisitor::MarkObject(heap, descriptors);
+  } else {
+    // Since descriptor arrays are potentially shared, ensure that only the
+    // descriptors that belong to this map are marked. The first time a
+ // non-empty descriptor array is marked, its header is also visited. The + // slot holding the descriptor array will be implicitly recorded when the
+    // pointer fields of this map are visited.
+    if (StaticVisitor::MarkObjectWithoutPush(heap, descriptors) &&
+        descriptors->length() > 0) {
+ StaticVisitor::VisitPointers(heap, descriptors->GetFirstElementAddress(),
+                                   descriptors->GetDescriptorEndSlot(0));
+    }
+    int start = 0;
+    int end = map->NumberOfOwnDescriptors();
+    if (start < end) {
+      StaticVisitor::VisitPointers(heap,
+ descriptors->GetDescriptorStartSlot(start),
+                                   descriptors->GetDescriptorEndSlot(end));
+    }
   }

   // Mark the pointer fields of the Map. Since the transitions array has


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to