From 0af154c41dc0dfbf5994e7eb3056b2333b5645b7 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 12 Apr 2019 10:42:56 +0200 Subject: Don't create value types for QImage and QPixmap Those are "scarce" resources which need to be kept as QVariant. Fixes: QTBUG-74751 Change-Id: I28381e2a754ed4bbf4e409dc275f6288b64416cc Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4engine.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/qml/jsruntime') diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index bcd577c24d..bd1124beb6 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -1537,6 +1537,10 @@ QV4::ReturnedValue QV4::ExecutionEngine::fromVariant(const QVariant &variant) case QMetaType::QLocale: return QQmlLocale::wrap(this, *reinterpret_cast(ptr)); #endif + case QMetaType::QPixmap: + case QMetaType::QImage: + // Scarce value types + return QV4::Encode(newVariantObject(variant)); default: break; } -- cgit v1.2.3 From 71cacf22b83722c9a8668b1518028fa0835fb286 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 12 Apr 2019 15:37:15 +0200 Subject: Fix string replacement with invalid captures If we have a theoretically valid capture reference that just didn't capture anything in this match, we don't want to treat it as literal. Only capture references that clearly are outside the range of things we can possibly capture with this expression should be treated as literal strings. Change-Id: Iab0bf329d11a6b9e172aa662f11751d86cfc26a6 Fixes: QTBUG-75121 Reviewed-by: Lars Knoll --- src/qml/jsruntime/qv4stringobject.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/qml/jsruntime') diff --git a/src/qml/jsruntime/qv4stringobject.cpp b/src/qml/jsruntime/qv4stringobject.cpp index dee6a67792..6afa6d36d6 100644 --- a/src/qml/jsruntime/qv4stringobject.cpp +++ b/src/qml/jsruntime/qv4stringobject.cpp @@ -765,9 +765,8 @@ static void appendReplacementString(QString *result, const QString &input, const i += skip; if (substStart != JSC::Yarr::offsetNoMatch && substEnd != JSC::Yarr::offsetNoMatch) *result += input.midRef(substStart, substEnd - substStart); - else { + else if (skip == 0) // invalid capture reference. Taken as literal value *result += replaceValue.at(i); - } } else { *result += replaceValue.at(i); } -- cgit v1.2.3 From 2251fb3274ae66631be42d50508098f179f3c3e1 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Tue, 18 Sep 2018 10:19:18 +0200 Subject: Prevent CoW detaches from happening Change-Id: Ia42c0d732e0f6ccfa2c70b86edccd9eb471aac7c Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4identifiertable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qml/jsruntime') diff --git a/src/qml/jsruntime/qv4identifiertable.cpp b/src/qml/jsruntime/qv4identifiertable.cpp index e476baa886..4305bc4647 100644 --- a/src/qml/jsruntime/qv4identifiertable.cpp +++ b/src/qml/jsruntime/qv4identifiertable.cpp @@ -70,7 +70,7 @@ IdentifierTable::~IdentifierTable() { free(entriesByHash); free(entriesById); - for (auto &h : idHashes) + for (const auto &h : qAsConst(idHashes)) h->identifierTable = nullptr; } -- cgit v1.2.3 From 259c958e21c63f227a1bb678867210e0f6af0991 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Mon, 15 Apr 2019 13:36:46 +0300 Subject: V4: Only enable the JIT on ARM on specific known OSes On all other architectures, the JIT is only enabled for explicitly mentioned OSes. This fixes build errors for Windows on 32 bit ARM, about the cacheFlush function being unimplemented for that target. This keeps all other OSes enabled that are mentioned in conditionals for other architectures, except for windows. Change-Id: I8c29a9399a05a57d23b4fee506c3d04859a08a76 Reviewed-by: Ulf Hermann --- src/qml/jsruntime/qv4global_p.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/qml/jsruntime') diff --git a/src/qml/jsruntime/qv4global_p.h b/src/qml/jsruntime/qv4global_p.h index 162fb66cba..58bffdf2d1 100644 --- a/src/qml/jsruntime/qv4global_p.h +++ b/src/qml/jsruntime/qv4global_p.h @@ -94,7 +94,8 @@ inline double trunc(double d) { return d > 0 ? floor(d) : ceil(d); } #elif defined(Q_PROCESSOR_X86_64) && (QT_POINTER_SIZE == 8) \ && (defined(Q_OS_WIN) || defined(Q_OS_LINUX) || defined(Q_OS_QNX) || defined(Q_OS_MAC) || defined(Q_OS_FREEBSD)) # define V4_ENABLE_JIT -#elif defined(Q_PROCESSOR_ARM_32) && (QT_POINTER_SIZE == 4) +#elif defined(Q_PROCESSOR_ARM_32) && (QT_POINTER_SIZE == 4) \ + && (defined(Q_OS_LINUX) || defined(Q_OS_QNX) || defined(Q_OS_FREEBSD) || defined(Q_OS_INTEGRITY)) # if defined(thumb2) || defined(__thumb2__) || ((defined(__thumb) || defined(__thumb__)) && __TARGET_ARCH_THUMB-0 == 4) # define V4_ENABLE_JIT # elif defined(__ARM_ARCH_ISA_THUMB) && __ARM_ARCH_ISA_THUMB == 2 // clang 3.5 and later will set this if the core supports the Thumb-2 ISA. -- cgit v1.2.3