Bug 650161 - Fix compacting GC build errors following JSObject changes r=terrence
☠☠ backed out by beed46f2f2bd ☠ ☠
authorJon Coppeard <jcoppeard@mozilla.com>
Mon, 06 Oct 2014 17:49:45 +0100
changeset 209029 6d73cc06f9fed9512dd0cd2d531ff1445071679c
parent 209028 31d28b1d4d7e99f08dd4ff541a95fd17db4f5f49
child 209030 a19ccad6a93485444b44e806d95310a40a5a3776
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersterrence
bugs650161
milestone35.0a1
Bug 650161 - Fix compacting GC build errors following JSObject changes r=terrence
js/src/jsgc.cpp
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -2193,25 +2193,26 @@ RelocateCell(Zone *zone, TenuredCell *sr
     // Copy source cell contents to destination.
     memcpy(dst, src, thingSize);
 
     if (thingKind <= FINALIZE_OBJECT_LAST) {
         JSObject *srcObj = static_cast<JSObject *>(static_cast<Cell *>(src));
         JSObject *dstObj = static_cast<JSObject *>(static_cast<Cell *>(dst));
 
         // Fixup the pointer to inline object elements if necessary.
-        if (srcObj->hasFixedElements())
-            dstObj->setFixedElements();
+        if (srcObj->isNative() && srcObj->as<NativeObject>().hasFixedElements())
+            dstObj->as<NativeObject>().setFixedElements();
 
         // Call object moved hook if present.
         if (JSObjectMovedOp op = srcObj->getClass()->ext.objectMovedOp)
             op(dstObj, srcObj);
 
         MOZ_ASSERT_IF(dstObj->isNative(),
-                      !PtrIsInRange((const Value*)dstObj->getDenseElements(), src, thingSize));
+                      !PtrIsInRange((const Value*)dstObj->as<NativeObject>().getDenseElements(),
+                                    src, thingSize));
     }
 
     // Copy the mark bits.
     dst->copyMarkBitsFrom(src);
 
     // Mark source cell as forwarded and leave a pointer to the destination.
     RelocationOverlay* overlay = RelocationOverlay::fromCell(src);
     overlay->forwardTo(dst);