Bug 1529298 - Remove the useless OwnsState argument from ArrayBufferObject::setNewData. r=sfink
authorJeff Walden <jwalden@mit.edu>
Wed, 20 Feb 2019 13:33:16 -0800
changeset 519501 713088adfe5f3c60bdb08254b2768c70731db317
parent 519500 a7a39ff0615820e92079562b305e996865e7b56f
child 519502 870a5571096968b606babc8eb1f7c495c18ddf1c
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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 1529298 - Remove the useless OwnsState argument from ArrayBufferObject::setNewData. r=sfink
--- a/js/src/vm/ArrayBufferObject.cpp
+++ b/js/src/vm/ArrayBufferObject.cpp
@@ -514,37 +514,36 @@ static uint8_t* NewCopiedBufferContents(
   if (JSObject* view = buffer->firstView()) {
   if (newContents.data() != buffer->dataPointer()) {
-    buffer->setNewData(cx->runtime()->defaultFreeOp(), newContents, OwnsData);
+    buffer->setNewData(cx->runtime()->defaultFreeOp(), newContents);
-void ArrayBufferObject::setNewData(FreeOp* fop, BufferContents newContents,
-                                   OwnsState ownsState) {
+void ArrayBufferObject::setNewData(FreeOp* fop, BufferContents newContents) {
   if (ownsData()) {
     // XXX As data kinds gradually transition to *all* being owned, this
     //     assertion could become troublesome.  But right *now*, it isn't --
     //     the call just above in ABO::detach occurs only if this assertion is
     //     true, and the call in ABO::changeContents happens only if
     //     ABO::prepareForAsmJS calls ABO::changeContents, but *that* call is
     //     guarded by an owns-data check.  So no need to touch this right now.
     MOZ_ASSERT(newContents.data() != dataPointer());
-  setDataPointer(newContents, ownsState);
+  setDataPointer(newContents, OwnsData);
 // This is called *only* from changeContents(), below.
 // By construction, every view parameter will be mapping unshared memory (an
 // ArrayBuffer). Hence no reason to worry about shared memory here.
 void ArrayBufferObject::changeViewContents(JSContext* cx,
                                            ArrayBufferViewObject* view,
@@ -572,17 +571,17 @@ void ArrayBufferObject::changeViewConten
 // memory.
 void ArrayBufferObject::changeContents(JSContext* cx,
                                        BufferContents newContents) {
   // Change buffer contents.
   uint8_t* oldDataPointer = dataPointer();
-  setNewData(cx->runtime()->defaultFreeOp(), newContents, OwnsData);
+  setNewData(cx->runtime()->defaultFreeOp(), newContents);
   // Update all views.
   auto& innerViews = ObjectRealm::get(this).innerViews.get();
   if (InnerViewTable::ViewVector* views =
           innerViews.maybeViewsUnbarriered(this)) {
     for (size_t i = 0; i < views->length(); i++) {
       JSObject* view = (*views)[i];
       changeViewContents(cx, &view->as<ArrayBufferViewObject>(), oldDataPointer,
--- a/js/src/vm/ArrayBufferObject.h
+++ b/js/src/vm/ArrayBufferObject.h
@@ -365,17 +365,17 @@ class ArrayBufferObject : public ArrayBu
   // later views are (weakly) stored in the compartment's InnerViewTable
   // below. Buffers usually only have one view, so this slot optimizes for
   // the common case. Avoiding entries in the InnerViewTable saves memory and
   // non-incrementalized sweep time.
   JSObject* firstView();
   bool addView(JSContext* cx, JSObject* view);
-  void setNewData(FreeOp* fop, BufferContents newContents, OwnsState ownsState);
+  void setNewData(FreeOp* fop, BufferContents newContents);
   void changeContents(JSContext* cx, BufferContents newContents);
   // Detach this buffer from its original memory.  (This necessarily makes
   // views of this buffer unusable for modifying that original memory.)
   static void detach(JSContext* cx, Handle<ArrayBufferObject*> buffer,
                      BufferContents newContents);