Bug 1057219 - Add write barrier for the owner of COW elements, r=billm.
authorBrian Hackett <bhackett1024@gmail.com>
Tue, 26 Aug 2014 14:12:23 -0700
changeset 223379 9d7eb12460ce38e6a29d4252b00395bca36d7f7f
parent 223378 88a47c075155259bb3dc52ea3920dca83aeb6114
child 223380 91dddb3a870357266e61fe83badf92daefe7428c
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs1057219
milestone34.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 1057219 - Add write barrier for the owner of COW elements, r=billm.
js/src/jsobj.cpp
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -3514,16 +3514,18 @@ JSObject::CopyElementsForWrite(ThreadSaf
     uint32_t allocated = initlen + ObjectElements::VALUES_PER_HEADER;
     uint32_t newAllocated = goodAllocated(allocated);
 
     uint32_t newCapacity = newAllocated - ObjectElements::VALUES_PER_HEADER;
 
     if (newCapacity >= NELEMENTS_LIMIT)
         return false;
 
+    JSObject::writeBarrierPre(obj->getElementsHeader()->ownerObject());
+
     ObjectElements *newheader = AllocateElements(cx, obj, newAllocated);
     if (!newheader)
         return false;
     js_memcpy(newheader, obj->getElementsHeader(),
               (ObjectElements::VALUES_PER_HEADER + initlen) * sizeof(Value));
 
     newheader->capacity = newCapacity;
     newheader->clearCopyOnWrite();