aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4isel_moth.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2015-06-22 07:46:32 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-08-10 01:22:05 +0000
commitf21e8c641af6b2d10f0d7e7e0fc6a755dab3673c (patch)
treeb3b430f88fc83f57d0413a7723ee35aa715f795c /src/qml/compiler/qv4isel_moth.cpp
parentb2889568170b20ca8f870a7f4a1a1c3ac9f698c5 (diff)
Access context properties through the qml context
And get rid of another temp in the IR. Change-Id: I039393e020e5141f1986aee276246c30fd8057f3 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/compiler/qv4isel_moth.cpp')
-rw-r--r--src/qml/compiler/qv4isel_moth.cpp27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/qml/compiler/qv4isel_moth.cpp b/src/qml/compiler/qv4isel_moth.cpp
index e90dab341a..4830f01152 100644
--- a/src/qml/compiler/qv4isel_moth.cpp
+++ b/src/qml/compiler/qv4isel_moth.cpp
@@ -471,6 +471,14 @@ void InstructionSelection::callQmlContextProperty(IR::Expr *base, IR::Member::Me
call.callData = callDataStart();
call.result = getResultParam(result);
addInstruction(call);
+ } else if (kind == IR::Member::MemberOfQmlContextObject) {
+ Instruction::CallContextObjectProperty call;
+ call.base = getParam(base);
+ call.index = propertyIndex;
+ prepareCallArgs(args, call.argc);
+ call.callData = callDataStart();
+ call.result = getResultParam(result);
+ addInstruction(call);
} else {
Q_ASSERT(false);
}
@@ -601,13 +609,6 @@ void InstructionSelection::loadQmlImportedScripts(IR::Expr *e)
addInstruction(load);
}
-void InstructionSelection::loadQmlContextObject(IR::Expr *e)
-{
- Instruction::LoadQmlContextObject load;
- load.result = getResultParam(e);
- addInstruction(load);
-}
-
void InstructionSelection::loadQmlSingleton(const QString &name, IR::Expr *e)
{
Instruction::LoadQmlSingleton load;
@@ -717,6 +718,12 @@ void InstructionSelection::setQmlContextProperty(IR::Expr *source, IR::Expr *tar
store.propertyIndex = propertyIndex;
store.source = getParam(source);
addInstruction(store);
+ } else if (kind == IR::Member::MemberOfQmlContextObject) {
+ Instruction::StoreContextObjectProperty store;
+ store.base = getParam(targetBase);
+ store.propertyIndex = propertyIndex;
+ store.source = getParam(source);
+ addInstruction(store);
} else {
Q_ASSERT(false);
}
@@ -739,6 +746,12 @@ void InstructionSelection::getQmlContextProperty(IR::Expr *source, IR::Member::M
load.propertyIndex = index;
load.result = getResultParam(target);
addInstruction(load);
+ } else if (kind == IR::Member::MemberOfQmlContextObject) {
+ Instruction::LoadContextObjectProperty load;
+ load.base = getParam(source);
+ load.propertyIndex = index;
+ load.result = getResultParam(target);
+ addInstruction(load);
} else {
Q_ASSERT(false);
}