Bug 730452 - Trigger post barriers on moveDenseArrayElements; r=billm
authorTerrence Cole <terrence@mozilla.com>
Thu, 05 Apr 2012 17:56:53 -0700
changeset 94453 e8fb716946e00537197ff02a051b9e440fe41e86
parent 94452 1caaf6428d93af8d09447952ed4e1b4e729d8bdf
child 94454 9259d8ea774b3319f53bfb39ace00ec071bc5edb
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs730452
milestone14.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 730452 - Trigger post barriers on moveDenseArrayElements; r=billm We cannot do this per-element because it is too slow. Instead we have a special storebuffer entry for this case so we can do all work at gc time.
js/src/gc/Barrier.h
js/src/jsobjinlines.h
--- a/js/src/gc/Barrier.h
+++ b/js/src/gc/Barrier.h
@@ -390,16 +390,27 @@ class HeapSlot : public EncapsulatedValu
     static inline void writeBarrierPost(JSObject *obj, uint32_t slot);
     static inline void writeBarrierPost(JSCompartment *comp, JSObject *obj, uint32_t slotno);
 
   private:
     inline void post(JSObject *owner, uint32_t slot);
     inline void post(JSCompartment *comp, JSObject *owner, uint32_t slot);
 };
 
+/*
+ * NOTE: This is a placeholder for bug 619558.
+ *
+ * Run a post write barrier that encompasses multiple contiguous slots in a
+ * single step.
+ */
+static inline void
+SlotRangeWriteBarrierPost(JSCompartment *comp, JSObject *obj, uint32_t start, uint32_t count)
+{
+}
+
 static inline const Value *
 Valueify(const EncapsulatedValue *array)
 {
     JS_STATIC_ASSERT(sizeof(HeapValue) == sizeof(Value));
     JS_STATIC_ASSERT(sizeof(HeapSlot) == sizeof(Value));
     return (const Value *)array;
 }
 
--- a/js/src/jsobjinlines.h
+++ b/js/src/jsobjinlines.h
@@ -506,16 +506,17 @@ JSObject::moveDenseArrayElements(unsigne
         } else {
             js::HeapSlot *dst = elements + dstStart + count - 1;
             js::HeapSlot *src = elements + srcStart + count - 1;
             for (unsigned i = 0; i < count; i++, dst--, src--)
                 dst->set(comp, this, dst - elements, *src);
         }
     } else {
         memmove(elements + dstStart, elements + srcStart, count * sizeof(js::HeapSlot));
+        SlotRangeWriteBarrierPost(comp, this, dstStart, count);
     }
 }
 
 inline void
 JSObject::moveDenseArrayElementsUnbarriered(unsigned dstStart, unsigned srcStart, unsigned count)
 {
     JS_ASSERT(!compartment()->needsBarrier());