Bug 1148922 - Handle insertion of new initial shapes via the metadata callback, r=luke.
authorBrian Hackett <bhackett1024@gmail.com>
Mon, 06 Apr 2015 12:54:53 -0600
changeset 267654 2d4ffc399da1729802ddbb4640cf008695870f44
parent 267653 7af97d940d5178848522f75c4269b18dc6152725
child 267655 6441783352b40c52fcb95a589fd32e0882e1ddfa
push id4830
push userjlund@mozilla.com
push dateMon, 29 Jun 2015 20:18:48 +0000
treeherdermozilla-beta@4c2175bb0420 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs1148922
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1148922 - Handle insertion of new initial shapes via the metadata callback, r=luke.
js/src/vm/Shape.cpp
--- a/js/src/vm/Shape.cpp
+++ b/js/src/vm/Shape.cpp
@@ -1498,16 +1498,20 @@ EmptyShape::insertInitialShape(Exclusive
     InitialShapeEntry::Lookup lookup(shape->getObjectClass(), TaggedProto(proto),
                                      shape->numFixedSlots(), shape->getObjectFlags());
 
     InitialShapeSet::Ptr p = cx->compartment()->initialShapes.lookup(lookup);
     MOZ_ASSERT(p);
 
     InitialShapeEntry& entry = const_cast<InitialShapeEntry&>(*p);
 
+    // The metadata callback can end up causing redundant changes of the initial shape.
+    if (entry.shape == shape)
+        return;
+
     /* The new shape had better be rooted at the old one. */
 #ifdef DEBUG
     Shape* nshape = shape;
     while (!nshape->isEmptyShape())
         nshape = nshape->previous();
     MOZ_ASSERT(nshape == entry.shape);
 #endif