Skip to content

Commit

Permalink
Remove rds support for static locals
Browse files Browse the repository at this point in the history
Reviewed By: ricklavoie

Differential Revision: D14317167

fbshipit-source-id: 4835d835f98347b7e1f7534f96bbb2e0db09b939
  • Loading branch information
paulbiss authored and hhvm-bot committed Mar 18, 2019
1 parent 2836708 commit 10c5fb6
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 59 deletions.
8 changes: 0 additions & 8 deletions hphp/runtime/base/rds-util.cpp
Expand Up @@ -22,14 +22,6 @@ namespace HPHP { namespace rds {

//////////////////////////////////////////////////////////////////////

Link<StaticLocalData, Mode::Normal>
bindStaticLocal(const Func* func, const StringData* name) {
auto ret = bind<StaticLocalData,Mode::Normal>(
StaticLocal { func->getFuncId(), name }
);
return ret;
}

Link<TypedValue, Mode::Normal>
bindClassConstant(const StringData* clsName, const StringData* cnsName) {
auto ret = bind<TypedValue,Mode::Normal,kTVSimdAlign>(
Expand Down
15 changes: 0 additions & 15 deletions hphp/runtime/base/rds-util.h
Expand Up @@ -36,21 +36,6 @@ namespace HPHP { namespace rds {
* Utility functions for allocating some types of data from RDS.
*/

/*
* Static locals.
*
* For normal functions, static locals are allocated as RefData's that
* live in RDS. Note that we don't put closure locals here because
* they are per-instance.
*/

struct StaticLocalData {
RefData ref;
static size_t ref_offset() { return offsetof(StaticLocalData, ref); }
};
Link<StaticLocalData, rds::Mode::Normal>
bindStaticLocal(const Func*, const StringData*);

/*
* Allocate storage for the value of a class constant in RDS.
*/
Expand Down
26 changes: 0 additions & 26 deletions hphp/runtime/base/rds.cpp
Expand Up @@ -63,7 +63,6 @@ std::mutex s_allocMutex;
//////////////////////////////////////////////////////////////////////

struct SymbolKind : boost::static_visitor<std::string> {
std::string operator()(StaticLocal /*k*/) const { return "StaticLocal"; }
std::string operator()(ClsConstant /*k*/) const { return "ClsConstant"; }
std::string operator()(StaticMethod /*k*/) const { return "StaticMethod"; }
std::string operator()(StaticMethodF /*k*/) const { return "StaticMethodF"; }
Expand All @@ -77,19 +76,6 @@ struct SymbolKind : boost::static_visitor<std::string> {
};

struct SymbolRep : boost::static_visitor<std::string> {
std::string operator()(StaticLocal k) const {
const Func* func = Func::fromFuncId(k.funcId);
const Class* cls = getOwningClassForFunc(func);
std::string name;
if (cls != func->cls()) {
name = cls->name()->toCppString() + "::" +
func->name()->toCppString();
} else {
name = func->fullName()->toCppString();
}
return name + "::" + k.name->toCppString();
}

std::string operator()(ClsConstant k) const {
return k.clsName->data() + std::string("::") + k.cnsName->data();
}
Expand Down Expand Up @@ -139,11 +125,6 @@ struct SymbolEq : boost::static_visitor<bool> {
bool
>::type operator()(const T&, const U&) const { return false; }

bool operator()(StaticLocal k1, StaticLocal k2) const {
assertx(k1.name->isStatic() && k2.name->isStatic());
return k1.funcId == k2.funcId && k1.name == k2.name;
}

bool operator()(ClsConstant k1, ClsConstant k2) const {
assertx(k1.clsName->isStatic() && k1.cnsName->isStatic());
assertx(k2.clsName->isStatic() && k2.cnsName->isStatic());
Expand Down Expand Up @@ -191,13 +172,6 @@ struct SymbolEq : boost::static_visitor<bool> {
};

struct SymbolHash : boost::static_visitor<size_t> {
size_t operator()(StaticLocal k) const {
return folly::hash::hash_128_to_64(
std::hash<FuncId>()(k.funcId),
k.name->hash()
);
}

size_t operator()(ClsConstant k) const {
return folly::hash::hash_128_to_64(
k.clsName->hash(),
Expand Down
12 changes: 2 additions & 10 deletions hphp/runtime/base/rds.h
Expand Up @@ -185,13 +185,6 @@ extern __thread void* tl_base;
* All StringData*'s below must be static strings.
*/

/*
* Symbol for function static locals. These are RefData's allocated
* in RDS.
*/
struct StaticLocal { FuncId funcId;
LowStringPtr name; };

/*
* Class constant values are TypedValue's stored in RDS.
*/
Expand Down Expand Up @@ -238,8 +231,7 @@ struct LSBMemoCache {
};


using Symbol = boost::variant< StaticLocal
, ClsConstant
using Symbol = boost::variant< ClsConstant
, StaticMethod
, StaticMethodF
, Profile<jit::ArrayKindProfile>
Expand Down Expand Up @@ -632,7 +624,7 @@ void uninitHandle(Handle handle);
/*
* Used to record information about the rds handle h in the
* perf-data-pid.map (if enabled).
* The type indicates the type of entry (eg StaticLocal), and the
* The type indicates the type of entry (eg ClsConstant), and the
* msg identifies this particular entry (eg function-name:local-name)
*/
void recordRds(Handle h, size_t size,
Expand Down

0 comments on commit 10c5fb6

Please sign in to comment.