diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-03-13 01:01:04 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-03-13 10:10:09 +0100 |
commit | 76be4abbbcfb2fbb14ce532413e0895198e7f0f1 (patch) | |
tree | 5d6ca9c4425df15a93b6f74dc8e4dbb38db74d91 /src/qml/compiler/qv4codegen.cpp | |
parent | 587d789fa5929f462b5744ba33a25db6c77b36fc (diff) | |
parent | 70d726e91e4ef27002b2271805de19077e25809c (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
src/qml/compiler/qv4codegen.cpp
src/qml/animations/qsequentialanimationgroupjob.cpp
Change-Id: I8b76e509fd7c8599d4cef25181d790ee28edab54
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
-rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index 17869bcc84..ac763e592f 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -727,9 +727,6 @@ void Codegen::destructureElementList(const Codegen::Reference &array, PatternEle bytecodeGenerator->addInstruction(iteratorObjInstr); iterator.storeConsumeAccumulator(); - bool hasRest = false; - - BytecodeGenerator::Label end = bytecodeGenerator->newLabel(); { auto cleanup = [this, iterator, iteratorDone]() { iterator.loadInAccumulator(); @@ -760,27 +757,17 @@ void Codegen::destructureElementList(const Codegen::Reference &array, PatternEle Reference::fromConst(this, Encode(true)).storeOnStack(iteratorDone.stackSlot()); bytecodeGenerator->addInstruction(Instruction::DestructureRestElement()); initializeAndDestructureBindingElement(e, Reference::fromAccumulator(this), isDefinition); - hasRest = true; } else { Instruction::IteratorNext next; next.value = iteratorValue.stackSlot(); next.done = iteratorDone.stackSlot(); bytecodeGenerator->addInstruction(next); initializeAndDestructureBindingElement(e, iteratorValue, isDefinition); - if (hasError) { - end.link(); + if (hasError) return; - } } } - - if (hasRest) - // no need to close the iterator - bytecodeGenerator->jump().link(end); } - - - end.link(); } void Codegen::destructurePattern(Pattern *p, const Reference &rhs) @@ -1220,7 +1207,6 @@ bool Codegen::visit(ArrayPattern *ast) BytecodeGenerator::Label in = bytecodeGenerator->newLabel(); BytecodeGenerator::Label end = bytecodeGenerator->newLabel(); - BytecodeGenerator::Label done = bytecodeGenerator->newLabel(); { auto cleanup = [this, iterator, iteratorDone]() { @@ -1230,12 +1216,6 @@ bool Codegen::visit(ArrayPattern *ast) bytecodeGenerator->addInstruction(close); }; ControlFlowLoop flow(this, &end, &in, cleanup); - bytecodeGenerator->jump().link(in); - - BytecodeGenerator::Label body = bytecodeGenerator->label(); - - lhsValue.loadInAccumulator(); - pushAccumulator(); in.link(); iterator.loadInAccumulator(); @@ -1243,13 +1223,14 @@ bool Codegen::visit(ArrayPattern *ast) next.value = lhsValue.stackSlot(); next.done = iteratorDone.stackSlot(); bytecodeGenerator->addInstruction(next); - bytecodeGenerator->addTracingJumpInstruction(Instruction::JumpFalse()).link(body); - bytecodeGenerator->jump().link(done); + bytecodeGenerator->addTracingJumpInstruction(Instruction::JumpTrue()).link(end); + lhsValue.loadInAccumulator(); + pushAccumulator(); + + bytecodeGenerator->jump().link(in); end.link(); } - - done.link(); } else { RegisterScope innerScope(this); Reference expr = expression(it->element->initializer); |