Bug 1283616 - part 1 - micro-optimize removing microtask runnables from the queue; r=khuey

We can just extract the reference we want from the queue since we're
about to remove it; no sense in performing extra refcounting if we don't
need to.
This commit is contained in:
Nathan Froyd 2016-07-05 18:49:06 -04:00
Родитель 68e49f6d48
Коммит 985851ccca
1 изменённых файлов: 3 добавлений и 3 удалений

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

@ -995,7 +995,7 @@ Promise::PerformMicroTaskCheckpoint()
AutoSafeJSContext cx;
do {
nsCOMPtr<nsIRunnable> runnable = microtaskQueue.front();
nsCOMPtr<nsIRunnable> runnable = microtaskQueue.front().forget();
MOZ_ASSERT(runnable);
// This function can re-enter, so we remove the element before calling.
@ -1032,7 +1032,7 @@ Promise::PerformWorkerMicroTaskCheckpoint()
}
}
nsCOMPtr<nsIRunnable> runnable = microtaskQueue->front();
nsCOMPtr<nsIRunnable> runnable = microtaskQueue->front().forget();
MOZ_ASSERT(runnable);
// This function can re-enter, so we remove the element before calling.
@ -1062,7 +1062,7 @@ Promise::PerformWorkerDebuggerMicroTaskCheckpoint()
break;
}
nsCOMPtr<nsIRunnable> runnable = microtaskQueue->front();
nsCOMPtr<nsIRunnable> runnable = microtaskQueue->front().forget();
MOZ_ASSERT(runnable);
// This function can re-enter, so we remove the element before calling.