Bug 1529298 - Remove the useless OwnsState argument from ArrayBufferObject::changeContents. r=sfink
authorJeff Walden <jwalden@mit.edu>
Wed, 20 Feb 2019 13:33:16 -0800
changeset 461618 a7a39ff0615820e92079562b305e996865e7b56f
parent 461617 5cb592de5e03d0df8254bbd779d84760b0d16eef
child 461619 713088adfe5f3c60bdb08254b2768c70731db317
push id35626
push usercsabou@mozilla.com
push dateThu, 28 Feb 2019 11:31:08 +0000
treeherdermozilla-central@2ea0c1db7e60 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1529298
milestone67.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 1529298 - Remove the useless OwnsState argument from ArrayBufferObject::changeContents. r=sfink
js/src/vm/ArrayBufferObject.cpp
js/src/vm/ArrayBufferObject.h
--- a/js/src/vm/ArrayBufferObject.cpp
+++ b/js/src/vm/ArrayBufferObject.cpp
@@ -567,23 +567,22 @@ void ArrayBufferObject::changeViewConten
   // Notify compiled jit code that the base pointer has moved.
   MarkObjectStateChange(cx, view);
 }
 
 // BufferContents is specific to ArrayBuffer, hence it will not represent shared
 // memory.
 
 void ArrayBufferObject::changeContents(JSContext* cx,
-                                       BufferContents newContents,
-                                       OwnsState ownsState) {
+                                       BufferContents newContents) {
   MOZ_RELEASE_ASSERT(!isWasm());
 
   // Change buffer contents.
   uint8_t* oldDataPointer = dataPointer();
-  setNewData(cx->runtime()->defaultFreeOp(), newContents, ownsState);
+  setNewData(cx->runtime()->defaultFreeOp(), newContents, OwnsData);
 
   // 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,
@@ -984,17 +983,17 @@ bool js::CreateWasmBuffer(JSContext* cx,
   //     |ownsData()| having changed semantics in this patch doesn't matter
   //     here.
   if (!buffer->ownsData()) {
     uint8_t* data = NewCopiedBufferContents(cx, buffer);
     if (!data) {
       return false;
     }
 
-    buffer->changeContents(cx, BufferContents::createMalloced(data), OwnsData);
+    buffer->changeContents(cx, BufferContents::createMalloced(data));
   }
 
   buffer->setIsPreparedForAsmJS();
   return true;
 }
 
 ArrayBufferObject::BufferContents ArrayBufferObject::createMappedContents(
     int fd, size_t offset, size_t length) {
--- a/js/src/vm/ArrayBufferObject.h
+++ b/js/src/vm/ArrayBufferObject.h
@@ -366,18 +366,17 @@ class ArrayBufferObject : public ArrayBu
   // 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 changeContents(JSContext* cx, BufferContents newContents,
-                      OwnsState ownsState);
+  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);
 
  private:
   void changeViewContents(JSContext* cx, ArrayBufferViewObject* view,