aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativepropertycache_p.h
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2011-06-14 16:17:39 +1000
committerAaron Kennedy <aaron.kennedy@nokia.com>2011-06-14 16:17:39 +1000
commit3ad5beee4c3fbbc855b84c8982c5458d634f1dee (patch)
tree7ddf1bcf379a16185c1c52f53bb689767122c1e9 /src/declarative/qml/qdeclarativepropertycache_p.h
parent7456055c2df733dbbe2ca5967f512c2555ca31d4 (diff)
Performance improvements
There are two main changes here. First, where possible, we mark properties as "IsDirect" which means that they exist in a C++ QMetaObject (as opposed to a dynamic meta object), which allows us to call QObject::qt_metacall() directly, bypassing any dynamic meta object stuff. The second change is to use an ascii string comparator in V8 where possible. V8 stores ASCII string internally as ASCII strings, and asking it to compare them to a UTF16 string requires a conversion.
Diffstat (limited to 'src/declarative/qml/qdeclarativepropertycache_p.h')
-rw-r--r--src/declarative/qml/qdeclarativepropertycache_p.h37
1 files changed, 20 insertions, 17 deletions
diff --git a/src/declarative/qml/qdeclarativepropertycache_p.h b/src/declarative/qml/qdeclarativepropertycache_p.h
index b97c48b777..69e810aa97 100644
--- a/src/declarative/qml/qdeclarativepropertycache_p.h
+++ b/src/declarative/qml/qdeclarativepropertycache_p.h
@@ -83,27 +83,28 @@ public:
NoFlags = 0x00000000,
// Can apply to all properties, except IsFunction
- IsConstant = 0x00000001,
- IsWritable = 0x00000002,
- IsResettable = 0x00000004,
- IsAlias = 0x00000008,
- IsFinal = 0x00000010,
+ IsConstant = 0x00000001, // Has CONST flag
+ IsWritable = 0x00000002, // Has WRITE function
+ IsResettable = 0x00000004, // Has RESET function
+ IsAlias = 0x00000008, // Is a QML alias to another property
+ IsFinal = 0x00000010, // Has FINAL flag
+ IsDirect = 0x00000020, // Exists on a C++ QMetaObject
// These are mutualy exclusive
- IsFunction = 0x00000020,
- IsQObjectDerived = 0x00000040,
- IsEnumType = 0x00000080,
- IsQList = 0x00000100,
- IsQmlBinding = 0x00000200,
- IsQScriptValue = 0x00000400,
- IsV8Handle = 0x00000800,
+ IsFunction = 0x00000040, // Is an invokable
+ IsQObjectDerived = 0x00000080, // Property type is a QObject* derived type
+ IsEnumType = 0x00000100, // Property type is an enum
+ IsQList = 0x00000200, // Property type is a QML list
+ IsQmlBinding = 0x00000400, // Property type is a QDeclarativeBinding*
+ IsQScriptValue = 0x00000800, // Property type is a QScriptValue
+ IsV8Handle = 0x00001000, // Property type is a QDeclarativeV8Handle
// Apply only to IsFunctions
- IsVMEFunction = 0x00001000,
- HasArguments = 0x00002000,
- IsSignal = 0x00004000,
- IsVMESignal = 0x00008000,
- IsV8Function = 0x00010000
+ IsVMEFunction = 0x00002000, // Function was added by QML
+ HasArguments = 0x00004000, // Function takes arguments
+ IsSignal = 0x00008000, // Function is a signal
+ IsVMESignal = 0x00010000, // Signal was added by QML
+ IsV8Function = 0x00020000 // Function takes QDeclarativeV8Function* args
};
Q_DECLARE_FLAGS(Flags, Flag)
@@ -113,6 +114,7 @@ public:
bool isResettable() const { return flags & IsResettable; }
bool isAlias() const { return flags & IsAlias; }
bool isFinal() const { return flags & IsFinal; }
+ bool isDirect() const { return flags & IsDirect; }
bool isFunction() const { return flags & IsFunction; }
bool isQObject() const { return flags & IsQObjectDerived; }
bool isEnum() const { return flags & IsEnumType; }
@@ -171,6 +173,7 @@ public:
static Data *property(QDeclarativeEngine *, QObject *, const QString &, Data &);
static Data *property(QDeclarativeEngine *, QObject *, const QHashedV8String &, Data &);
+ static bool isDynamicMetaObject(const QMetaObject *);
protected:
virtual void clear();