diff options
Diffstat (limited to 'src/qml/compiler/qqmlcodegenerator.cpp')
-rw-r--r-- | src/qml/compiler/qqmlcodegenerator.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/qml/compiler/qqmlcodegenerator.cpp b/src/qml/compiler/qqmlcodegenerator.cpp index d80c4d120d..24755ee672 100644 --- a/src/qml/compiler/qqmlcodegenerator.cpp +++ b/src/qml/compiler/qqmlcodegenerator.cpp @@ -45,6 +45,7 @@ #include <private/qqmljsparser_p.h> #include <private/qqmljslexer_p.h> #include <private/qqmlcompiler_p.h> +#include <private/qqmlglobal_p.h> #include <QCoreApplication> #ifdef CONST @@ -53,6 +54,8 @@ QT_USE_NAMESPACE +DEFINE_BOOL_CONFIG_OPTION(lookupHints, QML_LOOKUP_HINTS); + using namespace QtQml; #define COMPILE_EXCEPTION(location, desc) \ @@ -1450,6 +1453,15 @@ static V4IR::Type resolveMetaObjectProperty(QQmlEnginePrivate *qmlEngine, V4IR:: if (QQmlPropertyData *candidate = metaObject->property(*member->name, /*object*/0, /*context*/0)) { const bool isFinalProperty = (candidate->isFinal() || (resolver->flags & AllPropertiesAreFinal)) && !candidate->isFunction(); + + if (lookupHints() + && !(resolver->flags & AllPropertiesAreFinal) + && !candidate->isFinal() + && !candidate->isFunction() + && candidate->isDirect()) { + qWarning() << "Hint: Access to property" << *member->name << "of" << metaObject->className() << "could be accelerated if it was marked as FINAL"; + } + if (isFinalProperty && metaObject->isAllowedInRevision(candidate)) { property = candidate; member->property = candidate; // Cache for next iteration and isel needs it. |