本文整理汇总了C++中SrcKey::funcID方法的典型用法代码示例。如果您正苦于以下问题:C++ SrcKey::funcID方法的具体用法?C++ SrcKey::funcID怎么用?C++ SrcKey::funcID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SrcKey
的用法示例。
在下文中一共展示了SrcKey::funcID方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: showShort
std::string showShort(SrcKey sk) {
if (!sk.valid()) return "<invalid SrcKey>";
return folly::format(
"{}(id {:#x})@{}{}",
sk.func()->fullName(),
sk.funcID(),
sk.offset(),
sk.resumed() ? "r" : ""
).str();
}
示例2: lastSrcKey
SrcKey RegionDesc::lastSrcKey() const {
assertx(!empty());
FuncId startFuncId = start().funcID();
for (int i = m_blocks.size() - 1; i >= 0; i--) {
SrcKey sk = m_blocks[i]->last();
if (sk.funcID() == startFuncId) {
return sk;
}
}
always_assert(0);
}
示例3: addTransPrologue
TransID ProfData::addTransPrologue(TransKind kind, SrcKey sk,
int nArgs) {
assertx(kind == TransKind::Prologue || kind == TransKind::Proflogue);
TransID transId = m_numTrans++;
m_transRecs.emplace_back(new ProfTransRec(transId, kind, sk, nArgs));
if (kind == TransKind::Proflogue) {
// only Proflogue translations need an entry in the m_prologueDB
m_prologueDB.add(sk.funcID(), nArgs, transId);
}
return transId;
}
示例4: show
std::string show(SrcKey sk) {
auto func = sk.func();
auto unit = sk.unit();
const char *filepath = "*anonFile*";
if (unit->filepath()->data() && unit->filepath()->size()) {
filepath = unit->filepath()->data();
}
return folly::format("{}:{} in {}(id 0x{:#x})@{: >6}{}",
filepath, unit->getLineNumber(sk.offset()),
func->isPseudoMain() ? "pseudoMain"
: func->fullName()->data(),
(uint32_t)sk.funcID(), sk.offset(),
sk.resumed() ? "r" : "").str();
}
示例5: profileSrcKey
bool profileSrcKey(SrcKey sk) {
if (!shouldPGOFunc(*sk.func())) return false;
if (profData()->optimized(sk.funcID())) return false;
if (profData()->profiling(sk.funcID())) return true;
// Don't start profiling new functions if the size of either main or
// prof is already above Eval.JitAMaxUsage and we already filled hot.
auto tcUsage = std::max(code().main().used(), code().prof().used());
if (tcUsage >= CodeCache::AMaxUsage && !code().hotEnabled()) {
return false;
}
// We have two knobs to control the number of functions we're allowed to
// profile: Eval.JitProfileRequests and Eval.JitProfileBCSize. We profile new
// functions until either of these limits is exceeded. In practice we expect
// to hit the bytecode size limit first but we keep the request limit around
// as a safety net.
if (RuntimeOption::EvalJitProfileBCSize > 0 &&
profData()->profilingBCSize() >= RuntimeOption::EvalJitProfileBCSize) {
return false;
}
return requestCount() <= RuntimeOption::EvalJitProfileRequests;
}
示例6: addTransProflogue
TransID ProfData::addTransProflogue(SrcKey sk, int nArgs) {
auto transId = m_numTrans++;
m_transRecs.emplace_back(new ProfTransRec(sk, nArgs));
m_proflogueDB.emplace(std::make_tuple(sk.funcID(), nArgs), transId);
return transId;
}