diff --git a/hphp/runtime/base/enum-cache.cpp b/hphp/runtime/base/enum-cache.cpp index e62564a2b55c0..a8d4fe98b5668 100644 --- a/hphp/runtime/base/enum-cache.cpp +++ b/hphp/runtime/base/enum-cache.cpp @@ -115,7 +115,7 @@ const EnumValues* EnumCache::cacheRequestEnumValues( assertx(names.isDictOrDArray()); assertx(values.isDictOrDArray()); - m_nonScalarEnumValuesMap.bind(rds::Mode::Normal); + m_nonScalarEnumValuesMap.bind(rds::Mode::Normal, rds::LinkID{"EnumCache"}); if (!m_nonScalarEnumValuesMap.isInit()) { m_nonScalarEnumValuesMap.initWith(req::make_raw()); } diff --git a/hphp/runtime/base/intercept.cpp b/hphp/runtime/base/intercept.cpp index e49673b37c9b8..696580e7a2896 100644 --- a/hphp/runtime/base/intercept.cpp +++ b/hphp/runtime/base/intercept.cpp @@ -236,9 +236,14 @@ void rename_function(const String& old_name, const String& new_name) { raise_error("Function already defined: %s", n3w->data()); } - always_assert(!rds::isPersistentHandle(oldNe->getFuncHandle())); + always_assert( + !rds::isPersistentHandle(oldNe->getFuncHandle(func->fullName())) + ); oldNe->setCachedFunc(nullptr); - newNe->m_cachedFunc.bind(rds::Mode::Normal); + newNe->m_cachedFunc.bind( + rds::Mode::Normal, + rds::LinkName{"NEFunc", fnew ? fnew->fullName() : makeStaticString(n3w)} + ); newNe->setCachedFunc(func); if (RuntimeOption::EvalJit) { diff --git a/hphp/runtime/base/rds-inl.h b/hphp/runtime/base/rds-inl.h index 0941e1af20f8a..b8f5abf6124eb 100644 --- a/hphp/runtime/base/rds-inl.h +++ b/hphp/runtime/base/rds-inl.h @@ -39,8 +39,7 @@ Handle bindImpl(Symbol key, Mode mode, size_t sizeBytes, Handle attachImpl(Symbol key); void bindOnLinkImpl(std::atomic& handle, - folly::Optional key, - Mode mode, size_t size, size_t align, + Symbol key, Mode mode, size_t size, size_t align, type_scan::Index tsi, const void* init_val); extern size_t s_normal_frontier; @@ -269,9 +268,7 @@ bool Link::isPersistent() const { template template -void Link::bind(Mode mode, - folly::Optional sym, - const T* init_val) { +void Link::bind(Mode mode, Symbol sym, const T* init_val) { assertx(maybe(mode)); if (LIKELY(bound())) return; @@ -279,8 +276,6 @@ void Link::bind(Mode mode, m_handle, sym, mode, sizeof(T), Align, type_scan::getIndexForScan(), init_val ); - if (!sym) recordRds(m_handle, sizeof(T), "Unknown", __PRETTY_FUNCTION__); - checkSanity(); } diff --git a/hphp/runtime/base/rds.cpp b/hphp/runtime/base/rds.cpp index 8d7f5db63cdb2..10882cd8fa301 100644 --- a/hphp/runtime/base/rds.cpp +++ b/hphp/runtime/base/rds.cpp @@ -78,9 +78,7 @@ struct SymbolKind : boost::static_visitor { struct SymbolRep : boost::static_visitor { std::string operator()(LinkName k) const { return k.name->data(); } - std::string operator()(LinkID k) const { - return folly::to(k.id); - } + std::string operator()(LinkID k) const { return ""; } std::string operator()(ClsConstant k) const { return k.clsName->data() + std::string("::") + k.cnsName->data(); @@ -134,7 +132,7 @@ struct SymbolEq : boost::static_visitor { return strcmp(k1.type, k2.type) == 0 && k1.name->isame(k2.name); } bool operator()(LinkID k1, LinkID k2) const { - return strcmp(k1.type, k2.type) == 0 && k1.id == k2.id; + return strcmp(k1.type, k2.type) == 0; } bool operator()(ClsConstant k1, ClsConstant k2) const { @@ -189,7 +187,7 @@ struct SymbolHash : boost::static_visitor { std::string{k.type}, k.name->hash()); } size_t operator()(LinkID k) const { - return folly::hash::hash_combine(std::string{k.type}, k.id); + return folly::hash::hash_combine(std::string{k.type}); } size_t operator()(ClsConstant k) const { @@ -541,6 +539,7 @@ Handle bindImpl(Symbol key, Mode mode, size_t sizeBytes, if (type_scan::hasScanner(tyIndex)) { s_handleTable.insert(std::make_pair(handle, key)); } + return handle; } @@ -552,8 +551,7 @@ Handle attachImpl(Symbol key) { NEVER_INLINE void bindOnLinkImpl(std::atomic& handle, - folly::Optional sym, - Mode mode, size_t size, size_t align, + Symbol sym, Mode mode, size_t size, size_t align, type_scan::Index tsi, const void* init_val) { Handle c = kUninitHandle; if (handle.compare_exchange_strong(c, kBeingBound, @@ -561,7 +559,7 @@ void bindOnLinkImpl(std::atomic& handle, std::memory_order_relaxed)) { // we flipped it from kUninitHandle, so we get to fill in the value. auto const h = allocUnlocked(mode, size, align, tsi); - if (sym) recordRds(h, size, *sym); + recordRds(h, size, sym); if (init_val != nullptr && isPersistentHandle(h)) { memcpy(handleToPtr(h), init_val, size); @@ -638,7 +636,7 @@ void processInit() { #endif addNewPersistentChunk(allocSize), - s_persistentTrue.bind(Mode::Persistent); + s_persistentTrue.bind(Mode::Persistent, LinkID{"RDSTrue"}); *s_persistentTrue = true; local::RDSInit(); @@ -891,7 +889,7 @@ std::vector allTLBases() { } folly::Optional reverseLink(Handle handle) { - RevLinkTable::const_accessor acc; + decltype(s_handleTable)::const_accessor acc; if (s_handleTable.find(acc, handle)) { return acc->second; } diff --git a/hphp/runtime/base/rds.h b/hphp/runtime/base/rds.h index ae491edc25a46..a3f7f67c2cd32 100644 --- a/hphp/runtime/base/rds.h +++ b/hphp/runtime/base/rds.h @@ -189,7 +189,7 @@ extern __thread void* tl_base; /* * Symbols for rds::Link's. */ -struct LinkID { const char* type; uint64_t id; }; +struct LinkID { const char* type; }; struct LinkName { const char* type; LowStringPtr name; }; /* @@ -403,8 +403,7 @@ struct Link { * Post: bound() */ template - void bind(Mode mode, folly::Optional sym = folly::none, - const T* init_val = nullptr); + void bind(Mode mode, Symbol sym, const T* init_val = nullptr); /* * Dereference a Link and access its RDS memory for the current thread. diff --git a/hphp/runtime/base/static-string-table.cpp b/hphp/runtime/base/static-string-table.cpp index 738f5660b533b..cdfe45affb96c 100644 --- a/hphp/runtime/base/static-string-table.cpp +++ b/hphp/runtime/base/static-string-table.cpp @@ -292,7 +292,7 @@ bool bindPersistentCns(const StringData* cnsName, const TypedValue& value) { assertx(it != s_stringDataMap->end()); it->second.bind( rds::Mode::Persistent, - rds::Symbol{rds::LinkName{"Cns", cnsName}}, + rds::LinkName{"Cns", cnsName}, &value ); return it->second.isPersistent(); @@ -314,10 +314,10 @@ rds::Handle makeCnsHandle(const StringData* cnsName) { auto const it = s_stringDataMap->find(cnsName); assertx(it != s_stringDataMap->end()); if (!it->second.bound()) { - it->second.bind(rds::Mode::Normal); - - rds::recordRds(it->second.handle(), sizeof(TypedValue), - "Cns", cnsName->slice()); + it->second.bind( + rds::Mode::Normal, + rds::LinkName{"Cns", cnsName} + ); } return it->second.handle(); } diff --git a/hphp/runtime/ext/asio/ext_static-wait-handle.cpp b/hphp/runtime/ext/asio/ext_static-wait-handle.cpp index 563b025da26ac..9fb3699a31eee 100644 --- a/hphp/runtime/ext/asio/ext_static-wait-handle.cpp +++ b/hphp/runtime/ext/asio/ext_static-wait-handle.cpp @@ -73,9 +73,12 @@ c_StaticWaitHandle* c_StaticWaitHandle::CreateFailed(ObjectData* exception) { } void AsioExtension::initStaticWaitHandle() { - c_StaticWaitHandle::NullHandle.bind(rds::Mode::Normal); - c_StaticWaitHandle::TrueHandle.bind(rds::Mode::Normal); - c_StaticWaitHandle::FalseHandle.bind(rds::Mode::Normal); + c_StaticWaitHandle::NullHandle.bind( + rds::Mode::Normal, rds::LinkID{"StaticNullWH"}); + c_StaticWaitHandle::TrueHandle.bind( + rds::Mode::Normal, rds::LinkID{"StaticTrueWH"}); + c_StaticWaitHandle::FalseHandle.bind( + rds::Mode::Normal, rds::LinkID{"StaticFalseWH"}); } void AsioExtension::requestInitSingletons() { diff --git a/hphp/runtime/ext/process/ext_process.cpp b/hphp/runtime/ext/process/ext_process.cpp index 9f8157c9a5553..b40d2f7aae4e9 100644 --- a/hphp/runtime/ext/process/ext_process.cpp +++ b/hphp/runtime/ext/process/ext_process.cpp @@ -478,7 +478,7 @@ bool HHVM_FUNCTION(pcntl_signal, } if (!g_signal_handlers.bound()) { - g_signal_handlers.bind(rds::Mode::Normal); + g_signal_handlers.bind(rds::Mode::Normal, rds::LinkID{"SignalHandlers"}); } if (!g_signal_handlers.isInit()) { g_signal_handlers.initWith(empty_array()); diff --git a/hphp/runtime/vm/class-inl.h b/hphp/runtime/vm/class-inl.h index e636dad065954..69d35909bf7a0 100644 --- a/hphp/runtime/vm/class-inl.h +++ b/hphp/runtime/vm/class-inl.h @@ -465,13 +465,19 @@ inline const VMFixedVector& Class::pinitVec() const { inline rds::Handle Class::checkedPropTypeRedefinesHandle() const { assertx(m_maybeRedefsPropTy); - m_extra->m_checkedPropTypeRedefs.bind(rds::Mode::Normal); + m_extra->m_checkedPropTypeRedefs.bind( + rds::Mode::Normal, + rds::LinkName{"PropTypeRedefs", name()} + ); return m_extra->m_checkedPropTypeRedefs.handle(); } inline rds::Handle Class::checkedPropInitialValuesHandle() const { assertx(m_needsPropInitialCheck); - m_extra->m_checkedPropInitialValues.bind(rds::Mode::Normal); + m_extra->m_checkedPropInitialValues.bind( + rds::Mode::Normal, + rds::LinkName{"PropInitialValues", name()} + ); return m_extra->m_checkedPropInitialValues.handle(); } @@ -479,7 +485,10 @@ inline rds::Handle Class::checkedPropInitialValuesHandle() const { // Property storage. inline void Class::initPropHandle() const { - m_propDataCache.bind(rds::Mode::Normal); + m_propDataCache.bind( + rds::Mode::Normal, + rds::LinkName{"PropDataCache", name()} + ); } inline rds::Handle Class::propHandle() const { diff --git a/hphp/runtime/vm/class.cpp b/hphp/runtime/vm/class.cpp index 002e42167dc2f..2df679c0361a8 100644 --- a/hphp/runtime/vm/class.cpp +++ b/hphp/runtime/vm/class.cpp @@ -927,7 +927,7 @@ void Class::checkPropInitialValues() const { assertx(m_extra.get() != nullptr); auto extra = m_extra.get(); - extra->m_checkedPropInitialValues.bind(rds::Mode::Normal); + checkedPropInitialValuesHandle(); // init handle if (extra->m_checkedPropInitialValues.isInit()) return; for (Slot slot = 0; slot < m_declProperties.size(); ++slot) { @@ -956,7 +956,7 @@ void Class::checkPropTypeRedefinitions() const { assertx(m_extra.get() != nullptr); auto extra = m_extra.get(); - extra->m_checkedPropTypeRedefs.bind(rds::Mode::Normal); + checkedPropTypeRedefinesHandle(); // init handle if (extra->m_checkedPropTypeRedefs.isInit()) return; if (m_parent->m_maybeRedefsPropTy) m_parent->checkPropTypeRedefinitions(); @@ -1042,13 +1042,13 @@ void Class::initSPropHandles() const { "around TypedValue"); propHandle.bind( rds::Mode::Persistent, - rds::Symbol{rds::SPropCache{this, slot}}, + rds::SPropCache{this, slot}, reinterpret_cast(&sProp.val) ); } else { propHandle.bind( rds::Mode::Local, - rds::Symbol{rds::SPropCache{this, slot}} + rds::SPropCache{this, slot} ); } } else { @@ -1069,7 +1069,10 @@ void Class::initSPropHandles() const { // of them. m_sPropCacheInit = rds::s_persistentTrue; } else { - m_sPropCacheInit.bind(rds::Mode::Normal); + m_sPropCacheInit.bind( + rds::Mode::Normal, + rds::LinkName{"PropCacheInit", name()} + ); } rds::recordRds(m_sPropCacheInit.handle(), sizeof(bool), "SPropCacheInit", name()->slice()); @@ -1358,7 +1361,10 @@ TypedValue Class::clsCnsGet(const StringData* clsCnsName, ClsCnsLookup what) con * we'll raise an error. The globals array is never a valid value of a (type) * constant, so we use it as the marker. */ - m_nonScalarConstantCache.bind(rds::Mode::Normal); + m_nonScalarConstantCache.bind( + rds::Mode::Normal, + rds::LinkName{"ClassNonScalarCnsCache", name()} + ); auto& clsCnsData = *m_nonScalarConstantCache; if (m_nonScalarConstantCache.isInit()) { auto const cCns = clsCnsData->get(clsCnsName); diff --git a/hphp/runtime/vm/jit/guard-type-profile.cpp b/hphp/runtime/vm/jit/guard-type-profile.cpp index 445bc367b42cb..bcd05f204f467 100644 --- a/hphp/runtime/vm/jit/guard-type-profile.cpp +++ b/hphp/runtime/vm/jit/guard-type-profile.cpp @@ -36,7 +36,12 @@ rds::Handle guardProfileHandle(Type t) { t.unspecialize().toString() + (t.isSpecialized() ? "" : "") ); auto const pair = s_map.emplace(name); - if (pair.second) pair.first->second.bind(rds::Mode::Normal); + if (pair.second) { + pair.first->second.bind( + rds::Mode::Normal, + rds::LinkName{"ProfileGuardType", pair.first->first} + ); + } return pair.first->second.handle(); } } @@ -56,7 +61,10 @@ void logGuardProfileData() { auto& link = pair.second; // It's possible to see the Link after insertion but before it's bound, so // make sure it's bound before trying to read from it. - link.bind(rds::Mode::Normal); + link.bind( + rds::Mode::Normal, + rds::LinkName{"ProfileGuardType", pair.first} + ); if (!link.isInit() || *link == 0) continue; StructuredLogEntry log; diff --git a/hphp/runtime/vm/jit/irlower-lookup-cls-func.cpp b/hphp/runtime/vm/jit/irlower-lookup-cls-func.cpp index c473c34efd4e4..2dabe4f82895f 100644 --- a/hphp/runtime/vm/jit/irlower-lookup-cls-func.cpp +++ b/hphp/runtime/vm/jit/irlower-lookup-cls-func.cpp @@ -170,26 +170,32 @@ const Func* lookupUnknownFunc(const StringData* name) { namespace { -template rds::Handle handleFrom(const NamedEntity* ne); +template rds::Handle handleFrom( + const NamedEntity* ne, + const StringData* name +); template<> -rds::Handle handleFrom(const NamedEntity* ne) { - return ne->getFuncHandle(); +rds::Handle handleFrom(const NamedEntity* ne, + const StringData* name) { + return ne->getFuncHandle(name); } template<> -rds::Handle handleFrom(const NamedEntity* ne) { - return ne->getClassHandle(); +rds::Handle handleFrom(const NamedEntity* ne, + const StringData* name) { + return ne->getClassHandle(name); } template<> -rds::Handle handleFrom(const NamedEntity* ne) { - return ne->getRecordDescHandle(); +rds::Handle handleFrom(const NamedEntity* ne, + const StringData* name) { + return ne->getRecordDescHandle(name); } template void implLdCached(IRLS& env, const IRInstruction* inst, const StringData* name, SlowPath fill_cache) { auto const dst = dstLoc(env, inst, 0).reg(); - auto const ch = handleFrom(NamedEntity::get(name)); + auto const ch = handleFrom(NamedEntity::get(name), name); auto& v = vmain(env); if (rds::isNormalHandle(ch)) { @@ -220,7 +226,7 @@ template void implLdCachedSafe(IRLS& env, const IRInstruction* inst, const StringData* name) { auto const dst = dstLoc(env, inst, 0).reg(); - auto const ch = handleFrom(NamedEntity::get(name)); + auto const ch = handleFrom(NamedEntity::get(name), name); auto& v = vmain(env); if (rds::isNormalHandle(ch)) { diff --git a/hphp/runtime/vm/jit/irlower-minstr.cpp b/hphp/runtime/vm/jit/irlower-minstr.cpp index c8e9361758c3d..b9a2bb29c284a 100644 --- a/hphp/runtime/vm/jit/irlower-minstr.cpp +++ b/hphp/runtime/vm/jit/irlower-minstr.cpp @@ -923,7 +923,10 @@ void cgLdPackedArrayDataElemAddr(IRLS& env, const IRInstruction* inst) { auto const arrTy = inst->src(0)->type(); if (arrTy.maybe(TPackedArr)) { - s_counter.bind(rds::Mode::Local); + s_counter.bind( + rds::Mode::Local, + rds::LinkID{"PackedArraySampleCounter"} + ); auto const profile = [&] (Vout& v) { auto const handle = s_counter.handle(); diff --git a/hphp/runtime/vm/jit/mcgen.cpp b/hphp/runtime/vm/jit/mcgen.cpp index 92c7e0fd97e96..918b277f5ced9 100644 --- a/hphp/runtime/vm/jit/mcgen.cpp +++ b/hphp/runtime/vm/jit/mcgen.cpp @@ -52,7 +52,7 @@ bool s_inited{false}; void processInit() { TRACE(1, "mcgen startup\n"); - g_unwind_rds.bind(rds::Mode::Normal); + g_unwind_rds.bind(rds::Mode::Normal, rds::LinkID{"Unwind"}); Debug::initDebugInfo(); tc::processInit(); diff --git a/hphp/runtime/vm/jit/prof-data-serialize.cpp b/hphp/runtime/vm/jit/prof-data-serialize.cpp index ca5d5d588d67d..6efaffe62fecc 100644 --- a/hphp/runtime/vm/jit/prof-data-serialize.cpp +++ b/hphp/runtime/vm/jit/prof-data-serialize.cpp @@ -590,7 +590,7 @@ Class* read_class_internal(ProfDataDeserializer& ser) { enumBaseReq->type = dt == KindOfInt64 ? AnnotType::Int : AnnotType::String; enumBaseReq->name = preClass->enumBaseTy().typeName(); - ne->m_cachedTypeAlias.bind(rds::Mode::Normal); + ne->m_cachedTypeAlias.bind(rds::Mode::Normal, rds::LinkID{"NETypeAlias"}); ne->m_cachedTypeAlias.initWith(*enumBaseReq); } } diff --git a/hphp/runtime/vm/jit/vasm-prof-branch.cpp b/hphp/runtime/vm/jit/vasm-prof-branch.cpp index 70d08ec8aff08..6c40f4b63a6d8 100644 --- a/hphp/runtime/vm/jit/vasm-prof-branch.cpp +++ b/hphp/runtime/vm/jit/vasm-prof-branch.cpp @@ -262,7 +262,10 @@ Vout vheader(Vunit& unit, Vlabel s, AreaIndex area_cap = AreaIndex::Main) { * Decrement the branch sampling counter, and return the resultant SF register. */ Vreg check_counter(Vout& v) { - s_counter.bind(rds::Mode::Local); + s_counter.bind( + rds::Mode::Local, + rds::LinkID{"VasmProfBranchCounter"} + ); auto const handle = s_counter.handle(); auto const sf = v.makeReg(); diff --git a/hphp/runtime/vm/named-entity.cpp b/hphp/runtime/vm/named-entity.cpp index 2d03f5c890c54..0ecfa9952a919 100644 --- a/hphp/runtime/vm/named-entity.cpp +++ b/hphp/runtime/vm/named-entity.cpp @@ -35,8 +35,8 @@ namespace HPHP { /////////////////////////////////////////////////////////////////////////////// -rds::Handle NamedEntity::getFuncHandle() const { - m_cachedFunc.bind(rds::Mode::Normal); +rds::Handle NamedEntity::getFuncHandle(const StringData* name) const { + m_cachedFunc.bind(rds::Mode::Normal, rds::LinkName{"NEFunc", name}); return m_cachedFunc.handle(); } @@ -47,13 +47,13 @@ void NamedEntity::setCachedFunc(Func* f) { } } -rds::Handle NamedEntity::getClassHandle() const { - m_cachedClass.bind(rds::Mode::Normal); +rds::Handle NamedEntity::getClassHandle(const StringData* name) const { + m_cachedClass.bind(rds::Mode::Normal, rds::LinkName{"NEClass", name}); return m_cachedClass.handle(); } -rds::Handle NamedEntity::getRecordDescHandle() const { - m_cachedRecordDesc.bind(rds::Mode::Normal); +rds::Handle NamedEntity::getRecordDescHandle(const StringData* name) const { + m_cachedRecordDesc.bind(rds::Mode::Normal, rds::LinkName{"NERecord", name}); return m_cachedRecordDesc.handle(); } diff --git a/hphp/runtime/vm/named-entity.h b/hphp/runtime/vm/named-entity.h index 8649466e16056..43f28f7ad9597 100644 --- a/hphp/runtime/vm/named-entity.h +++ b/hphp/runtime/vm/named-entity.h @@ -98,7 +98,7 @@ struct NamedEntity { * Get the rds::Handle that caches this Func*, creating a (non-persistent) * one if it doesn't exist yet. */ - rds::Handle getFuncHandle() const; + rds::Handle getFuncHandle(const StringData* name) const; /* * Set and get the cached Func*. @@ -114,7 +114,7 @@ struct NamedEntity { * Get the rds::Handle that caches this Class*, creating a (non-persistent) * one if it doesn't exist yet. */ - rds::Handle getClassHandle() const; + rds::Handle getClassHandle(const StringData* name) const; /* * Set and get the cached Class*. @@ -130,7 +130,7 @@ struct NamedEntity { * Get the rds::Handle that caches this RecordDesc*, * creating a (non-persistent) one if it doesn't exist yet. */ - rds::Handle getRecordDescHandle() const; + rds::Handle getRecordDescHandle(const StringData* name) const; /* * Set and get the cached RecordDesc*. diff --git a/hphp/runtime/vm/reified-generics.cpp b/hphp/runtime/vm/reified-generics.cpp index 4b938ed884033..c87ca0fbaf49e 100644 --- a/hphp/runtime/vm/reified-generics.cpp +++ b/hphp/runtime/vm/reified-generics.cpp @@ -37,7 +37,10 @@ ArrayData* addToReifiedGenericsTable( // We have created a new entry on the named entity table // TODO(T31677864): If the type structures only contain persistent data, // mark it as persistent - ne->m_cachedReifiedGenerics.bind(rds::Mode::Normal); + ne->m_cachedReifiedGenerics.bind( + rds::Mode::Normal, + rds::LinkName{"ReifiedGenerics", name} + ); ArrayData::GetScalarArray(&tsList); ne->setCachedReifiedGenerics(tsList); return tsList; diff --git a/hphp/runtime/vm/unit.cpp b/hphp/runtime/vm/unit.cpp index c7732af036ec7..6b980764eb9de 100644 --- a/hphp/runtime/vm/unit.cpp +++ b/hphp/runtime/vm/unit.cpp @@ -641,7 +641,10 @@ bool Unit::isCoverageEnabled() const { void Unit::enableCoverage() { if (!m_coverage.bound()) { assertx(!RO::RepoAuthoritative && RO::EvalEnablePerFileCoverage); - m_coverage.bind(rds::Mode::Normal); + m_coverage.bind( + rds::Mode::Normal, + rds::LinkName{"UnitCoverage", filepath()} + ); } if (m_coverage.isInit()) return; new (m_coverage.get()) req::dynamic_bitset{}; @@ -816,7 +819,7 @@ void Unit::bindFunc(Func *func) { ne->m_cachedFunc.bind( persistent ? rds::Mode::Persistent : rds::Mode::Normal, - rds::Symbol{rds::LinkName{"Func", func->name()}}, + rds::LinkName{"Func", func->name()}, &init_val ); if (func->isUnique() && func == ne->getCachedFunc()) { @@ -920,7 +923,9 @@ void setupRecord(RecordDesc* newRecord, NamedEntity* nameList) { (!SystemLib::s_inited || RuntimeOption::RepoAuthoritative) && newRecord->verifyPersistent(); nameList->m_cachedRecordDesc.bind( - isPersistent? rds::Mode::Persistent : rds::Mode::Normal); + isPersistent? rds::Mode::Persistent : rds::Mode::Normal, + rds::LinkName{"NERecord", newRecord->name()} + ); newRecord->setRecordDescHandle(nameList->m_cachedRecordDesc); newRecord->incAtomicCount(); nameList->pushRecordDesc(newRecord); @@ -931,7 +936,9 @@ void setupClass(Class* newClass, NamedEntity* nameList) { (!SystemLib::s_inited || RuntimeOption::RepoAuthoritative) && newClass->verifyPersistent(); nameList->m_cachedClass.bind( - isPersistent ? rds::Mode::Persistent : rds::Mode::Normal); + isPersistent ? rds::Mode::Persistent : rds::Mode::Normal, + rds::LinkName{"NEClass", newClass->name()} + ); if (newClass->isBuiltin()) { assertx(newClass->isUnique()); @@ -1536,7 +1543,7 @@ bool Unit::defTypeAlias(Id id) { nameList->m_cachedTypeAlias.bind( persistent ? rds::Mode::Persistent : rds::Mode::Normal, - rds::Symbol{rds::LinkName{"TypeAlias", thisType->value}}, + rds::LinkName{"TypeAlias", thisType->value}, &resolved ); if (nameList->m_cachedTypeAlias.isPersistent()) return true; @@ -1700,7 +1707,10 @@ void Unit::initialMerge() { } if (!RO::RepoAuthoritative && RO::EvalEnablePerFileCoverage) { - m_coverage.bind(rds::Mode::Normal); + m_coverage.bind( + rds::Mode::Normal, + rds::LinkName{"UnitCoverage", filepath()} + ); } m_mergeState.store(MergeState::Merged | state, std::memory_order_relaxed); }