aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4isel_moth.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@live.com>2014-07-23 12:43:38 -0500
committerMichael Brasser <michael.brasser@live.com>2014-08-07 21:36:27 +0200
commitb42c8c4de293af0b6e9c0691daa835939b54d4e1 (patch)
tree0df0321298af530c95d085063500799d82f7aaa4 /src/qml/compiler/qv4isel_moth.cpp
parentee616b3905106a3eedef9ee964ab283ef45c7dbc (diff)
Accelerate property lookups for C++-based QObject singletons.
Change-Id: Icbdf06a077014db5dd57cba42f84591433ec4196 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4isel_moth.cpp')
-rw-r--r--src/qml/compiler/qv4isel_moth.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4isel_moth.cpp b/src/qml/compiler/qv4isel_moth.cpp
index 7c67ae2301..958dfc7fbb 100644
--- a/src/qml/compiler/qv4isel_moth.cpp
+++ b/src/qml/compiler/qv4isel_moth.cpp
@@ -713,7 +713,7 @@ void InstructionSelection::setQObjectProperty(IR::Expr *source, IR::Expr *target
addInstruction(store);
}
-void InstructionSelection::getQObjectProperty(IR::Expr *base, int propertyIndex, bool captureRequired, int attachedPropertiesId, IR::Expr *target)
+void InstructionSelection::getQObjectProperty(IR::Expr *base, int propertyIndex, bool captureRequired, bool isSingletonProperty, int attachedPropertiesId, IR::Expr *target)
{
if (attachedPropertiesId != 0) {
Instruction::LoadAttachedQObjectProperty load;
@@ -721,6 +721,13 @@ void InstructionSelection::getQObjectProperty(IR::Expr *base, int propertyIndex,
load.result = getResultParam(target);
load.attachedPropertiesId = attachedPropertiesId;
addInstruction(load);
+ } else if (isSingletonProperty) {
+ Instruction::LoadSingletonQObjectProperty load;
+ load.base = getParam(base);
+ load.propertyIndex = propertyIndex;
+ load.result = getResultParam(target);
+ load.captureRequired = captureRequired;
+ addInstruction(load);
} else {
Instruction::LoadQObjectProperty load;
load.base = getParam(base);