aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4isel_moth.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-09-11 19:05:24 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2013-09-11 19:08:28 +0200
commit89402e0ef69da3c954a540510e8b4e8501bc1ce3 (patch)
treecf97d95e1ac837e5d439f2be9125e0a104b5bbce /src/qml/compiler/qv4isel_moth.cpp
parent0cce947449fa502fd4bf2aec95fa490c8417cdeb (diff)
parent262d7261033df7650938c38401112a4767d926ff (diff)
Merge branch 'dev' of qtdeclarative into wip/v4
Conflicts: src/qml/jsruntime/qv4script.cpp Change-Id: I20136cab29d86862b5bd9208003200bc24bcdacf
Diffstat (limited to 'src/qml/compiler/qv4isel_moth.cpp')
-rw-r--r--src/qml/compiler/qv4isel_moth.cpp46
1 files changed, 21 insertions, 25 deletions
diff --git a/src/qml/compiler/qv4isel_moth.cpp b/src/qml/compiler/qv4isel_moth.cpp
index d4dc5460b7..67433070f6 100644
--- a/src/qml/compiler/qv4isel_moth.cpp
+++ b/src/qml/compiler/qv4isel_moth.cpp
@@ -310,7 +310,8 @@ QV4::CompiledData::CompilationUnit *InstructionSelection::backendCompileStep()
void InstructionSelection::callValue(V4IR::Temp *value, V4IR::ExprList *args, V4IR::Temp *result)
{
Instruction::CallValue call;
- prepareCallArgs(args, call.argc, call.args);
+ prepareCallArgs(args, call.argc);
+ call.callData = callDataStart();
call.dest = getParam(value);
call.result = getResultParam(result);
addInstruction(call);
@@ -323,7 +324,8 @@ void InstructionSelection::callProperty(V4IR::Expr *base, const QString &name, V
Instruction::CallProperty call;
call.base = getParam(base);
call.name = registerString(name);
- prepareCallArgs(args, call.argc, call.args);
+ prepareCallArgs(args, call.argc);
+ call.callData = callDataStart();
call.result = getResultParam(result);
addInstruction(call);
}
@@ -335,7 +337,8 @@ void InstructionSelection::callSubscript(V4IR::Expr *base, V4IR::Expr *index, V4
Instruction::CallElement call;
call.base = getParam(base);
call.index = getParam(index);
- prepareCallArgs(args, call.argc, call.args);
+ prepareCallArgs(args, call.argc);
+ call.callData = callDataStart();
call.result = getResultParam(result);
addInstruction(call);
}
@@ -358,7 +361,8 @@ void InstructionSelection::constructActivationProperty(V4IR::Name *func,
{
Instruction::CreateActivationProperty create;
create.name = registerString(*func->id);
- prepareCallArgs(args, create.argc, create.args);
+ prepareCallArgs(args, create.argc);
+ create.callData = callDataStart();
create.result = getResultParam(result);
addInstruction(create);
}
@@ -368,7 +372,8 @@ void InstructionSelection::constructProperty(V4IR::Temp *base, const QString &na
Instruction::CreateProperty create;
create.base = getParam(base);
create.name = registerString(name);
- prepareCallArgs(args, create.argc, create.args);
+ prepareCallArgs(args, create.argc);
+ create.callData = callDataStart();
create.result = getResultParam(result);
addInstruction(create);
}
@@ -377,7 +382,8 @@ void InstructionSelection::constructValue(V4IR::Temp *value, V4IR::ExprList *arg
{
Instruction::CreateValue create;
create.func = getParam(value);
- prepareCallArgs(args, create.argc, create.args);
+ prepareCallArgs(args, create.argc);
+ create.callData = callDataStart();
create.result = getResultParam(result);
addInstruction(create);
}
@@ -666,23 +672,15 @@ void InstructionSelection::inplaceMemberOp(V4IR::AluOp oper, V4IR::Temp *source,
addInstruction(imo);
}
-void InstructionSelection::prepareCallArgs(V4IR::ExprList *e, quint32 &argc, quint32 &args)
+void InstructionSelection::prepareCallArgs(V4IR::ExprList *e, quint32 &argc, quint32 *args)
{
- bool singleArgIsTemp = false;
- if (e && e->next == 0 && e->expr->asTemp()) {
- singleArgIsTemp = e->expr->asTemp()->kind == V4IR::Temp::VirtualRegister;
- }
-
- if (singleArgIsTemp) {
- // We pass single arguments as references to the stack, but only if it's not a local or an argument.
- argc = 1;
- args = getParam(e->expr).index;
- } else if (e) {
+ int argLocation = outgoingArgumentTempStart();
+ argc = 0;
+ if (args)
+ *args = argLocation;
+ if (e) {
// We need to move all the temps into the function arg array
- int argLocation = outgoingArgumentTempStart();
assert(argLocation >= 0);
- argc = 0;
- args = argLocation;
while (e) {
Instruction::MoveTemp move;
move.source = getParam(e->expr);
@@ -692,9 +690,6 @@ void InstructionSelection::prepareCallArgs(V4IR::ExprList *e, quint32 &argc, qui
++argc;
e = e->next;
}
- } else {
- argc = 0;
- args = 0;
}
}
@@ -762,7 +757,8 @@ void InstructionSelection::callBuiltinInvalid(V4IR::Name *func, V4IR::ExprList *
{
Instruction::CallActivationProperty call;
call.name = registerString(*func->id);
- prepareCallArgs(args, call.argc, call.args);
+ prepareCallArgs(args, call.argc);
+ call.callData = callDataStart();
call.result = getResultParam(result);
addInstruction(call);
}
@@ -979,7 +975,7 @@ void InstructionSelection::callBuiltinDefineProperty(V4IR::Temp *object, const Q
void InstructionSelection::callBuiltinDefineArray(V4IR::Temp *result, V4IR::ExprList *args)
{
Instruction::CallBuiltinDefineArray call;
- prepareCallArgs(args, call.argc, call.args);
+ prepareCallArgs(args, call.argc, &call.args);
call.result = getResultParam(result);
addInstruction(call);
}