CGetS output type prediction

Esse commit está contido em:
Alexandru Suhan
2013-05-22 12:48:38 -07:00
commit de Sara Golemon
commit eb5d2d1f00
3 arquivos alterados com 23 adições e 4 exclusões
+9 -1
Ver Arquivo
@@ -4801,7 +4801,6 @@ inline void OPTBLD_INLINE VMExecutionContext::iopCGetG(PC& pc) {
TypedValue* clsref = m_stack.topTV(); \
TypedValue* nameCell = m_stack.indTV(1); \
TypedValue* output = nameCell; \
StringData* name; \
TypedValue* val; \
bool visible, accessible; \
lookup_sprop(m_fp, clsref, name, nameCell, val, visible, \
@@ -4830,7 +4829,12 @@ inline void OPTBLD_INLINE VMExecutionContext::iopCGetG(PC& pc) {
} while (0)
inline void OPTBLD_INLINE VMExecutionContext::iopCGetS(PC& pc) {
StringData* name;
GETS(false);
if (shouldProfile() && name && name->isStatic()) {
recordType(TypeProfileKey(TypeProfileKey::StaticPropName, name),
m_stack.top()->m_type);
}
}
inline void OPTBLD_INLINE VMExecutionContext::iopCGetM(PC& pc) {
@@ -4890,6 +4894,7 @@ inline void OPTBLD_INLINE VMExecutionContext::iopVGetG(PC& pc) {
}
inline void OPTBLD_INLINE VMExecutionContext::iopVGetS(PC& pc) {
StringData* name;
GETS(true);
}
#undef GETS
@@ -4949,6 +4954,7 @@ inline void OPTBLD_INLINE VMExecutionContext::iopIssetG(PC& pc) {
}
inline void OPTBLD_INLINE VMExecutionContext::iopIssetS(PC& pc) {
StringData* name;
SPROP_OP_PRELUDE
bool e;
if (!(visible && accessible)) {
@@ -5077,6 +5083,7 @@ inline void OPTBLD_INLINE VMExecutionContext::iopEmptyG(PC& pc) {
}
inline void OPTBLD_INLINE VMExecutionContext::iopEmptyS(PC& pc) {
StringData* name;
SPROP_OP_PRELUDE
bool e;
if (!(visible && accessible)) {
@@ -5380,6 +5387,7 @@ inline void OPTBLD_INLINE VMExecutionContext::iopIncDecG(PC& pc) {
}
inline void OPTBLD_INLINE VMExecutionContext::iopIncDecS(PC& pc) {
StringData* name;
SPROP_OP_PRELUDE
DECODE(unsigned char, op);
if (!(visible && accessible)) {
+12 -2
Ver Arquivo
@@ -756,7 +756,17 @@ predictOutputs(const Tracelet& t,
// lot. Get more conservative as evidence mounts that this is a
// polymorphic tracelet.
if (tx64->numTranslations(t.m_sk) >= kTooPolyPred) return KindOfInvalid;
if (hasImmVector(ni->op())) {
if (ni->op() == OpCGetS) {
const StringData* propName = ni->inputs[1]->rtt.valueStringOrNull();
if (propName) {
pred = predictType(TypeProfileKey(TypeProfileKey::StaticPropName,
propName));
TRACE(1, "prediction for static fields named %s: %d, %f\n",
propName->data(),
pred.first,
pred.second);
}
} else if (hasImmVector(ni->op())) {
pred = predictMVec(ni);
}
if (debug && pred.second < kAccept) {
@@ -1183,7 +1193,7 @@ static const struct {
{ OpCGetL3, {StackTop2|Local, StackIns2, OutCInputL, 1 }},
{ OpCGetN, {Stack1, Stack1, OutUnknown, 0 }},
{ OpCGetG, {Stack1, Stack1, OutUnknown, 0 }},
{ OpCGetS, {StackTop2, Stack1, OutUnknown, -1 }},
{ OpCGetS, {StackTop2, Stack1, OutPred, -1 }},
{ OpCGetM, {MVector, Stack1, OutPred, 1 }},
{ OpVGetL, {Local, Stack1, OutVInputL, 1 }},
{ OpVGetN, {Stack1, Stack1, OutVUnknown, 0 }},
+2 -1
Ver Arquivo
@@ -28,7 +28,8 @@ struct TypeProfileKey {
enum KeyType {
MethodName,
PropName,
EltName
EltName,
StaticPropName
} m_kind;
const StringData* m_name;