Bug 1382973 part 6 - Remove BytecodeAnalysis::hasTryFinally(). r=nbp

This commit is contained in:
Jan de Mooij 2017-07-22 14:24:29 +02:00
Родитель 43ea58d683
Коммит 15ec672035
4 изменённых файлов: 15 добавлений и 12 удалений

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

@ -17,8 +17,7 @@ using namespace js::jit;
BytecodeAnalysis::BytecodeAnalysis(TempAllocator& alloc, JSScript* script)
: script_(script),
infos_(alloc),
usesEnvironmentChain_(false),
hasTryFinally_(false)
usesEnvironmentChain_(false)
{
}
@ -179,10 +178,6 @@ BytecodeAnalysis::init(TempAllocator& alloc, GSNCache& gsn)
usesEnvironmentChain_ = true;
break;
case JSOP_FINALLY:
hasTryFinally_ = true;
break;
default:
break;
}

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

@ -3022,9 +3022,8 @@ IonBuilder::visitCompare(CFGCompare* compare)
AbortReasonOr<Ok>
IonBuilder::visitTry(CFGTry* try_)
{
// Try-finally is not yet supported.
if (analysis().hasTryFinally())
return abort(AbortReason::Disable, "Has try-finally");
// We don't support try-finally. The ControlFlowGenerator should have
// aborted compilation in this case.
// Try-catch within inline frames is not yet supported.
MOZ_ASSERT(!isInlineBuilder());

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

@ -23,7 +23,8 @@ ControlFlowGenerator::ControlFlowGenerator(TempAllocator& temp, JSScript* script
switches_(temp),
labels_(temp),
analysis_(temp, script),
aborted_(false)
aborted_(false),
checkedTryFinally_(false)
{ }
bool
@ -539,8 +540,15 @@ ControlFlowGenerator::processTry()
MOZ_ASSERT(JSOp(*pc) == JSOP_TRY);
// Try-finally is not yet supported.
if (analysis_.hasTryFinally())
return ControlStatus::Abort;
if (!checkedTryFinally_) {
JSTryNote* tn = script->trynotes()->vector;
JSTryNote* tnlimit = tn + script->trynotes()->length;
for (; tn < tnlimit; tn++) {
if (tn->kind == JSTRY_FINALLY)
return ControlStatus::Abort;
}
checkedTryFinally_ = true;
}
jssrcnote* sn = GetSrcNote(gsn, script, pc);
MOZ_ASSERT(SN_TYPE(sn) == SRC_TRY);

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

@ -811,6 +811,7 @@ class ControlFlowGenerator
Vector<ControlFlowInfo, 2, JitAllocPolicy> labels_;
BytecodeAnalysis analysis_;
bool aborted_;
bool checkedTryFinally_;
public:
ControlFlowGenerator(TempAllocator& alloc, JSScript* script);