Backed out 1 changesets (bug 1414174) for bustage oom-wasm-streaming.js r=backout a=backout on a CLOSED TREE
authorCsoregi Natalia <ncsoregi@mozilla.com>
Thu, 09 Nov 2017 00:24:30 +0200
changeset 444101 c7095faa0112874e1804e2efad70699e5021eb53
parent 444100 6a828043c22d08207a653e32ebf84e5f5a17ff71
child 444102 7d799a93ed72e65fbf277170eafe45535276c671
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout, backout
bugs1414174
milestone58.0a1
backs outb592e6f5ac17d2868485016fd617d20fd834b50b
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 1 changesets (bug 1414174) for bustage oom-wasm-streaming.js r=backout a=backout on a CLOSED TREE Backed out changeset b592e6f5ac17 (bug 1414174)
js/src/jit-test/tests/wasm/regress/oom-wasm-streaming.js
js/src/wasm/WasmJS.cpp
deleted file mode 100644
--- a/js/src/jit-test/tests/wasm/regress/oom-wasm-streaming.js
+++ /dev/null
@@ -1,6 +0,0 @@
-if (!this.oomAfterAllocations)
-    quit();
-oomAfterAllocations(1, 2);
-var x = wasmTextToBinary('(module (func (export "run") (result i32) i32.const 42))');
-WebAssembly.compileStreaming(x);
-drainJobQueue();
--- a/js/src/wasm/WasmJS.cpp
+++ b/js/src/wasm/WasmJS.cpp
@@ -1844,34 +1844,26 @@ WebAssembly_toSource(JSContext* cx, unsi
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     args.rval().setString(cx->names().WebAssembly);
     return true;
 }
 #endif
 
 static bool
-RejectWithPendingException(JSContext* cx, Handle<PromiseObject*> promise)
-{
-    if (!cx->isExceptionPending())
-        return false;
-
-    RootedValue rejectionValue(cx);
-    if (!GetAndClearException(cx, &rejectionValue))
-        return false;
-
-    return PromiseObject::reject(cx, promise, rejectionValue);
-}
-
-static bool
 Reject(JSContext* cx, const CompileArgs& args, UniqueChars error, Handle<PromiseObject*> promise)
 {
     if (!error) {
         ReportOutOfMemory(cx);
-        return RejectWithPendingException(cx, promise);
+
+        RootedValue rejectionValue(cx);
+        if (!cx->getPendingException(&rejectionValue))
+            return false;
+
+        return PromiseObject::reject(cx, promise, rejectionValue);
     }
 
     RootedObject stack(cx, promise->allocationSite());
     RootedString filename(cx, JS_NewStringCopyZ(cx, args.scriptedCaller.filename.get()));
     if (!filename)
         return false;
 
     unsigned line = args.scriptedCaller.line;
@@ -1893,16 +1885,29 @@ Reject(JSContext* cx, const CompileArgs&
     if (!errorObj)
         return false;
 
     RootedValue rejectionValue(cx, ObjectValue(*errorObj));
     return PromiseObject::reject(cx, promise, rejectionValue);
 }
 
 static bool
+RejectWithPendingException(JSContext* cx, Handle<PromiseObject*> promise)
+{
+    if (!cx->isExceptionPending())
+        return false;
+
+    RootedValue rejectionValue(cx);
+    if (!GetAndClearException(cx, &rejectionValue))
+        return false;
+
+    return PromiseObject::reject(cx, promise, rejectionValue);
+}
+
+static bool
 Resolve(JSContext* cx, Module& module, const CompileArgs& compileArgs,
         Handle<PromiseObject*> promise, bool instantiate, HandleObject importObj)
 {
     RootedObject proto(cx, &cx->global()->getPrototype(JSProto_WasmModule).toObject());
     RootedObject moduleObj(cx, WasmModuleObject::create(cx, module, proto));
     if (!moduleObj)
         return RejectWithPendingException(cx, promise);
 
@@ -2509,17 +2514,17 @@ ResolveResponse(JSContext* cx, CallArgs 
 
     RootedFunction onResolved(cx, NewNativeFunction(cx, ResolveResponse_OnFulfilled, 1, nullptr,
                                                     gc::AllocKind::FUNCTION_EXTENDED));
     if (!onResolved)
         return false;
 
     RootedFunction onRejected(cx, NewNativeFunction(cx, ResolveResponse_OnRejected, 1, nullptr,
                                                     gc::AllocKind::FUNCTION_EXTENDED));
-    if (!onRejected)
+    if (!onResolved)
         return false;
 
     onResolved->setExtendedSlot(0, ObjectValue(*closure));
     onRejected->setExtendedSlot(0, ObjectValue(*closure));
 
     RootedObject resolve(cx, PromiseObject::unforgeableResolve(cx, callArgs.get(0)));
     if (!resolve)
         return false;