зеркало из https://github.com/mozilla/gecko-dev.git
bug 1455210 call CycleCollectedJSContext::Get() only once in EnterDebuggerEventLoop() r=baku
The WorkerJSContext is created and destroyed after entry and before exit from WorkerThreadPrimaryRunnable::Run(). WorkerPrivate::EnterDebuggerEventLoop() is called only while WorkerThreadPrimaryRunnable::Run is on the stack, and so the CycleCollectedJSContext will not change. MozReview-Commit-ID: HMJ8fpKC6E3 --HG-- extra : rebase_source : d481f4513f9e5ed29224ce01534fa3de95bc7ae4
This commit is contained in:
Родитель
8768dc6854
Коммит
c4ee57e5e6
|
@ -4402,6 +4402,7 @@ WorkerPrivate::EnterDebuggerEventLoop()
|
||||||
|
|
||||||
JSContext* cx = GetJSContext();
|
JSContext* cx = GetJSContext();
|
||||||
MOZ_ASSERT(cx);
|
MOZ_ASSERT(cx);
|
||||||
|
CycleCollectedJSContext* ccjscx = CycleCollectedJSContext::Get();
|
||||||
|
|
||||||
uint32_t currentEventLoopLevel = ++mDebuggerEventLoopLevel;
|
uint32_t currentEventLoopLevel = ++mDebuggerEventLoopLevel;
|
||||||
|
|
||||||
|
@ -4424,9 +4425,8 @@ WorkerPrivate::EnterDebuggerEventLoop()
|
||||||
{
|
{
|
||||||
MutexAutoLock lock(mMutex);
|
MutexAutoLock lock(mMutex);
|
||||||
|
|
||||||
CycleCollectedJSContext* context = CycleCollectedJSContext::Get();
|
|
||||||
std::queue<RefPtr<MicroTaskRunnable>>& debuggerMtQueue =
|
std::queue<RefPtr<MicroTaskRunnable>>& debuggerMtQueue =
|
||||||
context->GetDebuggerMicroTaskQueue();
|
ccjscx->GetDebuggerMicroTaskQueue();
|
||||||
while (mControlQueue.IsEmpty() &&
|
while (mControlQueue.IsEmpty() &&
|
||||||
!(debuggerRunnablesPending = !mDebuggerQueue.IsEmpty()) &&
|
!(debuggerRunnablesPending = !mDebuggerQueue.IsEmpty()) &&
|
||||||
debuggerMtQueue.empty()) {
|
debuggerMtQueue.empty()) {
|
||||||
|
@ -4437,8 +4437,7 @@ WorkerPrivate::EnterDebuggerEventLoop()
|
||||||
|
|
||||||
// XXXkhuey should we abort JS on the stack here if we got Abort above?
|
// XXXkhuey should we abort JS on the stack here if we got Abort above?
|
||||||
}
|
}
|
||||||
CycleCollectedJSContext* context = CycleCollectedJSContext::Get();
|
ccjscx->PerformDebuggerMicroTaskCheckpoint();
|
||||||
context->PerformDebuggerMicroTaskCheckpoint();
|
|
||||||
if (debuggerRunnablesPending) {
|
if (debuggerRunnablesPending) {
|
||||||
// Start the periodic GC timer if it is not already running.
|
// Start the periodic GC timer if it is not already running.
|
||||||
SetGCTimerMode(PeriodicTimer);
|
SetGCTimerMode(PeriodicTimer);
|
||||||
|
@ -4455,8 +4454,7 @@ WorkerPrivate::EnterDebuggerEventLoop()
|
||||||
static_cast<nsIRunnable*>(runnable)->Run();
|
static_cast<nsIRunnable*>(runnable)->Run();
|
||||||
runnable->Release();
|
runnable->Release();
|
||||||
|
|
||||||
CycleCollectedJSContext* ccjs = CycleCollectedJSContext::Get();
|
ccjscx->PerformDebuggerMicroTaskCheckpoint();
|
||||||
ccjs->PerformDebuggerMicroTaskCheckpoint();
|
|
||||||
|
|
||||||
// Now *might* be a good time to GC. Let the JS engine make the decision.
|
// Now *might* be a good time to GC. Let the JS engine make the decision.
|
||||||
if (JS::CurrentGlobalOrNull(cx)) {
|
if (JS::CurrentGlobalOrNull(cx)) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче