diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2016-07-12 15:11:03 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2016-07-14 08:49:45 +0000 |
commit | cc7cf5f5705553b625c1b28b49c41587b587bb38 (patch) | |
tree | 48f88de93edc2acc79601dfa2e38102b040f8db3 /src/qml/compiler/qv4isel_moth.cpp | |
parent | be491913c036b148cd4f90fa0132e269a507dbad (diff) | |
download | qtdeclarative-cc7cf5f5705553b625c1b28b49c41587b587bb38.tar.gz |
Revert "QML: When available, use QQmlAccessors to read properties."
This reverts commit f6fee09942de7901a708c4e16db0c7c82550e8c5. The accessor
pointers were embedded in the generated machine/byte code, which makes it
non-relocatable. As discussed, for the moment the ability to have relocatable
code is prioritized. But the goal is to re-enable accessor accelerated property
access through lookups.
Change-Id: I18ec9ce31901c1fae3e58ac0c41bc87791e8c380
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4isel_moth.cpp')
-rw-r--r-- | src/qml/compiler/qv4isel_moth.cpp | 104 |
1 files changed, 4 insertions, 100 deletions
diff --git a/src/qml/compiler/qv4isel_moth.cpp b/src/qml/compiler/qv4isel_moth.cpp index 967dca13a1..8814ad8a78 100644 --- a/src/qml/compiler/qv4isel_moth.cpp +++ b/src/qml/compiler/qv4isel_moth.cpp @@ -46,8 +46,6 @@ #include <private/qv4regexpobject_p.h> #include <private/qv4compileddata_p.h> #include <private/qqmlengine_p.h> -#include "qml/qqmlaccessors_p.h" -#include "qml/qqmlpropertycache_p.h" #undef USE_TYPE_INFO @@ -739,51 +737,8 @@ void InstructionSelection::setQObjectProperty(IR::Expr *source, IR::Expr *target addInstruction(store); } -void InstructionSelection::getQmlContextProperty(IR::Expr *source, IR::Member::MemberKind kind, - QQmlPropertyData *property, int index, - IR::Expr *target) -{ - if (property && property->hasAccessors() && property->isFullyResolved()) { - if (kind == IR::Member::MemberOfQmlScopeObject) { - if (property->propType == QMetaType::QReal) { - Instruction::LoadScopeObjectQRealPropertyDirectly load; - load.base = getParam(source); - load.accessors = property->accessors; - load.result = getResultParam(target); - addInstruction(load); - return; - } else if (property->isQObject()) { - Instruction::LoadScopeObjectQObjectPropertyDirectly load; - load.base = getParam(source); - load.accessors = property->accessors; - load.result = getResultParam(target); - addInstruction(load); - return; - } else if (property->propType == QMetaType::Int) { - Instruction::LoadScopeObjectIntPropertyDirectly load; - load.base = getParam(source); - load.accessors = property->accessors; - load.result = getResultParam(target); - addInstruction(load); - return; - } else if (property->propType == QMetaType::Bool) { - Instruction::LoadScopeObjectBoolPropertyDirectly load; - load.base = getParam(source); - load.accessors = property->accessors; - load.result = getResultParam(target); - addInstruction(load); - return; - } else if (property->propType == QMetaType::QString) { - Instruction::LoadScopeObjectQStringPropertyDirectly load; - load.base = getParam(source); - load.accessors = property->accessors; - load.result = getResultParam(target); - addInstruction(load); - return; - } - } - } - +void InstructionSelection::getQmlContextProperty(IR::Expr *source, IR::Member::MemberKind kind, int index, IR::Expr *target) +{ if (kind == IR::Member::MemberOfQmlScopeObject) { Instruction::LoadScopeObjectProperty load; load.base = getParam(source); @@ -807,59 +762,8 @@ void InstructionSelection::getQmlContextProperty(IR::Expr *source, IR::Member::M } } -void InstructionSelection::getQObjectProperty(IR::Expr *base, QQmlPropertyData *property, bool captureRequired, bool isSingletonProperty, int attachedPropertiesId, IR::Expr *target) -{ - if (property && property->hasAccessors() && property->isFullyResolved()) { - if (!attachedPropertiesId && !isSingletonProperty) { - if (property->propType == QMetaType::QReal) { - Instruction::LoadQRealQObjectPropertyDirectly load; - load.base = getParam(base); - load.accessors = property->accessors; - load.coreIndex = property->coreIndex; - load.notifyIndex = captureRequired ? property->notifyIndex : -1; - load.result = getResultParam(target); - addInstruction(load); - return; - } else if (property->isQObject()) { - Instruction::LoadQObjectQObjectPropertyDirectly load; - load.base = getParam(base); - load.accessors = property->accessors; - load.coreIndex = property->coreIndex; - load.notifyIndex = captureRequired ? property->notifyIndex : -1; - load.result = getResultParam(target); - addInstruction(load); - return; - } else if (property->propType == QMetaType::Int) { - Instruction::LoadIntQObjectPropertyDirectly load; - load.base = getParam(base); - load.accessors = property->accessors; - load.coreIndex = property->coreIndex; - load.notifyIndex = captureRequired ? property->notifyIndex : -1; - load.result = getResultParam(target); - addInstruction(load); - return; - } else if (property->propType == QMetaType::Bool) { - Instruction::LoadBoolQObjectPropertyDirectly load; - load.base = getParam(base); - load.accessors = property->accessors; - load.coreIndex = property->coreIndex; - load.notifyIndex = captureRequired ? property->notifyIndex : -1; - load.result = getResultParam(target); - addInstruction(load); - return; - } else if (property->propType == QMetaType::QString) { - Instruction::LoadQStringQObjectPropertyDirectly load; - load.base = getParam(base); - load.accessors = property->accessors; - load.coreIndex = property->coreIndex; - load.notifyIndex = captureRequired ? property->notifyIndex : -1; - load.result = getResultParam(target); - addInstruction(load); - return; - } - } - } - const int propertyIndex = property->coreIndex; +void InstructionSelection::getQObjectProperty(IR::Expr *base, int propertyIndex, bool captureRequired, bool isSingletonProperty, int attachedPropertiesId, IR::Expr *target) +{ if (attachedPropertiesId != 0) { Instruction::LoadAttachedQObjectProperty load; load.propertyIndex = propertyIndex; |