diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-11-02 22:46:25 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-25 22:04:42 +0100 |
commit | 43f1cc98bf1899ae29e3fb0b3bf5054d5a23d4b2 (patch) | |
tree | 1d0912be4c0daf35e4255259f51e4a3c11b9f004 /src/qml/compiler/qv4jsir_p.h | |
parent | a41764cafbc85c271edde8d09eae46798ccdcb8d (diff) |
Initial support for accelerated property access to QML singletons and enums
With this patch we determine the meta-object of singletons, propagate it into
the IR and load them separately using a dedicated run-time function. In
addition enums in singletons and QML types are resolved at compile time.
Change-Id: I01ce1288391b476d1c9af669cb2987a44c885703
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4jsir_p.h')
-rw-r--r-- | src/qml/compiler/qv4jsir_p.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/qml/compiler/qv4jsir_p.h b/src/qml/compiler/qv4jsir_p.h index fd54460b5c..aa85c4cf3c 100644 --- a/src/qml/compiler/qv4jsir_p.h +++ b/src/qml/compiler/qv4jsir_p.h @@ -55,6 +55,7 @@ #include "private/qv4global_p.h" #include <private/qqmljsmemorypool_p.h> #include <private/qqmljsastfwd_p.h> +#include <private/qflagpointer_p.h> #include <QtCore/QVector> #include <QtCore/QString> @@ -124,6 +125,14 @@ struct CJump; struct Ret; struct Phi; +// Flag pointer: +// * The first flag indicates whether the meta object is final. +// If final, then none of its properties themselves need to +// be final when considering for lookups in QML. +// * The second flag indicates whether enums should be included +// in the lookup of properties or not. The default is false. +typedef QFlagPointer<QQmlPropertyCache> IRMetaObject; + enum AluOp { OpInvalid = 0, @@ -227,13 +236,14 @@ struct MemberExpressionResolver typedef Type (*ResolveFunction)(QQmlEnginePrivate *engine, MemberExpressionResolver *resolver, Member *member); MemberExpressionResolver() - : resolveMember(0), data(0) {} + : resolveMember(0), data(0), flags(0) {} bool isValid() const { return !!resolveMember; } void clear() { *this = MemberExpressionResolver(); } ResolveFunction resolveMember; void *data; // Could be pointer to meta object, QQmlTypeNameCache, etc. - depends on resolveMember implementation + int flags; }; struct Expr { @@ -351,7 +361,9 @@ struct Name: Expr { const QString *id; Builtin builtin; - bool global; + bool global : 1; + bool qmlSingleton : 1; + bool freeOfSideEffects : 1; quint32 line; quint32 column; @@ -543,12 +555,15 @@ struct Member: Expr { Expr *base; const QString *name; QQmlPropertyData *property; + int enumValue; + bool memberIsEnum; void init(Expr *base, const QString *name, QQmlPropertyData *property = 0) { this->base = base; this->name = name; this->property = property; + this->memberIsEnum = false; } virtual void accept(ExprVisitor *v) { v->visitMember(this); } @@ -919,6 +934,8 @@ public: newName->id = n->id; newName->builtin = n->builtin; newName->global = n->global; + newName->qmlSingleton = n->qmlSingleton; + newName->freeOfSideEffects = n->freeOfSideEffects; newName->line = n->line; newName->column = n->column; return newName; |