Bug 1674777 part 13 - Remove deprecatedGetUint32. r=lth
authorJan de Mooij <jdemooij@mozilla.com>
Wed, 10 Feb 2021 11:23:01 +0000
changeset 566802 f34c46915ae1e025a9706ba6f1388ad516c9543f
parent 566801 a5b7b61ae1480501748963bb85ee2ddcab86df83
child 566803 6bdd497670799f09a49875dcd3cfde515740b691
push id38190
push userbtara@mozilla.com
push dateWed, 10 Feb 2021 21:50:51 +0000
treeherdermozilla-central@569826c0fd47 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslth
bugs1674777
milestone87.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 1674777 part 13 - Remove deprecatedGetUint32. r=lth Also change wasmMaxSize and wasmMappedSize to use 'get' instead of 'deprecatedGetUint32'. Differential Revision: https://phabricator.services.mozilla.com/D104054
js/src/vm/ArrayBufferObject.cpp
js/src/vm/ArrayBufferObject.h
--- a/js/src/vm/ArrayBufferObject.cpp
+++ b/js/src/vm/ArrayBufferObject.cpp
@@ -980,31 +980,31 @@ void ArrayBufferObject::setByteLength(Bu
   MOZ_ASSERT(length.get() <= maxBufferByteLength());
   setFixedSlot(BYTE_LENGTH_SLOT, PrivateValue(length.get()));
 }
 
 size_t ArrayBufferObject::wasmMappedSize() const {
   if (isWasm()) {
     return contents().wasmBuffer()->mappedSize();
   }
-  return byteLength().deprecatedGetUint32();
+  return byteLength().get();
 }
 
 size_t js::WasmArrayBufferMappedSize(const ArrayBufferObjectMaybeShared* buf) {
   if (buf->is<ArrayBufferObject>()) {
     return buf->as<ArrayBufferObject>().wasmMappedSize();
   }
   return buf->as<SharedArrayBufferObject>().wasmMappedSize();
 }
 
 Maybe<uint64_t> ArrayBufferObject::wasmMaxSize() const {
   if (isWasm()) {
     return contents().wasmBuffer()->maxSize();
   }
-  return Some<uint64_t>(byteLength().deprecatedGetUint32());
+  return Some<uint64_t>(byteLength().get());
 }
 
 Maybe<uint64_t> js::WasmArrayBufferMaxSize(
     const ArrayBufferObjectMaybeShared* buf) {
   if (buf->is<ArrayBufferObject>()) {
     return buf->as<ArrayBufferObject>().wasmMaxSize();
   }
   return buf->as<SharedArrayBufferObject>().wasmMaxSize();
--- a/js/src/vm/ArrayBufferObject.h
+++ b/js/src/vm/ArrayBufferObject.h
@@ -112,23 +112,16 @@ size_t WasmArrayBufferMappedSize(const A
 // Class wrapping an ArrayBuffer or ArrayBufferView byte offset or length.
 class BufferSize {
   size_t size_ = 0;
 
  public:
   explicit BufferSize(size_t size) : size_(size) {}
 
   size_t get() const { return size_; }
-
-  // For consumers that still need to be audited or changed to support large
-  // buffers.
-  uint32_t deprecatedGetUint32() const {
-    MOZ_ASSERT(size_ <= INT32_MAX);
-    return size_;
-  }
 };
 
 class ArrayBufferObjectMaybeShared : public NativeObject {
  public:
   inline BufferSize byteLength() const;
   inline bool isDetached() const;
   inline SharedMem<uint8_t*> dataPointerEither();