Item EvaluationCache<IsForGlobal>::evaluateSingleton(const DynamicContext::Ptr &context) const { ItemCacheCell &cell = IsForGlobal ? context->globalItemCacheCell(m_varSlot) : context->itemCacheCell(m_varSlot); if(cell.cacheState == ItemCacheCell::Full) return cell.cachedItem; else { Q_ASSERT(cell.cacheState == ItemCacheCell::Empty); cell.cachedItem = m_operand->evaluateSingleton(IsForGlobal ? topFocusContext(context) : context); cell.cacheState = ItemCacheCell::Full; return cell.cachedItem; } }