mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-15 21:36:20 +00:00
Bug 1506733 - (part 2) Refactor how the NurseryDecomitter finishes r=jonco
This refactoring is required for the next change. Differential Revision: https://phabricator.services.mozilla.com/D35590 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
070151d46c
commit
112005db9e
@ -108,13 +108,9 @@ void js::NurseryDecommitTask::queueChunk(
|
||||
queue = chunk;
|
||||
}
|
||||
|
||||
Chunk* js::NurseryDecommitTask::popChunk() {
|
||||
AutoLockHelperThreadState lock;
|
||||
|
||||
Chunk* js::NurseryDecommitTask::popChunk(
|
||||
const AutoLockHelperThreadState& lock) {
|
||||
if (!queue) {
|
||||
// We call setFinishing here while we have the lock that checks for work,
|
||||
// rather than in run's loop.
|
||||
setFinishing(lock);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -128,8 +124,15 @@ Chunk* js::NurseryDecommitTask::popChunk() {
|
||||
void js::NurseryDecommitTask::run() {
|
||||
Chunk* chunk;
|
||||
|
||||
while ((chunk = popChunk())) {
|
||||
decommitChunk(chunk);
|
||||
{
|
||||
AutoLockHelperThreadState lock;
|
||||
|
||||
while ((chunk = popChunk(lock))) {
|
||||
AutoUnlockHelperThreadState unlock(lock);
|
||||
decommitChunk(chunk);
|
||||
}
|
||||
|
||||
setFinishing(lock);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ class NurseryDecommitTask : public GCParallelTaskHelper<NurseryDecommitTask> {
|
||||
// Use the next pointers in Chunk::info to form a singly-linked list.
|
||||
MainThreadOrGCTaskData<gc::Chunk*> queue;
|
||||
|
||||
gc::Chunk* popChunk();
|
||||
gc::Chunk* popChunk(const AutoLockHelperThreadState& lock);
|
||||
};
|
||||
|
||||
class TenuringTracer : public JSTracer {
|
||||
|
Loading…
x
Reference in New Issue
Block a user