aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-10-29 08:17:54 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-29 14:06:11 +0100
commit61be39a01b4d3348161472260efef14f8a6e7896 (patch)
treea1e150e73203880ac0d82ec9a684fdcf8938b206 /src/qml
parentcfe24c1aa0f3ec168437cd22e355c28e5e7a4f09 (diff)
Remove the LoadValue instruction
With the constant table this is exactly the same as a move. Also renamed MoveTemp to Move, as it not only moves Temps but also other variables. Change-Id: I1fccc04314661954179d903519adbc39777395e5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/compiler/qv4instr_moth_p.h13
-rw-r--r--src/qml/compiler/qv4isel_moth.cpp24
-rw-r--r--src/qml/jsruntime/qv4vme_moth.cpp9
3 files changed, 17 insertions, 29 deletions
diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h
index 795576b2a9..f1108ff863 100644
--- a/src/qml/compiler/qv4instr_moth_p.h
+++ b/src/qml/compiler/qv4instr_moth_p.h
@@ -51,11 +51,10 @@ QT_BEGIN_NAMESPACE
#define FOR_EACH_MOTH_INSTR(F) \
F(Ret, ret) \
- F(LoadValue, loadValue) \
F(LoadRuntimeString, loadRuntimeString) \
F(LoadRegExp, loadRegExp) \
F(LoadClosure, loadClosure) \
- F(MoveTemp, moveTemp) \
+ F(Move, move) \
F(SwapTemps, swapTemps) \
F(LoadName, loadName) \
F(StoreName, storeName) \
@@ -206,11 +205,6 @@ union Instr
MOTH_INSTR_HEADER
Param result;
};
- struct instr_loadValue {
- MOTH_INSTR_HEADER
- Param value;
- Param result;
- };
struct instr_loadRuntimeString {
MOTH_INSTR_HEADER
int stringId;
@@ -221,7 +215,7 @@ union Instr
int regExpId;
Param result;
};
- struct instr_moveTemp {
+ struct instr_move {
MOTH_INSTR_HEADER
Param source;
Param result;
@@ -487,10 +481,9 @@ union Instr
instr_common common;
instr_ret ret;
- instr_loadValue loadValue;
instr_loadRuntimeString loadRuntimeString;
instr_loadRegExp loadRegExp;
- instr_moveTemp moveTemp;
+ instr_move move;
instr_swapTemps swapTemps;
instr_loadClosure loadClosure;
instr_loadName loadName;
diff --git a/src/qml/compiler/qv4isel_moth.cpp b/src/qml/compiler/qv4isel_moth.cpp
index 295227cb97..c2fae823f5 100644
--- a/src/qml/compiler/qv4isel_moth.cpp
+++ b/src/qml/compiler/qv4isel_moth.cpp
@@ -423,10 +423,10 @@ void InstructionSelection::loadConst(V4IR::Const *sourceConst, V4IR::Temp *targe
{
assert(sourceConst);
- Instruction::LoadValue load;
- load.value = getParam(sourceConst);
- load.result = getResultParam(targetTemp);
- addInstruction(load);
+ Instruction::Move move;
+ move.source = getParam(sourceConst);
+ move.result = getResultParam(targetTemp);
+ addInstruction(move);
}
void InstructionSelection::loadString(const QString &str, V4IR::Temp *targetTemp)
@@ -513,7 +513,7 @@ void InstructionSelection::copyValue(V4IR::Temp *sourceTemp, V4IR::Temp *targetT
if (_stackSlotAllocator)
_stackSlotAllocator->addHint(*sourceTemp, *targetTemp);
- Instruction::MoveTemp move;
+ Instruction::Move move;
move.source = getParam(sourceTemp);
move.result = getResultParam(targetTemp);
if (move.source != move.result)
@@ -633,7 +633,7 @@ void InstructionSelection::prepareCallArgs(V4IR::ExprList *e, quint32 &argc, qui
// We need to move all the temps into the function arg array
assert(argLocation >= 0);
while (e) {
- Instruction::MoveTemp move;
+ Instruction::Move move;
move.source = getParam(e->expr);
move.result = Param::createTemp(argLocation);
addInstruction(move);
@@ -773,11 +773,11 @@ void InstructionSelection::callBuiltinDeleteName(const QString &name, V4IR::Temp
void InstructionSelection::callBuiltinDeleteValue(V4IR::Temp *result)
{
- Instruction::LoadValue load;
+ Instruction::Move move;
int idx = jsUnitGenerator()->registerConstant(QV4::Encode(false));
- load.value = Param::createConstant(idx);
- load.result = getResultParam(result);
- addInstruction(load);
+ move.source = Param::createConstant(idx);
+ move.result = getResultParam(result);
+ addInstruction(move);
}
void InstructionSelection::callBuiltinThrow(V4IR::Expr *arg)
@@ -896,7 +896,7 @@ void InstructionSelection::callBuiltinDefineObjectLiteral(V4IR::Temp *result, V4
bool isData = it->expr->asConst()->value;
it = it->next;
- Instruction::MoveTemp move;
+ Instruction::Move move;
move.source = getParam(it->expr);
move.result = Param::createTemp(argLocation);
addInstruction(move);
@@ -905,7 +905,7 @@ void InstructionSelection::callBuiltinDefineObjectLiteral(V4IR::Temp *result, V4
if (!isData) {
it = it->next;
- Instruction::MoveTemp move;
+ Instruction::Move move;
move.source = getParam(it->expr);
move.result = Param::createTemp(argLocation);
addInstruction(move);
diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp
index a36d1d870a..5ec982cae2 100644
--- a/src/qml/jsruntime/qv4vme_moth.cpp
+++ b/src/qml/jsruntime/qv4vme_moth.cpp
@@ -264,19 +264,14 @@ QV4::ReturnedValue VME::run(QV4::ExecutionContext *context, const uchar *code,
switch (genericInstr->common.instructionType) {
#endif
- MOTH_BEGIN_INSTR(MoveTemp)
+ MOTH_BEGIN_INSTR(Move)
VALUE(instr.result) = VALUE(instr.source);
- MOTH_END_INSTR(MoveTemp)
+ MOTH_END_INSTR(Move)
MOTH_BEGIN_INSTR(SwapTemps)
qSwap(VALUE(instr.left), VALUE(instr.right));
MOTH_END_INSTR(MoveTemp)
- MOTH_BEGIN_INSTR(LoadValue)
-// TRACE(value, "%s", instr.value.toString(context)->toQString().toUtf8().constData());
- VALUE(instr.result) = VALUE(instr.value);
- MOTH_END_INSTR(LoadValue)
-
MOTH_BEGIN_INSTR(LoadRuntimeString)
// TRACE(value, "%s", instr.value.toString(context)->toQString().toUtf8().constData());
VALUE(instr.result) = runtimeStrings[instr.stringId].asReturnedValue();