aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-01-22 11:41:00 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2019-01-22 11:41:00 +0000
commit52dbb75f9c4390ff50fa69dbd9172ae7863c41b6 (patch)
treeff77c7af52b0421d0f008e3a6d393695a12295b2 /src
parent84e15a609b37a64baf82ed20f8d4f79474989226 (diff)
parent5030a9d8c6a3422d5803d21937cbe9753975e019 (diff)
Merge "Merge remote-tracking branch 'origin/5.12.1' into 5.12" into refs/staging/5.12
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/masm/assembler/ARM64Assembler.h2
-rw-r--r--src/3rdparty/masm/yarr/YarrJIT.cpp8
-rw-r--r--src/qml/jsruntime/qv4regexp.cpp60
-rw-r--r--src/qml/jsruntime/qv4regexpobject.cpp8
-rw-r--r--src/quick/doc/qtquick.qdocconf9
-rw-r--r--src/quick/handlers/qquicksinglepointhandler.cpp2
-rw-r--r--src/quick/handlers/qquicksinglepointhandler_p.h1
-rw-r--r--src/quick/handlers/qquicktaphandler.cpp6
-rw-r--r--src/quick/items/qquickborderimage.cpp2
-rw-r--r--src/quick/util/qquickpath.cpp2
-rw-r--r--src/quickshapes/qquickshape.cpp8
11 files changed, 70 insertions, 38 deletions
diff --git a/src/3rdparty/masm/assembler/ARM64Assembler.h b/src/3rdparty/masm/assembler/ARM64Assembler.h
index fcf2e485e8..a9166e83a2 100644
--- a/src/3rdparty/masm/assembler/ARM64Assembler.h
+++ b/src/3rdparty/masm/assembler/ARM64Assembler.h
@@ -3051,7 +3051,7 @@ public:
UNUSED_PARAM(size);
#endif
#elif OS(INTEGRITY)
- ManageCaches((Address)code, size, ACCESS_DST_COHERENT);
+ ManageCaches((Address)code, size, ACCESS_DST_SYNC);
#else
#error "The cacheFlush support is missing on this platform."
#endif
diff --git a/src/3rdparty/masm/yarr/YarrJIT.cpp b/src/3rdparty/masm/yarr/YarrJIT.cpp
index 0655bb0a70..dee2ade407 100644
--- a/src/3rdparty/masm/yarr/YarrJIT.cpp
+++ b/src/3rdparty/masm/yarr/YarrJIT.cpp
@@ -3531,14 +3531,14 @@ public:
if (compileMode == MatchOnly) {
if (m_charSize == Char8)
- codeBlock.set8BitCodeMatchOnly(FINALIZE_CODE(linkBuffer, "YarJIT", "Match-only 8-bit regular expression"));
+ codeBlock.set8BitCodeMatchOnly(FINALIZE_CODE(linkBuffer, "YarrJIT", "Match-only 8-bit regular expression"));
else
- codeBlock.set16BitCodeMatchOnly(FINALIZE_CODE(linkBuffer, "YarJIT", "Match-only 16-bit regular expression"));
+ codeBlock.set16BitCodeMatchOnly(FINALIZE_CODE(linkBuffer, "YarrJIT", "Match-only 16-bit regular expression"));
} else {
if (m_charSize == Char8)
- codeBlock.set8BitCode(FINALIZE_CODE(linkBuffer, "YarJIT", "8-bit regular expression"));
+ codeBlock.set8BitCode(FINALIZE_CODE(linkBuffer, "YarrJIT", "8-bit regular expression"));
else
- codeBlock.set16BitCode(FINALIZE_CODE(linkBuffer, "YarJIT", "16-bit regular expression"));
+ codeBlock.set16BitCode(FINALIZE_CODE(linkBuffer, "YarrJIT", "16-bit regular expression"));
}
if (m_failureReason)
codeBlock.setFallBackWithFailureReason(*m_failureReason);
diff --git a/src/qml/jsruntime/qv4regexp.cpp b/src/qml/jsruntime/qv4regexp.cpp
index 05c3b4c4ca..4ed1dbd5aa 100644
--- a/src/qml/jsruntime/qv4regexp.cpp
+++ b/src/qml/jsruntime/qv4regexp.cpp
@@ -45,6 +45,22 @@
using namespace QV4;
+static JSC::RegExpFlags jscFlags(uint flags)
+{
+ JSC::RegExpFlags jscFlags = JSC::NoFlags;
+ if (flags & CompiledData::RegExp::RegExp_Global)
+ jscFlags = static_cast<JSC::RegExpFlags>(flags | JSC::FlagGlobal);
+ if (flags & CompiledData::RegExp::RegExp_IgnoreCase)
+ jscFlags = static_cast<JSC::RegExpFlags>(flags | JSC::FlagIgnoreCase);
+ if (flags & CompiledData::RegExp::RegExp_Multiline)
+ jscFlags = static_cast<JSC::RegExpFlags>(flags | JSC::FlagMultiline);
+ if (flags & CompiledData::RegExp::RegExp_Unicode)
+ jscFlags = static_cast<JSC::RegExpFlags>(flags | JSC::FlagUnicode);
+ if (flags & CompiledData::RegExp::RegExp_Sticky)
+ jscFlags = static_cast<JSC::RegExpFlags>(flags | JSC::FlagSticky);
+ return jscFlags;
+}
+
RegExpCache::~RegExpCache()
{
for (RegExpCache::Iterator it = begin(), e = end(); it != e; ++it) {
@@ -57,21 +73,43 @@ DEFINE_MANAGED_VTABLE(RegExp);
uint RegExp::match(const QString &string, int start, uint *matchOffsets)
{
+ static const uint offsetJITFail = std::numeric_limits<unsigned>::max() - 1;
+
if (!isValid())
return JSC::Yarr::offsetNoMatch;
WTF::String s(string);
#if ENABLE(YARR_JIT)
- if (d()->hasValidJITCode()) {
+ auto *priv = d();
+ if (priv->hasValidJITCode()) {
+ uint ret = JSC::Yarr::offsetNoMatch;
#if ENABLE(YARR_JIT_ALL_PARENS_EXPRESSIONS)
char buffer[8192];
- return uint(jitCode()->execute(s.characters16(), start, s.length(), (int*)matchOffsets, buffer, 8192).start);
+ ret = uint(priv->jitCode->execute(s.characters16(), start, s.length(),
+ (int*)matchOffsets, buffer, 8192).start);
#else
- return uint(jitCode()->execute(s.characters16(), start, s.length(), (int*)matchOffsets).start);
+ ret = uint(priv->jitCode->execute(s.characters16(), start, s.length(),
+ (int*)matchOffsets).start);
#endif
+ if (ret != offsetJITFail)
+ return ret;
+
+ // JIT failed. We need byteCode to run the interpreter.
+ if (!priv->byteCode) {
+ JSC::Yarr::ErrorCode error = JSC::Yarr::ErrorCode::NoError;
+ JSC::Yarr::YarrPattern yarrPattern(WTF::String(*priv->pattern), jscFlags(priv->flags),
+ error);
+
+ // As we successfully parsed the pattern before, we should still be able to.
+ Q_ASSERT(error == JSC::Yarr::ErrorCode::NoError);
+
+ priv->byteCode = JSC::Yarr::byteCompile(
+ yarrPattern,
+ priv->internalClass->engine->bumperPointerAllocator).release();
+ }
}
-#endif
+#endif // ENABLE(YARR_JIT)
return JSC::Yarr::interpret(byteCode(), s.characters16(), string.length(), start, matchOffsets);
}
@@ -176,19 +214,7 @@ void Heap::RegExp::init(ExecutionEngine *engine, const QString &pattern, uint fl
valid = false;
JSC::Yarr::ErrorCode error = JSC::Yarr::ErrorCode::NoError;
- JSC::RegExpFlags jscFlags = JSC::NoFlags;
- if (flags & CompiledData::RegExp::RegExp_Global)
- jscFlags = static_cast<JSC::RegExpFlags>(flags | JSC::FlagGlobal);
- if (flags & CompiledData::RegExp::RegExp_IgnoreCase)
- jscFlags = static_cast<JSC::RegExpFlags>(flags | JSC::FlagIgnoreCase);
- if (flags & CompiledData::RegExp::RegExp_Multiline)
- jscFlags = static_cast<JSC::RegExpFlags>(flags | JSC::FlagMultiline);
- if (flags & CompiledData::RegExp::RegExp_Unicode)
- jscFlags = static_cast<JSC::RegExpFlags>(flags | JSC::FlagUnicode);
- if (flags & CompiledData::RegExp::RegExp_Sticky)
- jscFlags = static_cast<JSC::RegExpFlags>(flags | JSC::FlagSticky);
-
- JSC::Yarr::YarrPattern yarrPattern(WTF::String(pattern), jscFlags, error);
+ JSC::Yarr::YarrPattern yarrPattern(WTF::String(pattern), jscFlags(flags), error);
if (error != JSC::Yarr::ErrorCode::NoError)
return;
subPatternCount = yarrPattern.m_numSubpatterns;
diff --git a/src/qml/jsruntime/qv4regexpobject.cpp b/src/qml/jsruntime/qv4regexpobject.cpp
index 9df286065d..39a2e96b45 100644
--- a/src/qml/jsruntime/qv4regexpobject.cpp
+++ b/src/qml/jsruntime/qv4regexpobject.cpp
@@ -181,17 +181,19 @@ ReturnedValue RegExpObject::builtinExec(ExecutionEngine *engine, const String *s
}
Q_ALLOCA_VAR(uint, matchOffsets, value()->captureCount() * 2 * sizeof(uint));
- const int result = Scoped<RegExp>(scope, value())->match(s, offset, matchOffsets);
+ const uint result = Scoped<RegExp>(scope, value())->match(s, offset, matchOffsets);
RegExpCtor *regExpCtor = static_cast<RegExpCtor *>(scope.engine->regExpCtor());
regExpCtor->d()->clearLastMatch();
- if (result == -1) {
+ if (result == JSC::Yarr::offsetNoMatch) {
if (global() || sticky())
setLastIndex(0);
RETURN_RESULT(Encode::null());
}
+ Q_ASSERT(result <= uint(std::numeric_limits<int>::max()));
+
// fill in result data
ScopedArrayObject array(scope, scope.engine->newArrayObject(scope.engine->internalClasses(EngineBase::Class_RegExpExecArray)));
int len = value()->captureCount();
@@ -207,7 +209,7 @@ ReturnedValue RegExpObject::builtinExec(ExecutionEngine *engine, const String *s
array->arrayPut(i, v);
}
array->setArrayLengthUnchecked(len);
- array->setProperty(Index_ArrayIndex, Value::fromInt32(result));
+ array->setProperty(Index_ArrayIndex, Value::fromInt32(int(result)));
array->setProperty(Index_ArrayInput, *str);
RegExpCtor::Data *dd = regExpCtor->d();
diff --git a/src/quick/doc/qtquick.qdocconf b/src/quick/doc/qtquick.qdocconf
index 21a44a2fab..b1268097fc 100644
--- a/src/quick/doc/qtquick.qdocconf
+++ b/src/quick/doc/qtquick.qdocconf
@@ -52,10 +52,11 @@ exampledirs += ../../../examples/quick \
imagedirs += images
-
-#add particles sources
-headerdirs += ../../particles
-sourcedirs += ../../particles
+#add particles and shapes sources
+headerdirs += ../../particles \
+ ../../quickshapes
+sourcedirs += ../../particles \
+ ../../quickshapes
#add imports directory because of dependencies
headerdirs += ../../imports
diff --git a/src/quick/handlers/qquicksinglepointhandler.cpp b/src/quick/handlers/qquicksinglepointhandler.cpp
index 82e5b1b05d..ae162bed87 100644
--- a/src/quick/handlers/qquicksinglepointhandler.cpp
+++ b/src/quick/handlers/qquicksinglepointhandler.cpp
@@ -108,7 +108,7 @@ bool QQuickSinglePointHandler::wantsPointerEvent(QQuickPointerEvent *event)
int candidatePointCount = 0;
int c = event->pointCount();
QQuickEventPoint *chosen = nullptr;
- for (int i = 0; i < c; ++i) {
+ for (int i = 0; i < c && !chosen; ++i) {
QQuickEventPoint *p = event->point(i);
if (!p->exclusiveGrabber() && wantsEventPoint(p)) {
if (!chosen)
diff --git a/src/quick/handlers/qquicksinglepointhandler_p.h b/src/quick/handlers/qquicksinglepointhandler_p.h
index b9e5b12224..7bf8eff999 100644
--- a/src/quick/handlers/qquicksinglepointhandler_p.h
+++ b/src/quick/handlers/qquicksinglepointhandler_p.h
@@ -82,7 +82,6 @@ protected:
void setPointId(int id);
-private:
void reset();
private:
diff --git a/src/quick/handlers/qquicktaphandler.cpp b/src/quick/handlers/qquicktaphandler.cpp
index d480d3b491..f24b2bfd7e 100644
--- a/src/quick/handlers/qquicktaphandler.cpp
+++ b/src/quick/handlers/qquicktaphandler.cpp
@@ -312,8 +312,12 @@ void QQuickTapHandler::setPressed(bool press, bool cancel, QQuickEventPoint *poi
// on release, ungrab after emitting changed signals
setExclusiveGrab(point, press);
}
- if (cancel)
+ if (cancel) {
emit canceled(point);
+ setExclusiveGrab(point, false);
+ reset();
+ emit pointChanged();
+ }
}
}
diff --git a/src/quick/items/qquickborderimage.cpp b/src/quick/items/qquickborderimage.cpp
index e4e766a129..b840328184 100644
--- a/src/quick/items/qquickborderimage.cpp
+++ b/src/quick/items/qquickborderimage.cpp
@@ -600,7 +600,7 @@ void QQuickBorderImagePrivate::calculateRects(const QQuickScaleGrid *border,
if (borderTop + borderBottom > sourceSize.height() && borderTop < sourceSize.height())
borderBottom = sourceSize.height() - borderTop;
*innerSourceRect = QRectF(QPointF(borderLeft / qreal(sourceSize.width()),
- borderTop * devicePixelRatio / qreal(sourceSize.height())),
+ borderTop / qreal(sourceSize.height())),
QPointF((sourceSize.width() - borderRight) / qreal(sourceSize.width()),
(sourceSize.height() - borderBottom) / qreal(sourceSize.height()))),
*innerTargetRect = QRectF(border->left(),
diff --git a/src/quick/util/qquickpath.cpp b/src/quick/util/qquickpath.cpp
index 53b72d1e58..60d725d650 100644
--- a/src/quick/util/qquickpath.cpp
+++ b/src/quick/util/qquickpath.cpp
@@ -2007,7 +2007,7 @@ void QQuickPathAngleArc::setCenterY(qreal centerY)
return;
_centerY = centerY;
- emit centerXChanged();
+ emit centerYChanged();
emit changed();
}
diff --git a/src/quickshapes/qquickshape.cpp b/src/quickshapes/qquickshape.cpp
index 0c159ec21b..489d1c86f7 100644
--- a/src/quickshapes/qquickshape.cpp
+++ b/src/quickshapes/qquickshape.cpp
@@ -53,16 +53,16 @@ QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(QQSHAPE_LOG_TIME_DIRTY_SYNC, "qt.shape.time.sync")
/*!
- \qmlmodule QtQuick.Shapes 1.11
+ \qmlmodule QtQuick.Shapes 1.\QtMinorVersion
\title Qt Quick Shapes QML Types
\ingroup qmlmodules
\brief Provides QML types for drawing stroked and filled shapes.
To use the types in this module, import the module with the following line:
- \badcode
- import QtQuick.Shapes 1.11
- \endcode
+ \qml \QtMinorVersion
+ import QtQuick.Shapes 1.\1
+ \endqml
*/
QQuickShapeStrokeFillParams::QQuickShapeStrokeFillParams()