diff options
author | Erik Verbruggen <erik.verbruggen@digia.com> | 2016-03-30 14:54:00 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@theqtcompany.com> | 2016-04-05 13:52:57 +0000 |
commit | 90374e136e03f37990cc6725703da21ee8b710ec (patch) | |
tree | dbc73535c8e4f7cc68664f307c356c17246f85e3 /src/qml/qml/qqmlbinding.cpp | |
parent | aac611fdb8aacc494956a080bf38cb9b7eb4c2e8 (diff) |
QML: add some hot-path hints for the compiler.
Change-Id: Ic68691639e81a8450311c03e86bcde14e7bd7dd4
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/qml/qml/qqmlbinding.cpp')
-rw-r--r-- | src/qml/qml/qqmlbinding.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp index f91378b758..e8ddfecbe3 100644 --- a/src/qml/qml/qqmlbinding.cpp +++ b/src/qml/qml/qqmlbinding.cpp @@ -226,9 +226,6 @@ bool QQmlBinding::write(const QQmlPropertyData &core, Q_ASSERT(m_target.data()); Q_ASSERT(core.coreIndex != -1); - QQmlEngine *engine = context()->engine; - QV8Engine *v8engine = QQmlEnginePrivate::getV8Engine(engine); - #define QUICK_STORE(cpptype, conversion) \ { \ cpptype o = (conversion); \ @@ -239,7 +236,7 @@ bool QQmlBinding::write(const QQmlPropertyData &core, } \ - if (!isUndefined && !core.isValueTypeVirtual()) { + if (Q_LIKELY(!isUndefined && !core.isValueTypeVirtual())) { switch (core.propType) { case QMetaType::Int: if (result.isInteger()) @@ -270,6 +267,9 @@ bool QQmlBinding::write(const QQmlPropertyData &core, } #undef QUICK_STORE + QQmlEngine *engine = context()->engine; + QV8Engine *v8engine = QQmlEnginePrivate::getV8Engine(engine); + int type = core.isValueTypeVirtual() ? core.valueTypePropType : core.propType; QQmlJavaScriptExpression::DeleteWatcher watcher(this); @@ -497,7 +497,7 @@ QQmlPropertyData QQmlBinding::getPropertyData() const Q_ASSERT(propertyData); QQmlPropertyData d = *propertyData; - if (valueTypeIndex != -1) { + if (Q_UNLIKELY(valueTypeIndex != -1)) { const QMetaObject *valueTypeMetaObject = QQmlValueTypeFactory::metaObjectForMetaType(d.propType); Q_ASSERT(valueTypeMetaObject); QMetaProperty vtProp = valueTypeMetaObject->property(valueTypeIndex); |