Reviewers: danno,

Message:
PTAL

Description:
Fix putting of prototype transitions. The length is also subject to GC, just
like entry.

BUG=347536
LOG=n

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

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+2, -1 lines):
  M src/mark-compact.cc
  M src/objects.cc


Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index 4314c9d7217dd952033678469f6ee8c2e78cb268..f5504478036709908462cd0832dd9fa369e5f570 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -2653,6 +2653,7 @@ void MarkCompactCollector::ClearNonLivePrototypeTransitions(Map* map) { Object* prototype = prototype_transitions->get(proto_offset + i * step);
     Object* cached_map = prototype_transitions->get(map_offset + i * step);
     if (IsMarked(prototype) && IsMarked(cached_map)) {
+      ASSERT(!prototype->IsUndefined());
       int proto_index = proto_offset + new_number_of_transitions * step;
       int map_index = map_offset + new_number_of_transitions * step;
       if (new_number_of_transitions != i) {
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 1d7c6726e68199946c951c41d723ebb4121ae8ef..aa6e2808b46d283c5178cbff07f05da6db8ebdbd 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -11559,7 +11559,7 @@ Handle<Map> Map::PutPrototypeTransition(Handle<Map> map,

   cache->set(entry + kProtoTransitionPrototypeOffset, *prototype);
   cache->set(entry + kProtoTransitionMapOffset, *target_map);
-  map->SetNumberOfProtoTransitions(transitions);
+  map->SetNumberOfProtoTransitions(last + 1);

   return map;
 }


--
--
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/groups/opt_out.

Reply via email to