Cell lookupCnsHelperNormal(rds::Handle tv_handle, StringData* nm, bool error) { assertx(rds::isNormalHandle(tv_handle)); assertx(!rds::isHandleInit(tv_handle)); return lookupCnsHelper(nm, error); }
Cell lookupCnsHelperPersistent(rds::Handle tv_handle, StringData* nm, bool error) { assertx(rds::isPersistentHandle(tv_handle)); auto const tv = &rds::handleToRef<TypedValue>(tv_handle); assertx(tv->m_type == KindOfUninit); // Deferred system constants. if (UNLIKELY(tv->m_data.pref != nullptr)) { auto callback = (Native::ConstantCallback)(tv->m_data.pref); const Cell* cns = callback().asTypedValue(); if (LIKELY(cns->m_type != KindOfUninit)) { Cell c1; cellDup(*cns, c1); return c1; } } return lookupCnsHelper(nm, error); }
Cell lookupCnsUHelperPersistent(rds::Handle tv_handle, StringData* nm, StringData* fallback) { assertx(rds::isPersistentHandle(tv_handle)); // Lookup qualified name in thread-local constants. auto cns = lookupCnsImpl(nm); // Try cache handle for unqualified name. auto const tv = &rds::handleToRef<TypedValue>(tv_handle); if (UNLIKELY(!cns && tv->m_type != KindOfUninit)) { cns = tv; } if (LIKELY(cns != nullptr)) { Cell c1; cellDup(*cns, c1); return c1; } return lookupCnsHelper(fallback, false); }
Cell lookupCnsUHelperNormal(rds::Handle tv_handle, StringData* nm, StringData* fallback) { assertx(rds::isNormalHandle(tv_handle)); // Lookup qualified name in thread-local constants. auto cns = lookupCnsImpl(nm); // Try cache handle for unqualified name. if (UNLIKELY(!cns && rds::isHandleInit(tv_handle, rds::NormalTag{}))) { cns = &rds::handleToRef<TypedValue>(tv_handle); assertx(cns->m_type != KindOfUninit); } if (LIKELY(cns != nullptr)) { Cell c1; cellDup(*cns, c1); return c1; } // Lookup unqualified name in thread-local constants. return lookupCnsHelper(fallback, false); }