void get(Phase* phase, size_t* dagSlot, size_t* level = nullptr) { MOZ_ASSERT(!done()); *dagSlot = activeSlot; *phase = descendants.empty() ? Phase(current) : descendants.front(); if (level) *level = phaseExtra[*phase].depth + baseLevel; }
void advance() { MOZ_ASSERT(!done()); if (!descendants.empty()) { // Currently iterating over a multiparented subtree. descendants.popFront(); if (!descendants.empty()) return; // Just before leaving the last child, reset the iterator to look // at "main" phases (in PHASE_DAG_NONE) instead of multiparented // subtree phases. ++current; activeSlot = PHASE_DAG_NONE; baseLevel = 0; return; } if (phaseExtra[current].dagSlot != PHASE_DAG_NONE) { // The current phase has a shared subtree. Load them up into // 'descendants' and advance to the first child. activeSlot = phaseExtra[current].dagSlot; descendants = dagDescendants[activeSlot].all(); MOZ_ASSERT(!descendants.empty()); baseLevel += phaseExtra[current].depth + 1; return; } ++current; }
void advance() { MOZ_ASSERT(!done()); if (!descendants.empty()) { descendants.popFront(); if (!descendants.empty()) return; ++current; activeSlot = PHASE_DAG_NONE; baseLevel = 0; return; } if (phaseExtra[current].dagSlot != PHASE_DAG_NONE) { activeSlot = phaseExtra[current].dagSlot; descendants = dagDescendants[activeSlot].all(); MOZ_ASSERT(!descendants.empty()); baseLevel += phaseExtra[current].depth + 1; return; } ++current; }