diff options
author | Erik Verbruggen <erik.verbruggen@qt.io> | 2017-08-03 11:20:01 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2017-08-03 11:15:38 +0000 |
commit | eabcd4c2dd15e120aa5b79eb66a2af394e3a55c1 (patch) | |
tree | da270d2dba7d2c75f1e06dac39fa7464d5b9d82e /src/qml/compiler/qv4compilercontrolflow_p.h | |
parent | 3a05ac0ed2f78c44721d72c0eb38130ca241e70f (diff) |
Rename a number of types from Temp(orary) to StackSlot
As a preparation to also store arguments on the stack, just like the
temporaries.
Change-Id: If3a6ed56930e29ad77c992811065bb32ee2d030c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compilercontrolflow_p.h')
-rw-r--r-- | src/qml/compiler/qv4compilercontrolflow_p.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/qml/compiler/qv4compilercontrolflow_p.h b/src/qml/compiler/qv4compilercontrolflow_p.h index 76063bc214..5080b4e595 100644 --- a/src/qml/compiler/qv4compilercontrolflow_p.h +++ b/src/qml/compiler/qv4compilercontrolflow_p.h @@ -105,7 +105,7 @@ struct ControlFlow { void jumpToHandler(const Handler &h) { if (h.tempIndex >= 0) - Reference::storeConstInTemp(cg, QV4::Encode(h.value), h.tempIndex); + Reference::storeConstOnStack(cg, QV4::Encode(h.value), h.tempIndex); cg->bytecodeGenerator->jump().link(h.linkLabel); } @@ -147,8 +147,8 @@ struct ControlFlow { Reference e = expr; Handler h = getHandler(ControlFlow::Throw); if (h.tempIndex >= 0) { - e = e.storeInTemp(); - Reference::storeConstInTemp(cg, QV4::Encode(h.value), h.tempIndex); + e = e.storeOnStack(); + Reference::storeConstOnStack(cg, QV4::Encode(h.value), h.tempIndex); } e.loadInAccumulator(); Instruction::CallBuiltinThrow instr; @@ -215,7 +215,7 @@ struct ControlFlowUnwind : public ControlFlow { Q_ASSERT(type != Loop); controlFlowTemp = static_cast<int>(generator()->newTemp()); - Reference::storeConstInTemp(cg, QV4::Encode::undefined(), controlFlowTemp); + Reference::storeConstOnStack(cg, QV4::Encode::undefined(), controlFlowTemp); // we'll need at least a handler for throw getHandler(Throw); } @@ -224,7 +224,7 @@ struct ControlFlowUnwind : public ControlFlow { Q_ASSERT(!isSimple()); - Reference temp = Reference::fromTemp(cg, controlFlowTemp); + Reference temp = Reference::fromStackSlot(cg, controlFlowTemp); for (const auto &h : qAsConst(handlers)) { Codegen::TempScope tempScope(cg); Handler parentHandler = getParentHandler(h.type, h.label); @@ -232,15 +232,15 @@ struct ControlFlowUnwind : public ControlFlow if (h.type == Throw || parentHandler.tempIndex >= 0) { BytecodeGenerator::Label skip = generator()->newLabel(); Reference::fromConst(cg, QV4::Encode(h.value)).loadInAccumulator(); - generator()->jumpStrictNotEqual(temp.temp()).link(skip); + generator()->jumpStrictNotEqual(temp.stackSlot()).link(skip); if (h.type == Throw) emitForThrowHandling(); - Reference::storeConstInTemp(cg, QV4::Encode(parentHandler.value), parentHandler.tempIndex); + Reference::storeConstOnStack(cg, QV4::Encode(parentHandler.value), parentHandler.tempIndex); generator()->jump().link(parentHandler.linkLabel); skip.link(); } else { Reference::fromConst(cg, QV4::Encode(h.value)).loadInAccumulator(); - generator()->jumpStrictEqual(temp.temp()).link(parentHandler.linkLabel); + generator()->jumpStrictEqual(temp.stackSlot()).link(parentHandler.linkLabel); } } } @@ -337,7 +337,7 @@ struct ControlFlowCatch : public ControlFlowUnwind pushCatchScope.name = name.unqualifiedNameIndex; generator()->addInstruction(pushCatchScope); // clear the unwind temp for exceptions, we want to resume normal code flow afterwards - Reference::storeConstInTemp(cg, QV4::Encode::undefined(), controlFlowTemp); + Reference::storeConstOnStack(cg, QV4::Encode::undefined(), controlFlowTemp); generator()->setExceptionHandler(&catchUnwindLabel); cg->statement(catchExpression->statement); @@ -393,7 +393,7 @@ struct ControlFlowFinally : public ControlFlowUnwind exceptionTemp = generator()->newTemp(); Instruction::GetException instr; generator()->addInstruction(instr); - Reference::fromTemp(cg, exceptionTemp).storeConsumeAccumulator(); + Reference::fromStackSlot(cg, exceptionTemp).storeConsumeAccumulator(); generator()->setExceptionHandler(parentExceptionHandler()); cg->statement(finally->statement); @@ -404,7 +404,7 @@ struct ControlFlowFinally : public ControlFlowUnwind virtual void emitForThrowHandling() { // reset the exception flag, that got cleared before executing the statements in finally - Reference::fromTemp(cg, exceptionTemp).loadInAccumulator(); + Reference::fromStackSlot(cg, exceptionTemp).loadInAccumulator(); Instruction::SetException setException; Q_ASSERT(exceptionTemp != -1); generator()->addInstruction(setException); |