Reviewers: Michael Starzinger,

Message:
PTAL.

Description:
Clear backpointer of non-fast maps that we currently replace when a new non-fast
type is being cached.


Please review this at https://chromiumcodereview.appspot.com/10661025/

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

Affected files:
  M src/objects.cc


Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 78f83c45c98ee2051b4019f47446f1e908705cae..3d883dc4e5459ace497c9a5cfb89c7a37d396566 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -2294,6 +2294,14 @@ MaybeObject* Map::CreateNextElementsTransition(ElementsKind next_kind) {
         this->CopyDropTransitions(DescriptorArray::CANNOT_BE_SHARED);
     if (!maybe_next_map->To(&next_map)) return maybe_next_map;

+ // TODO(verwaest) For now we have to clear the backpointer of the map we + // overwrite. Instead of overwriting we should rather cache all of them.
+    Map* previous_next_map = this->elements_transition_map();
+    if (previous_next_map != NULL) {
+      ASSERT(!IsFastElementsKind(next_kind));
+      ASSERT(!IsFastElementsKind(previous_next_map->elements_kind()));
+      previous_next_map->SetBackPointer(GetHeap()->undefined_value());
+    }
     next_map->set_elements_kind(next_kind);
     next_map->SetBackPointer(this);
     this->set_elements_transition_map(next_map);


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to