зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
68e49f6d48
Коммит
985851ccca
|
@ -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.
|
||||
|
|
Загрузка…
Ссылка в новой задаче