Bug 1619878 - Remove FlowsIntoNext and use BytecodeFallsThrough instead. r=arai

BytecodeFallsThrough is a bit more complete.

Differential Revision: https://phabricator.services.mozilla.com/D65298

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jan de Mooij 2020-03-04 10:54:33 +00:00
Родитель 2dc50159a6
Коммит 8dabadedd1
3 изменённых файлов: 6 добавлений и 21 удалений

Просмотреть файл

@ -1102,7 +1102,7 @@ class FlowGraphSummary {
size_t column = prevColumn;
JSOp op = r.frontOpcode();
if (FlowsIntoNext(prevOp)) {
if (BytecodeFallsThrough(prevOp)) {
addEdge(prevLineno, prevColumn, r.frontOffset());
}

Просмотреть файл

@ -3038,7 +3038,7 @@ bool js::GetSuccessorBytecodes(JSScript* script, jsbytecode* pc,
MOZ_ASSERT(script->containsPC(pc));
JSOp op = (JSOp)*pc;
if (FlowsIntoNext(op)) {
if (BytecodeFallsThrough(op)) {
if (!successors.append(GetNextPc(pc))) {
return false;
}

Просмотреть файл

@ -374,19 +374,20 @@ static inline uint32_t JOF_OPTYPE(JSOp op) {
static inline bool IsJumpOpcode(JSOp op) { return JOF_OPTYPE(op) == JOF_JUMP; }
static inline bool BytecodeFallsThrough(JSOp op) {
// Note:
// * JSOp::Yield/JSOp::Await is considered to fall through, like JSOp::Call.
// * JSOp::Gosub falls through indirectly, after executing a 'finally'.
switch (op) {
case JSOp::Goto:
case JSOp::Default:
case JSOp::Return:
case JSOp::RetRval:
case JSOp::Retsub:
case JSOp::FinalYieldRval:
case JSOp::Throw:
case JSOp::ThrowMsg:
case JSOp::TableSwitch:
return false;
case JSOp::Gosub:
/* These fall through indirectly, after executing a 'finally'. */
return true;
default:
return true;
}
@ -530,22 +531,6 @@ static inline bool BytecodeFlowsToBitop(jsbytecode* pc) {
extern bool IsValidBytecodeOffset(JSContext* cx, JSScript* script,
size_t offset);
inline bool FlowsIntoNext(JSOp op) {
// JSOp::Yield/JSOp::Await is considered to flow into the next instruction,
// like JSOp::Call.
switch (op) {
case JSOp::RetRval:
case JSOp::Return:
case JSOp::Throw:
case JSOp::Goto:
case JSOp::Retsub:
case JSOp::FinalYieldRval:
return false;
default:
return true;
}
}
inline bool IsArgOp(JSOp op) { return JOF_OPTYPE(op) == JOF_QARG; }
inline bool IsLocalOp(JSOp op) { return JOF_OPTYPE(op) == JOF_LOCAL; }