Don't hoist LdLocs to the top of tracelets.
We have separate GuardLoc instructions now. This was originally intended to be an optimization (and LdLoc was simultaneously acting as the guard back then), but now that Rematerialization is off (and since we don't do a DCE after register allocation anyway) I am doubtful.
Esse commit está contido em:
@@ -2198,7 +2198,6 @@ void HhbcTranslator::setThisAvailable() {
|
||||
|
||||
void HhbcTranslator::guardTypeLocal(uint32_t locId, Type type) {
|
||||
checkTypeLocal(locId, type);
|
||||
m_typeGuards.push_back(TypeGuard(TypeGuard::Local, locId, type));
|
||||
}
|
||||
|
||||
void HhbcTranslator::checkTypeLocal(uint32_t locId, Type type) {
|
||||
@@ -2225,7 +2224,6 @@ Trace* HhbcTranslator::guardTypeStack(uint32_t stackIndex,
|
||||
nextTrace = getGuardExit();
|
||||
}
|
||||
gen(GuardStk, type, nextTrace, StackOffset(stackIndex), m_tb->getSp());
|
||||
m_typeGuards.push_back(TypeGuard(TypeGuard::Stack, stackIndex, type));
|
||||
|
||||
return nextTrace;
|
||||
}
|
||||
@@ -2263,20 +2261,6 @@ void HhbcTranslator::assertTypeStack(uint32_t stackIndex, Type type) {
|
||||
refineType(tmp, type);
|
||||
}
|
||||
|
||||
void HhbcTranslator::emitLoadDeps() {
|
||||
for (auto& guard : m_typeGuards) {
|
||||
switch (guard.getKind()) {
|
||||
case TypeGuard::Local:
|
||||
ldLoc(guard.getIndex());
|
||||
break;
|
||||
case TypeGuard::Stack:
|
||||
break;
|
||||
default:
|
||||
assert(false); // iterator guards should not happen
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Trace* HhbcTranslator::guardRefs(int64_t entryArDelta,
|
||||
const vector<bool>& mask,
|
||||
const vector<bool>& vals,
|
||||
|
||||
@@ -369,7 +369,6 @@ struct HhbcTranslator {
|
||||
void checkTypeTopOfStack(Type type, Offset nextByteCode);
|
||||
void overrideTypeLocal(uint32_t localIndex, Type type);
|
||||
void setThisAvailable();
|
||||
void emitLoadDeps();
|
||||
void emitInterpOne(Type type, int numPopped, int numExtraPushed = 0);
|
||||
void emitInterpOneCF(int numPopped);
|
||||
|
||||
@@ -638,28 +637,6 @@ private:
|
||||
const Func* func;
|
||||
};
|
||||
|
||||
struct TypeGuard {
|
||||
enum Kind {
|
||||
Local,
|
||||
Stack,
|
||||
Iter
|
||||
};
|
||||
|
||||
TypeGuard(Kind kind, uint32_t index, Type type)
|
||||
: m_kind(kind)
|
||||
, m_index(index)
|
||||
, m_type(type)
|
||||
{}
|
||||
|
||||
Kind getKind() const { return m_kind; }
|
||||
uint32_t getIndex() const { return m_index; }
|
||||
|
||||
private:
|
||||
Kind m_kind;
|
||||
uint32_t m_index;
|
||||
Type m_type;
|
||||
};
|
||||
|
||||
private:
|
||||
IRFactory& m_irFactory;
|
||||
std::unique_ptr<TraceBuilder>
|
||||
@@ -695,7 +672,6 @@ private:
|
||||
std::stack<std::pair<SSATmp*,int32_t>>
|
||||
m_fpiStack;
|
||||
|
||||
vector<TypeGuard> m_typeGuards;
|
||||
Trace* const m_exitGuardFailureTrace;
|
||||
};
|
||||
|
||||
|
||||
@@ -141,13 +141,6 @@ TranslatorX64::irCheckType(X64Assembler& a,
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
TranslatorX64::irEmitLoadDeps() {
|
||||
assert(m_useHHIR);
|
||||
m_hhbcTrans->emitLoadDeps();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TranslatorX64::irTranslateMod(const Tracelet& t,
|
||||
const NormalizedInstruction& i) {
|
||||
|
||||
@@ -11036,10 +11036,6 @@ TranslatorX64::emitGuardChecks(X64Assembler& a,
|
||||
}
|
||||
}
|
||||
|
||||
if (m_useHHIR) {
|
||||
irEmitLoadDeps();
|
||||
}
|
||||
|
||||
checkRefs(a, sk, refDeps, fail);
|
||||
|
||||
if (Trace::moduleEnabled(Trace::stats, 2)) {
|
||||
|
||||
@@ -844,7 +844,6 @@ private:
|
||||
SrcRec& fail);
|
||||
void irCheckType(Asm&, const Location& l, const RuntimeType& rtt,
|
||||
SrcRec& fail);
|
||||
void irEmitLoadDeps();
|
||||
|
||||
void checkRefs(Asm&, SrcKey, const RefDeps&, SrcRec&);
|
||||
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário