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

This commit is contained in:
Sebastian Hengst 2017-07-21 15:18:58 +02:00
Родитель 2ce21e2a22
Коммит a577a1f14f
1 изменённых файлов: 9 добавлений и 21 удалений

Просмотреть файл

@ -1233,7 +1233,9 @@ GlobalHelperThreadState::scheduleCompressionTasks(const AutoLockHelperThreadStat
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);
}
}
@ -1953,7 +1955,12 @@ HelperThread::handleCompressionWorkload(AutoLockHelperThreadState& locked)
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.
@ -1966,25 +1973,6 @@ js::EnqueueOffThreadCompression(JSContext* cx, UniquePtr<SourceCompressionTask>
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);