Backed out changeset 217ad633fbf7 (bug 1379146) for failing spidermonkey cgc's js/src/jit-test/tests/debug/inspect-wrapped-promise.js on Linux x64 debug. r=backout on a CLOSED TREE
authorSebastian Hengst <archaeopteryx@coole-files.de>
Fri, 21 Jul 2017 15:18:58 +0200
changeset 418923 94944363e7402c42e1be4ba0092b3de56df45f1c
parent 418922 e7a3ac603f7c6389c60eb70e6a595b2e24858b7f
child 418924 2c1ee57abd493421609a89e40aeb44702859ecc1
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1379146
milestone56.0a1
backs out217ad633fbf7ea7b334c1da31c96248424f1d1dd
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 217ad633fbf7 (bug 1379146) for failing spidermonkey cgc's js/src/jit-test/tests/debug/inspect-wrapped-promise.js on Linux x64 debug. r=backout on a CLOSED TREE
js/src/vm/HelperThreads.cpp
--- a/js/src/vm/HelperThreads.cpp
+++ b/js/src/vm/HelperThreads.cpp
@@ -1228,17 +1228,19 @@ GlobalHelperThreadState::startHandlingCo
 void
 GlobalHelperThreadState::scheduleCompressionTasks(const AutoLockHelperThreadState& lock)
 {
     auto& pending = compressionPendingList(lock);
     auto& worklist = compressionWorklist(lock);
 
     for (size_t i = 0; i < pending.length(); i++) {
         if (pending[i]->shouldStart()) {
-            worklist.infallibleAppend(Move(pending[i]));
+            // OOMing during appending results in the task not being scheduled
+            // and deleted.
+            Unused << worklist.append(Move(pending[i]));
             remove(pending, &i);
         }
     }
 }
 
 bool
 GlobalHelperThreadState::canStartGCHelperTask(const AutoLockHelperThreadState& lock)
 {
@@ -1948,48 +1950,34 @@ HelperThread::handleCompressionWorkload(
         AutoUnlockHelperThreadState unlock(locked);
 
         TraceLoggerThread* logger = TraceLoggerForCurrentThread();
         AutoTraceLog logCompile(logger, TraceLogger_CompressSource);
 
         task->work();
     }
 
-    HelperThreadState().compressionFinishedList(locked).infallibleAppend(Move(task));
+    {
+        AutoEnterOOMUnsafeRegion oomUnsafe;
+        if (!HelperThreadState().compressionFinishedList(locked).append(Move(task)))
+            oomUnsafe.crash("handleCompressionWorkload");
+    }
+
     currentTask.reset();
 
     // Notify the active thread in case it is waiting for the compression to finish.
     HelperThreadState().notifyAll(GlobalHelperThreadState::CONSUMER, locked);
 }
 
 bool
 js::EnqueueOffThreadCompression(JSContext* cx, UniquePtr<SourceCompressionTask> task)
 {
     AutoLockHelperThreadState lock;
 
     auto& pending = HelperThreadState().compressionPendingList(lock);
-
-    // Ensure there is enough space in the vectors to move the task from one
-    // state to another without having OOM on the helper threads.
-    size_t transitionSpace = pending.length() + 1;
-    auto& worklist = HelperThreadState().compressionWorklist(lock);
-    if (!worklist.reserve(worklist.length() + transitionSpace)) {
-        if (!cx->helperThread())
-            ReportOutOfMemory(cx);
-        return false;
-    }
-
-    transitionSpace += worklist.length();
-    auto& finished = HelperThreadState().compressionFinishedList(lock);
-    if (!finished.reserve(finished.length() + transitionSpace)) {
-        if (!cx->helperThread())
-            ReportOutOfMemory(cx);
-        return false;
-    }
-
     if (!pending.append(Move(task))) {
         if (!cx->helperThread())
             ReportOutOfMemory(cx);
         return false;
     }
 
     return true;
 }