Bug 1573817: Remove unused parameter in Instance::onMovingGrowMemory; r=luke
authorBenjamin Bouvier <benj@benj.me>
Wed, 14 Aug 2019 18:54:30 +0000
changeset 488476 15048bfaf5ef435586ad0b5591f4c828c6b4d857
parent 488475 6c29bc2d08060ae872e5b5532ee67a69f5a5e23c
child 488477 61d898c2b4445f0a10c6d8b618e0dc13519642ce
push id36444
push userccoroiu@mozilla.com
push dateFri, 16 Aug 2019 16:24:18 +0000
treeherdermozilla-central@8a9e9189cd98 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs1573817
milestone70.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 1573817: Remove unused parameter in Instance::onMovingGrowMemory; r=luke Differential Revision: https://phabricator.services.mozilla.com/D41969
js/src/wasm/WasmInstance.cpp
js/src/wasm/WasmInstance.h
js/src/wasm/WasmJS.cpp
--- a/js/src/wasm/WasmInstance.cpp
+++ b/js/src/wasm/WasmInstance.cpp
@@ -1883,17 +1883,17 @@ JSAtom* Instance::getFuncDisplayAtom(JSC
 
   return AtomizeUTF8Chars(cx, name.begin(), name.length());
 }
 
 void Instance::ensureProfilingLabels(bool profilingEnabled) const {
   return code_->ensureProfilingLabels(profilingEnabled);
 }
 
-void Instance::onMovingGrowMemory(uint8_t* prevMemoryBase) {
+void Instance::onMovingGrowMemory() {
   MOZ_ASSERT(!isAsmJS());
   MOZ_ASSERT(!memory_->isShared());
 
   ArrayBufferObject& buffer = memory_->buffer().as<ArrayBufferObject>();
   tlsData()->memoryBase = buffer.dataPointer();
   tlsData()->boundsCheckLimit = buffer.wasmBoundsCheckLimit();
 }
 
--- a/js/src/wasm/WasmInstance.h
+++ b/js/src/wasm/WasmInstance.h
@@ -151,17 +151,17 @@ class Instance {
   // match up, callImport will patch the code to instead call through a thunk
   // directly into the JIT code. If the JIT code is released, the Instance must
   // be notified so it can go back to the generic callImport.
 
   void deoptimizeImportExit(uint32_t funcImportIndex);
 
   // Called by Wasm(Memory|Table)Object when a moving resize occurs:
 
-  void onMovingGrowMemory(uint8_t* prevMemoryBase);
+  void onMovingGrowMemory();
   void onMovingGrowTable(const Table* theTable);
 
   // Called to apply a single ElemSegment at a given offset, assuming
   // that all bounds validation has already been performed.
 
   void initElems(uint32_t tableIndex, const ElemSegment& seg,
                  uint32_t dstOffset, uint32_t srcOffset, uint32_t len);
 
--- a/js/src/wasm/WasmJS.cpp
+++ b/js/src/wasm/WasmJS.cpp
@@ -1888,17 +1888,16 @@ uint32_t WasmMemoryObject::grow(HandleWa
   CheckedInt<uint32_t> newSize = oldNumPages;
   newSize += delta;
   newSize *= PageSize;
   if (!newSize.isValid()) {
     return -1;
   }
 
   RootedArrayBufferObject newBuf(cx);
-  uint8_t* prevMemoryBase = nullptr;
 
   if (Maybe<uint32_t> maxSize = oldBuf->wasmMaxSize()) {
     if (newSize.value() > maxSize.value()) {
       return -1;
     }
 
     if (!ArrayBufferObject::wasmGrowToSizeInPlace(newSize.value(), oldBuf,
                                                   &newBuf, cx)) {
@@ -1907,33 +1906,31 @@ uint32_t WasmMemoryObject::grow(HandleWa
   } else {
 #ifdef WASM_HUGE_MEMORY
     if (!ArrayBufferObject::wasmGrowToSizeInPlace(newSize.value(), oldBuf,
                                                   &newBuf, cx)) {
       return -1;
     }
 #else
     MOZ_ASSERT(memory->movingGrowable());
-    prevMemoryBase = oldBuf->dataPointer();
     if (!ArrayBufferObject::wasmMovingGrowToSize(newSize.value(), oldBuf,
                                                  &newBuf, cx)) {
       return -1;
     }
 #endif
   }
 
   memory->setReservedSlot(BUFFER_SLOT, ObjectValue(*newBuf));
 
   // Only notify moving-grow-observers after the BUFFER_SLOT has been updated
   // since observers will call buffer().
   if (memory->hasObservers()) {
-    MOZ_ASSERT(prevMemoryBase);
     for (InstanceSet::Range r = memory->observers().all(); !r.empty();
          r.popFront()) {
-      r.front()->instance().onMovingGrowMemory(prevMemoryBase);
+      r.front()->instance().onMovingGrowMemory();
     }
   }
 
   return oldNumPages;
 }
 
 bool js::wasm::IsSharedWasmMemoryObject(JSObject* obj) {
   WasmMemoryObject* mobj = obj->maybeUnwrapIf<WasmMemoryObject>();