Revert "Added AssertThis opcode and modified translator to emit it"

Esse commit está contido em:
bsimmers
2013-06-14 16:42:14 -07:00
commit de Sara Golemon
commit a4c8ea2957
8 arquivos alterados com 10 adições e 18 exclusões
-6
Ver Arquivo
@@ -349,12 +349,6 @@ CheckLoc<T,localId> S0:FramePtr -> L
Check that type of the given localId on the frame S0 is T; if not,
branch to the label L.
AssertThis
Asserts that the $this variable is valid in the current frame. This
instruction is a hint to perform optimizations in later passes but does
not have any runtime behavior.
AssertLoc<T,localId> S0:FramePtr
Asserts that type of the supplied local on the frame S0 is T. This
-1
Ver Arquivo
@@ -356,7 +356,6 @@ NOOP_OPCODE(AssertLoc)
NOOP_OPCODE(OverrideLoc)
NOOP_OPCODE(AssertStk)
NOOP_OPCODE(AssertStkVal)
NOOP_OPCODE(AssertThis)
NOOP_OPCODE(Nop)
NOOP_OPCODE(DefLabel)
NOOP_OPCODE(ExceptionBarrier)
+4 -4
Ver Arquivo
@@ -371,10 +371,6 @@ void HhbcTranslator::emitUnboxR() {
emitUnboxRAux();
}
void HhbcTranslator::assertThis() {
gen(AssertThis);
}
void HhbcTranslator::emitThis() {
if (!curClass()) {
emitInterpOne(Type::Obj, 0); // will throw a fatal
@@ -2379,6 +2375,10 @@ void HhbcTranslator::emitRetV(bool freeInline) {
emitRet(Type::BoxedCell, freeInline);
}
void HhbcTranslator::setThisAvailable() {
m_tb->setThisAvailable();
}
void HhbcTranslator::guardTypeLocal(uint32_t locId, Type type) {
gen(GuardLoc, type, LocalId(locId), m_tb->fp());
}
+1 -1
Ver Arquivo
@@ -126,7 +126,6 @@ struct HhbcTranslator {
const vector<bool>& vals);
// Interface to irtranslator for predicted and inferred types.
void assertThis();
void assertTypeLocal(uint32_t localIndex, Type type);
void assertTypeStack(uint32_t stackIndex, Type type);
void checkTypeLocal(uint32_t localIndex, Type type, Offset dest = -1);
@@ -151,6 +150,7 @@ struct HhbcTranslator {
void profileFailedInlShape(const std::string& str);
// Other public functions for irtranslator.
void setThisAvailable();
void emitInterpOne(Type type, int numPopped, int numExtraPushed = 0);
void emitInterpOneCF(int numPopped);
-1
Ver Arquivo
@@ -170,7 +170,6 @@ O(GuardRefs, ND, S(Func) \
S(Int) \
S(Int), E) \
O(AssertLoc, ND, S(FramePtr), E) \
O(AssertThis, ND, NA, E) \
O(OverrideLoc, ND, S(FramePtr), E) \
O(BeginCatch, ND, NA, E|Mem) \
O(EndCatch, ND, S(StkPtr), E|Mem) \
+2 -1
Ver Arquivo
@@ -1572,7 +1572,8 @@ void Translator::translateInstr(const NormalizedInstruction& i) {
i.breaksTracelet && !m_hhbcTrans->isInlining());
if (i.guardedThis) {
m_hhbcTrans->assertThis();
// Task #2067635: This should really generate an AssertThis
m_hhbcTrans->setThisAvailable();
}
if (moduleEnabled(HPHP::Trace::stats, 2)) {
-4
Ver Arquivo
@@ -221,10 +221,6 @@ void TraceBuilder::updateTrackedState(IRInstruction* inst) {
m_spValue = inst->dst();
break;
case AssertThis:
m_thisIsAvailable = true;
break;
case SpillStack: {
m_spValue = inst->dst();
// Push the spilled values but adjust for the popped values
+3
Ver Arquivo
@@ -107,6 +107,9 @@ struct TraceBuilder {
bool isThisAvailable() const {
return m_thisIsAvailable;
}
void setThisAvailable() {
m_thisIsAvailable = true;
}
Type getLocalType(unsigned id) const;
SSATmp* getLocalValue(unsigned id) const;