Bug 976047 - Simplify jsanalyze.cpp now that locals no longer alias the stack r=jandem

This commit is contained in:
Andy Wingo 2014-02-25 18:46:13 +01:00
parent 0cb6db1009
commit dcf55cb68d
2 changed files with 2 additions and 22 deletions

View File

@ -664,8 +664,7 @@ ScriptAnalysis::trackUseChain(const SSAValue &v)
}
/*
* Get the use chain for an SSA value. May be invalid for some opcodes in
* scripts where localsAliasStack(). You have been warned!
* Get the use chain for an SSA value.
*/
inline SSAUseChain *&
ScriptAnalysis::useChain(const SSAValue &v)
@ -934,10 +933,6 @@ ScriptAnalysis::analyzeBytecode(JSContext *cx)
JS_ASSERT(GET_LOCALNO(pc) < script_->nfixed());
break;
case JSOP_PUSHBLOCKSCOPE:
localsAliasStack_ = true;
break;
default:
break;
}
@ -2297,13 +2292,6 @@ ScriptAnalysis::needsArgsObj(JSContext *cx)
if (script_->bindingsAccessedDynamically())
return false;
/*
* Since let variables and are not tracked, we cannot soundly perform this
* analysis in their presence.
*/
if (localsAliasStack())
return true;
unsigned pcOff = script_->pcToOffset(script_->argumentsBytecode());
SeenVector seen(cx);

View File

@ -60,7 +60,6 @@ class ScriptAnalysis
/* --------- Bytecode analysis --------- */
bool localsAliasStack_:1;
bool canTrackVars:1;
bool argumentsContentsObserved_:1;
@ -80,12 +79,6 @@ class ScriptAnalysis
MOZ_WARN_UNUSED_RESULT
bool analyzeBytecode(JSContext *cx);
/*
* True if there are any LOCAL opcodes aliasing values on the stack (above
* script_->nfixed).
*/
bool localsAliasStack() { return localsAliasStack_; }
bool isReachable(const jsbytecode *pc) { return maybeCode(pc); }
private:
@ -120,8 +113,7 @@ class ScriptAnalysis
inline bool trackUseChain(const SSAValue &v);
/*
* Get the use chain for an SSA value. May be invalid for some opcodes in
* scripts where localsAliasStack(). You have been warned!
* Get the use chain for an SSA value.
*/
inline SSAUseChain *& useChain(const SSAValue &v);