aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlcompiler_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-10-18 15:36:40 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-20 21:11:54 +0200
commitb93ddb95a74fff4bc61073b6b04e9dd7a7dc7f36 (patch)
tree5a3a1d29d2232fd10f5d9ffa3584e0ee22eab456 /src/qml/qml/qqmlcompiler_p.h
parent6b2b62e903e1207255b0652b728ecaee6d51aea9 (diff)
Qml JavaScript code generation cleanups
* Run the binding expressions, functions and signal handlers through the V4 codegen _per_ component, and run the isel at the end for the entire file. We need to do per-component codegen because we want to set up the correct id and object scopes, which are different for the root component and anonymous components. * Changed V4IR::Module to allow for the concept of "qml modules" where there is no root function defined. This is a logical consequence of running v4 codegen multiple times with different input but the same V4IR::Module. Change-Id: Ib3a719f83507cbab7c2e4e145ccad5b663c795cf Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlcompiler_p.h')
-rw-r--r--src/qml/qml/qqmlcompiler_p.h26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/qml/qml/qqmlcompiler_p.h b/src/qml/qml/qqmlcompiler_p.h
index c8e5c907e0..142d8c68b1 100644
--- a/src/qml/qml/qqmlcompiler_p.h
+++ b/src/qml/qml/qqmlcompiler_p.h
@@ -302,6 +302,16 @@ namespace QQmlCompilerTypes {
typedef QFieldList<O, &O::nextAliasingObject> AliasingObjectsList;
AliasingObjectsList aliasingObjects;
QQmlScript::Object *root;
+ QList<QQmlJS::AST::Node*> functionsToCompile;
+ QVector<int> runtimeFunctionIndices;
+
+ struct CompiledMetaMethod
+ {
+ QQmlScript::Object *obj;
+ int methodIndex;
+ int compiledFunctionIndex; // index in functionToCompile
+ };
+ QList<CompiledMetaMethod> compiledMetaMethods;
};
};
@@ -461,21 +471,7 @@ private:
int cachedComponentTypeRef;
int cachedTranslationContextIndex;
- QList<QQmlJS::AST::Node*> functionsToCompile;
- QList<QQmlCompilerTypes::JSBindingReference*> allBindingReferenceRoots;
- struct CompiledMetaMethod
- {
- QQmlScript::Object *obj;
- int methodIndex;
- int compiledFunctionIndex; // index in functionToCompile
- };
- QList<CompiledMetaMethod> compiledMetaMethods;
- struct CompiledSignalHandlerExpression
- {
- QQmlScript::Value *signal;
- int compiledHandlerIndex; // index in functionsToCompile
- };
- QList<CompiledSignalHandlerExpression> compiledSignalHandlers;
+ QScopedPointer<QQmlJS::V4IR::Module> jsModule;
// Compiler component statistics. Only collected if QML_COMPILER_STATS=1
struct ComponentStat