From 34c85bb56c92316a6ce1c79d25f9653fec14791c Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 24 Oct 2013 14:51:02 +0200 Subject: Initial support for resolving meta-property access for the scope and context objects at QML compile time This avoids having to do a string lookup for ids and in the import cache at run-time, before we can do a string hash lookup in the property cache. Instead we resolve final properties in the context and scope object at compile time and look them up at run-time using their index instead. The dependencies to these properties are also tracked separately and recorded in the compiled data. This is merely the initial patch. There's a lot left to do, such as having specialized getter and setters for specific property types. Setters are missing altogether right now and will fall back to name lookup. Change-Id: If3cb4e7c9454ef4850a615f0935b311c9395b165 Reviewed-by: Lars Knoll --- src/qml/qml/qqmlcompiler_p.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/qml/qml/qqmlcompiler_p.h') diff --git a/src/qml/qml/qqmlcompiler_p.h b/src/qml/qml/qqmlcompiler_p.h index 142d8c68b1..2e3e6b8f4c 100644 --- a/src/qml/qml/qqmlcompiler_p.h +++ b/src/qml/qml/qqmlcompiler_p.h @@ -302,16 +302,21 @@ namespace QQmlCompilerTypes { typedef QFieldList AliasingObjectsList; AliasingObjectsList aliasingObjects; QQmlScript::Object *root; - QList functionsToCompile; - QVector runtimeFunctionIndices; struct CompiledMetaMethod { - QQmlScript::Object *obj; int methodIndex; int compiledFunctionIndex; // index in functionToCompile }; + QList compiledMetaMethods; + struct PerObjectCompileData + { + QList functionsToCompile; + QVector runtimeFunctionIndices; + QVector compiledMetaMethods; + }; + QHash jsCompileData; }; }; -- cgit v1.2.3