diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-04-19 22:45:05 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2013-04-20 09:15:30 +0200 |
commit | b9b6755ff8d89a24ea142c482494fa9f78c8229e (patch) | |
tree | 34c4f1fa85488933d5bcc476f92ff082178629bd /src/qml/qml/qqmlcompiler.cpp | |
parent | 8109d47545a488ead9fac525968c360abb1fd23e (diff) |
Disable the old v4 engine by default
Left the code in there, as a reference for how we might want to
build up binding evaluation in the new v4.
Change-Id: I5c81ea986d642b524fb02087d819b39c4e3fb257
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlcompiler.cpp')
-rw-r--r-- | src/qml/qml/qqmlcompiler.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlcompiler.cpp b/src/qml/qml/qqmlcompiler.cpp index 6951c8c387..5467bfac19 100644 --- a/src/qml/qml/qqmlcompiler.cpp +++ b/src/qml/qml/qqmlcompiler.cpp @@ -60,7 +60,9 @@ #include "qqmlscriptstring.h" #include "qqmlglobal_p.h" #include "qqmlbinding_p.h" +#ifdef QT_USE_OLD_V4 #include <private/qv4compiler_p.h> +#endif #include <QDebug> #include <QPointF> @@ -3545,6 +3547,7 @@ void QQmlCompiler::genBindingAssignment(QQmlScript::Value *binding, output->addInstruction(store); } else #endif +#ifdef QT_USE_OLD_V4 if (ref.dataType == BindingReference::V4) { const JSBindingReference &js = static_cast<const JSBindingReference &>(ref); @@ -3573,7 +3576,9 @@ void QQmlCompiler::genBindingAssignment(QQmlScript::Value *binding, js.dataType = BindingReference::V8; genBindingAssignment(binding, prop, obj, valueTypeProperty); } - } else if (ref.dataType == BindingReference::V8) { + } else +#endif + if (ref.dataType == BindingReference::V8) { const JSBindingReference &js = static_cast<const JSBindingReference &>(ref); Instruction::StoreV8Binding store; @@ -3664,12 +3669,14 @@ bool QQmlCompiler::completeComponentBuild() aliasObject = compileState->aliasingObjects.next(aliasObject)) COMPILE_CHECK(buildDynamicMetaAliases(aliasObject)); +#ifdef QT_USE_OLD_V4 QV4Compiler::Expression expr(unit->imports()); expr.component = compileState->root; expr.ids = &compileState->ids; expr.importCache = output->importCache; QV4Compiler bindingCompiler; +#endif QList<JSBindingReference*> sharedBindings; @@ -3678,6 +3685,7 @@ bool QQmlCompiler::completeComponentBuild() JSBindingReference &binding = *b; // First try v4 +#ifdef QT_USE_OLD_V4 expr.context = binding.bindingContext.object; expr.property = binding.property; expr.expression = binding.expression; @@ -3696,6 +3704,9 @@ bool QQmlCompiler::completeComponentBuild() // Drop through. We need to create a V8 binding in case the V4 binding is invalidated } +#else + bool needsFallback = false; +#endif // Pre-rewrite the expression QString expression = binding.expression.asScript(); @@ -3764,8 +3775,10 @@ bool QQmlCompiler::completeComponentBuild() compileState->v8BindingProgramLine = startLineNumber; } - if (bindingCompiler.isValid()) +#ifdef QT_USE_OLD_V4 + if (bindingCompiler.isValid()) compileState->compiledBindingData = bindingCompiler.program(); +#endif // Check pop()'s matched push()'s Q_ASSERT(compileState->objectDepth.depth() == 0); |