Backed out changeset 208bcb7879c0 (bug 995982) for mochitest-1 assertions on a CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Wed, 23 Apr 2014 16:19:43 -0700
changeset 180224 2e62324ea929e71b0ae3e3a29cb722efd958e1a8
parent 180223 fd7fa6a10e3acaa2ad3ace5994110fbdd11b603c
child 180225 c3954977ec6288a3d79d497cfc756ad0f60f1bbb
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
bugs995982
milestone31.0a1
backs out208bcb7879c00c6143b190a63ecaff5d6ed12b81
Backed out changeset 208bcb7879c0 (bug 995982) for mochitest-1 assertions on a CLOSED TREE
js/src/gc/Nursery.cpp
js/src/gc/Nursery.h
js/src/vm/TypedArrayObject.h
--- a/js/src/gc/Nursery.cpp
+++ b/js/src/gc/Nursery.cpp
@@ -405,22 +405,16 @@ js::Nursery::setElementsForwardingPointe
      */
     if (nelems - ObjectElements::VALUES_PER_HEADER < 1)
         return;
     JS_ASSERT(isInside(oldHeader));
     JS_ASSERT(!isInside(newHeader));
     *reinterpret_cast<HeapSlot **>(oldHeader->elements()) = newHeader->elements();
 }
 
-void
-js::Nursery::setTypedArrayElementsForwardingPointer(void *oldData, void *newData)
-{
-    *reinterpret_cast<void **>(oldData) = newData;
-}
-
 #ifdef DEBUG
 static bool IsWriteableAddress(void *ptr)
 {
     volatile uint64_t *vPtr = reinterpret_cast<volatile uint64_t *>(ptr);
     *vPtr = *vPtr;
     return true;
 }
 #endif
@@ -567,25 +561,18 @@ js::Nursery::moveObjectToTenured(JSObjec
      */
     if (src->is<ArrayObject>())
         srcSize = sizeof(ObjectImpl);
 
     js_memcpy(dst, src, srcSize);
     tenuredSize += moveSlotsToTenured(dst, src, dstKind);
     tenuredSize += moveElementsToTenured(dst, src, dstKind);
 
-    if (src->is<TypedArrayObject>()) {
-        void *oldData = dst->getPrivate();
-        JS_ASSERT(isInside(oldData) == (oldData == src->fixedData(TypedArrayObject::FIXED_DATA_START)));
-        if (isInside(oldData)) {
-            void *newData = dst->fixedData(TypedArrayObject::FIXED_DATA_START);
-            dst->setPrivate(newData);
-            setTypedArrayElementsForwardingPointer(oldData, newData);
-        }
-    }
+    if (src->is<TypedArrayObject>())
+        dst->setPrivate(dst->fixedData(TypedArrayObject::FIXED_DATA_START));
 
     /* The shape's list head may point into the old object. */
     if (&src->shape_ == dst->shape_->listp)
         dst->shape_->listp = &dst->shape_;
 
     return tenuredSize;
 }
 
--- a/js/src/gc/Nursery.h
+++ b/js/src/gc/Nursery.h
@@ -271,17 +271,16 @@ class Nursery
     size_t moveObjectToTenured(JSObject *dst, JSObject *src, gc::AllocKind dstKind);
     size_t moveElementsToTenured(JSObject *dst, JSObject *src, gc::AllocKind dstKind);
     size_t moveSlotsToTenured(JSObject *dst, JSObject *src, gc::AllocKind dstKind);
 
     /* Handle relocation of slots/elements pointers stored in Ion frames. */
     void setSlotsForwardingPointer(HeapSlot *oldSlots, HeapSlot *newSlots, uint32_t nslots);
     void setElementsForwardingPointer(ObjectElements *oldHeader, ObjectElements *newHeader,
                                       uint32_t nelems);
-    void setTypedArrayElementsForwardingPointer(void *oldData, void *newData);
 
     /* Free malloced pointers owned by freed things in the nursery. */
     void freeHugeSlots(JSRuntime *rt);
 
     /*
      * Frees all non-live nursery-allocated things at the end of a minor
      * collection.
      */
--- a/js/src/vm/TypedArrayObject.h
+++ b/js/src/vm/TypedArrayObject.h
@@ -46,21 +46,17 @@ class TypedArrayObject : public ArrayBuf
     // object is created lazily.
     static const uint32_t INLINE_BUFFER_LIMIT =
         (JSObject::MAX_FIXED_SLOTS - FIXED_DATA_START) * sizeof(Value);
 
     static gc::AllocKind
     AllocKindForLazyBuffer(size_t nbytes)
     {
         JS_ASSERT(nbytes <= INLINE_BUFFER_LIMIT);
-
-        // Make sure there is space for at least one slot, for forwarding
-        // pointers during nursery collection.
-        int dataSlots = Max<int>(1, (int) (nbytes - 1) / sizeof(Value) + 1);
-
+        int dataSlots = (nbytes - 1) / sizeof(Value) + 1;
         JS_ASSERT(int(nbytes) <= dataSlots * int(sizeof(Value)));
         return gc::GetGCObjectKind(FIXED_DATA_START + dataSlots);
     }
 
     static Value bufferValue(TypedArrayObject *tarr) {
         return tarr->getFixedSlot(BUFFER_SLOT);
     }
     static Value byteOffsetValue(TypedArrayObject *tarr) {