diff options
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/common/common.pri | 6 | ||||
-rw-r--r-- | src/qml/common/qqmljsfixedpoolarray_p.h | 2 | ||||
-rw-r--r-- | src/qml/doc/src/javascript/finetuning.qdoc | 9 | ||||
-rw-r--r-- | src/qml/inlinecomponentutils_p.h | 4 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4engine.cpp | 4 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4qobjectwrapper.cpp | 5 | ||||
-rw-r--r-- | src/qml/memory/qv4mm.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlloggingcategory.cpp | 17 |
8 files changed, 32 insertions, 17 deletions
diff --git a/src/qml/common/common.pri b/src/qml/common/common.pri index b333c0f6d9..b824812d27 100644 --- a/src/qml/common/common.pri +++ b/src/qml/common/common.pri @@ -1,8 +1,8 @@ !build_pass { # Create a header containing a hash that describes this library. For a # released version of Qt, we'll use the .tag file that is updated by git - # archive with the commit hash. For unreleased versions, we'll ask git - # describe. Note that it won't update unless qmake is run again, even if + # archive with the tree hash. For unreleased versions, we'll ask git + # rev-parse. Note that it won't update unless qmake is run again, even if # the commit change also changed something in this library. tagFile = $$PWD/../../.tag tag = @@ -10,7 +10,7 @@ tag = $$cat($$tagFile, singleline) QMAKE_INTERNAL_INCLUDED_FILES += $$tagFile } - !equals(tag, "$${LITERAL_DOLLAR}Format:%H$${LITERAL_DOLLAR}") { + !equals(tag, "$${LITERAL_DOLLAR}Format:%T$${LITERAL_DOLLAR}") { QML_COMPILE_HASH = $$tag } else:exists($$PWD/../../.git) { commit = $$system(git rev-parse HEAD) diff --git a/src/qml/common/qqmljsfixedpoolarray_p.h b/src/qml/common/qqmljsfixedpoolarray_p.h index b65b994d6c..15a8cd6878 100644 --- a/src/qml/common/qqmljsfixedpoolarray_p.h +++ b/src/qml/common/qqmljsfixedpoolarray_p.h @@ -86,7 +86,7 @@ public: if (QTypeInfo<T>::isComplex) { for (int i = 0; i < count; ++i) new (data + i) T(vector.at(i)); - } else { + } else if (count) { memcpy(data, static_cast<const void*>(vector.constData()), count * sizeof(T)); } } diff --git a/src/qml/doc/src/javascript/finetuning.qdoc b/src/qml/doc/src/javascript/finetuning.qdoc index fcd710db8b..35310ee051 100644 --- a/src/qml/doc/src/javascript/finetuning.qdoc +++ b/src/qml/doc/src/javascript/finetuning.qdoc @@ -82,9 +82,12 @@ Running JavaScript code can be influenced by a few environment variables, partic \li \c{QV4_MAX_CALL_DEPTH} \li Stack overflows when running (as opposed to compiling) JavaScript are prevented by controlling the call depth: the number of nested function invocations. By - default, an exception is generated if the call depth exceeds 1234. If it contains a - number, this environment variable overrides the maximum call depth. Beware that the - recursion limit when compiling JavaScript is not affected. + default, an exception is generated if the call depth exceeds a maximum number tuned + to the platform's default stack size. If the \c{QV4_MAX_CALL_DEPTH} environment + variable contains a number, this number is used as maximum call depth. Beware that + the recursion limit when compiling JavaScript is not affected. The default maximum + call depth is 1234 on most platforms. On QNX it is 640 because on QNX the default + stack size is smaller than on most platforms. \row \li \c{QV4_MM_AGGRESSIVE_GC} \li Setting this environment variable runs the garbage collector before each memory diff --git a/src/qml/inlinecomponentutils_p.h b/src/qml/inlinecomponentutils_p.h index 99b28349cd..7666457d98 100644 --- a/src/qml/inlinecomponentutils_p.h +++ b/src/qml/inlinecomponentutils_p.h @@ -62,7 +62,9 @@ struct Node { Node& operator=(Node &&) = default; bool operator==(Node const &other) const {return index == other.index;} - Node(std::vector<QV4::CompiledData::InlineComponent>::size_type s) { + Node(std::vector<QV4::CompiledData::InlineComponent>::size_type s) + : index{0} + { index = quint32(s); temporaryMark = 0; permanentMark = 0; diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index 833df534d6..d26e991d3f 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -310,7 +310,11 @@ ExecutionEngine::ExecutionEngine(QJSEngine *jsEngine) maxCallDepth = qEnvironmentVariableIntValue("QV4_MAX_CALL_DEPTH", &ok); if (!ok || maxCallDepth <= 0) { #if defined(QT_NO_DEBUG) && !defined(__SANITIZE_ADDRESS__) && !__has_feature(address_sanitizer) +#ifdef Q_OS_QNX + maxCallDepth = 640; // QNX's stack is only 512k by default +#else maxCallDepth = 1234; +#endif #else // no (tail call) optimization is done, so there'll be a lot mare stack frames active maxCallDepth = 200; diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp index e57cdd8278..94613598af 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper.cpp +++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp @@ -1145,8 +1145,7 @@ void Heap::QObjectWrapper::markObjects(Heap::Base *that, QV4::MarkStack *markSta void QObjectWrapper::destroyObject(bool lastCall) { Heap::QObjectWrapper *h = d(); - if (!h->internalClass) - return; // destroyObject already got called + Q_ASSERT(h->internalClass); if (h->object()) { QQmlData *ddata = QQmlData::get(h->object(), false); @@ -1176,7 +1175,7 @@ void QObjectWrapper::destroyObject(bool lastCall) } } - h->~Data(); + h->destroy(); } diff --git a/src/qml/memory/qv4mm.cpp b/src/qml/memory/qv4mm.cpp index 06caf04e5a..da149a67c4 100644 --- a/src/qml/memory/qv4mm.cpp +++ b/src/qml/memory/qv4mm.cpp @@ -981,7 +981,7 @@ void MemoryManager::sweep(bool lastSweep, ClassDestroyStatsCallback classCountPt if (MultiplyWrappedQObjectMap *multiplyWrappedQObjects = engine->m_multiplyWrappedQObjects) { for (MultiplyWrappedQObjectMap::Iterator it = multiplyWrappedQObjects->begin(); it != multiplyWrappedQObjects->end();) { - if (!it.value().isNullOrUndefined()) + if (it.value().isNullOrUndefined()) it = multiplyWrappedQObjects->erase(it); else ++it; diff --git a/src/qml/qml/qqmlloggingcategory.cpp b/src/qml/qml/qqmlloggingcategory.cpp index b59a26e17e..98dfe62f0c 100644 --- a/src/qml/qml/qqmlloggingcategory.cpp +++ b/src/qml/qml/qqmlloggingcategory.cpp @@ -129,7 +129,7 @@ void QQmlLoggingCategory::componentComplete() { m_initialized = true; if (m_name.isNull()) { - qmlWarning(this) << QLatin1String("Declaring the name of the LoggingCategory is mandatory and cannot be changed later !"); + qmlWarning(this) << QLatin1String("Declaring the name of a LoggingCategory is mandatory and cannot be changed later"); } else { QScopedPointer<QLoggingCategory> category(new QLoggingCategory(m_name.constData(), QtMsgType(m_defaultLogLevel))); m_category.swap(category); @@ -138,23 +138,30 @@ void QQmlLoggingCategory::componentComplete() void QQmlLoggingCategory::setDefaultLogLevel(DefaultLogLevel defaultLogLevel) { + if (m_defaultLogLevel == defaultLogLevel) + return; + if (m_initialized) { - qmlWarning(this) << QLatin1String("The defaultLogLevel of a LoggingCategory cannot be changed after the Item is created"); + qmlWarning(this) << QLatin1String("The defaultLogLevel of a LoggingCategory cannot be changed after the component is completed"); return; } m_defaultLogLevel = defaultLogLevel; } - void QQmlLoggingCategory::setName(const QString &name) { + const QByteArray newName = name.toUtf8(); + + if (m_name == newName) + return; + if (m_initialized) { - qmlWarning(this) << QLatin1String("The name of a LoggingCategory cannot be changed after the Item is created"); + qmlWarning(this) << QLatin1String("The name of a LoggingCategory cannot be changed after the component is completed"); return; } - m_name = name.toUtf8(); + m_name = newName; } #include "moc_qqmlloggingcategory_p.cpp" |