Backed out changeset f7c32e7abf72 (bug 1498458) for causing SM build bustages on oom-allocating-arraybuffer-contents.
authorCosmin Sabou <csabou@mozilla.com>
Sat, 13 Oct 2018 04:51:18 +0300
changeset 499549 3ee73bef9537d1d2f09d397150238523be4f6891
parent 499548 22f5c9171d258adadc703aca664bbca476fa441a
child 499550 2aede0d5656f05304e2a584cabd0ce9c0337723f
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1498458
milestone64.0a1
backs outf7c32e7abf7293b99c6d1941af6e15ebc3119d5c
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
Backed out changeset f7c32e7abf72 (bug 1498458) for causing SM build bustages on oom-allocating-arraybuffer-contents.
js/src/jit-test/tests/typedarray/oom-allocating-arraybuffer-contents.js
js/src/vm/ArrayBufferObject.cpp
deleted file mode 100644
--- a/js/src/jit-test/tests/typedarray/oom-allocating-arraybuffer-contents.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// |jit-test| skip-if: !('oomTest' in this)
-
-oomTest(function test() {
-  // The original missing OOM check was after failure to allocate ArrayBuffer
-  // contents, in the ctor call -- the particular operations after that aren't
-  // important.
-  new Uint8ClampedArray(256).toLocaleString('hi');
-});
--- a/js/src/vm/ArrayBufferObject.cpp
+++ b/js/src/vm/ArrayBufferObject.cpp
@@ -458,17 +458,18 @@ ArrayBufferObject::class_constructor(JSC
     }
     args.rval().setObject(*bufobj);
     return true;
 }
 
 static ArrayBufferObject::BufferContents
 AllocateArrayBufferContents(JSContext* cx, uint32_t nbytes)
 {
-    uint8_t* p = cx->pod_callocCanGC<uint8_t>(nbytes, js::ArrayBufferContentsArena);
+    uint8_t* p = cx->pod_callocCanGC<uint8_t>(nbytes,
+                                                      js::ArrayBufferContentsArena);
     return ArrayBufferObject::BufferContents::create<ArrayBufferObject::PLAIN>(p);
 }
 
 static void
 NoteViewBufferWasDetached(ArrayBufferViewObject* view,
                           ArrayBufferObject::BufferContents newContents,
                           JSContext* cx)
 {
@@ -1244,17 +1245,16 @@ ArrayBufferObject::create(JSContext* cx,
         if (nbytes <= usableSlots * sizeof(Value)) {
             int newSlots = JS_HOWMANY(nbytes, sizeof(Value));
             MOZ_ASSERT(int(nbytes) <= newSlots * int(sizeof(Value)));
             nslots = reservedSlots + newSlots;
             contents = BufferContents::createPlain(nullptr);
         } else {
             contents = AllocateArrayBufferContents(cx, nbytes);
             if (!contents) {
-                ReportOutOfMemory(cx);
                 return nullptr;
             }
             allocated = true;
         }
     }
 
     MOZ_ASSERT(!(class_.flags & JSCLASS_HAS_PRIVATE));
     gc::AllocKind allocKind = gc::GetGCObjectKind(nslots);