aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-02-15 01:00:06 +0100
committerUlf Hermann <ulf.hermann@qt.io>2019-02-15 10:41:32 +0100
commit1ffb45a3682c864f8071b8b19da49c9a7761dd5e (patch)
treeb714f329d1e2a1ecccc0d5c13fb829f924f0d801 /src
parent3dcc9dde65c780fb87ff9feef60dfb16d6748eb0 (diff)
parentd96a700cc3611480ff76023287cb06f455a37b02 (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts: src/qml/qml/qqmlpropertycache.cpp Change-Id: Ie7727499700b85cc0959ef3abb30d55dc728b659
Diffstat (limited to 'src')
-rw-r--r--src/qml/jit/qv4assemblercommon.cpp16
-rw-r--r--src/qml/jit/qv4assemblercommon_p.h1
-rw-r--r--src/qml/memory/qv4mm.cpp2
-rw-r--r--src/qml/types/qqmldelegatemodel.cpp17
-rw-r--r--src/qml/types/qqmldelegatemodel_p_p.h1
-rw-r--r--src/quick/items/context2d/qquickcontext2d.cpp9
6 files changed, 31 insertions, 15 deletions
diff --git a/src/qml/jit/qv4assemblercommon.cpp b/src/qml/jit/qv4assemblercommon.cpp
index d5d97f8284..dd810d9d70 100644
--- a/src/qml/jit/qv4assemblercommon.cpp
+++ b/src/qml/jit/qv4assemblercommon.cpp
@@ -187,13 +187,6 @@ PlatformAssemblerCommon::Address PlatformAssemblerCommon::argStackAddress(int ar
return Address(StackPointerRegister, offset * PointerSize);
}
-JSC::MacroAssemblerBase::Address PlatformAssemblerCommon::inArgStackAddress(int arg)
-{
- int offset = arg - ArgInRegCount;
- Q_ASSERT(offset >= 0);
- return Address(FramePointerRegister, -(offset + 1) * PointerSize);
-}
-
void PlatformAssemblerCommon::passAccumulatorAsArg(int arg)
{
#ifndef QT_NO_DEBUG
@@ -342,10 +335,13 @@ void PlatformAssemblerCommon::tailCallRuntime(const char *functionName, const vo
void PlatformAssemblerCommon::setTailCallArg(RegisterID src, int arg)
{
- if (arg < ArgInRegCount)
+ if (arg < ArgInRegCount) {
move(src, registerForArg(arg));
- else
- storePtr(src, inArgStackAddress(arg));
+ } else {
+ // We never write to the incoming arguments space on the stack, and the tail call runtime
+ // method has the same signature as the jitted function, so it is safe for us to just reuse
+ // the arguments that we got in.
+ }
}
JSC::MacroAssemblerBase::Address PlatformAssemblerCommon::jsAlloca(int slotCount)
diff --git a/src/qml/jit/qv4assemblercommon_p.h b/src/qml/jit/qv4assemblercommon_p.h
index 3e70457bd8..d3d7eedae2 100644
--- a/src/qml/jit/qv4assemblercommon_p.h
+++ b/src/qml/jit/qv4assemblercommon_p.h
@@ -711,7 +711,6 @@ public:
private:
void passAccumulatorAsArg_internal(int arg, bool doPush);
static Address argStackAddress(int arg);
- static Address inArgStackAddress(int arg);
private:
const Value* constantTable;
diff --git a/src/qml/memory/qv4mm.cpp b/src/qml/memory/qv4mm.cpp
index 3cf22d82e5..203f1f424f 100644
--- a/src/qml/memory/qv4mm.cpp
+++ b/src/qml/memory/qv4mm.cpp
@@ -201,7 +201,7 @@ Chunk *MemorySegment::allocate(size_t size)
// chunk allocated for one huge allocation
Q_ASSERT(availableBytes >= size);
pageReservation.commit(base, size);
- allocatedMap = ~static_cast<quintptr>(0);
+ allocatedMap = ~static_cast<quint64>(0);
return base;
}
size_t requiredChunks = (size + sizeof(Chunk) - 1)/sizeof(Chunk);
diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp
index 57bbf7465d..48cc77bc3d 100644
--- a/src/qml/types/qqmldelegatemodel.cpp
+++ b/src/qml/types/qqmldelegatemodel.cpp
@@ -1060,7 +1060,11 @@ QObject *QQmlDelegateModelPrivate::object(Compositor::Group group, int index, QQ
= qobject_cast<QQmlAdaptorModelProxyInterface *>(cacheItem)) {
ctxt = new QQmlContextData;
ctxt->setParent(cacheItem->contextData, /*stronglyReferencedByParent*/true);
- ctxt->contextObject = proxy->proxiedObject();
+ QObject *proxied = proxy->proxiedObject();
+ ctxt->contextObject = proxied;
+ // We don't own the proxied object. We need to clear it if it goes away.
+ QObject::connect(proxied, &QObject::destroyed,
+ cacheItem, &QQmlDelegateModelItem::childContextObjectDestroyed);
}
}
@@ -2009,6 +2013,17 @@ QV4::ReturnedValue QQmlDelegateModelItem::get_index(QQmlDelegateModelItem *thisI
return QV4::Encode((int)thisItem->groupIndex(Compositor::Group(flag)));
}
+void QQmlDelegateModelItem::childContextObjectDestroyed(QObject *childContextObject)
+{
+ if (!contextData)
+ return;
+
+ for (QQmlContextData *ctxt = contextData->childContexts; ctxt; ctxt = ctxt->nextChild) {
+ if (ctxt->contextObject == childContextObject)
+ ctxt->contextObject = nullptr;
+ }
+}
+
//---------------------------------------------------------------------------
diff --git a/src/qml/types/qqmldelegatemodel_p_p.h b/src/qml/types/qqmldelegatemodel_p_p.h
index 2d6fdf228e..5e480f4df6 100644
--- a/src/qml/types/qqmldelegatemodel_p_p.h
+++ b/src/qml/types/qqmldelegatemodel_p_p.h
@@ -106,6 +106,7 @@ public:
void referenceObject() { ++objectRef; }
bool releaseObject() { return --objectRef == 0 && !(groups & Compositor::PersistedFlag); }
bool isObjectReferenced() const { return objectRef != 0 || (groups & Compositor::PersistedFlag); }
+ void childContextObjectDestroyed(QObject *childContextObject);
bool isReferenced() const {
return scriptRef
diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp
index de19a927a0..546f3011ec 100644
--- a/src/quick/items/context2d/qquickcontext2d.cpp
+++ b/src/quick/items/context2d/qquickcontext2d.cpp
@@ -1548,7 +1548,7 @@ QV4::ReturnedValue QQuickJSContext2D::method_set_strokeStyle(const QV4::Function
if (value->as<Object>()) {
QColor color = scope.engine->toVariant(value, qMetaTypeId<QColor>()).value<QColor>();
if (color.isValid()) {
- r->d()->context()->state.fillStyle = color;
+ r->d()->context()->state.strokeStyle = color;
r->d()->context()->buffer()->setStrokeStyle(color);
r->d()->context()->m_strokeStyle.set(scope.engine, value);
} else {
@@ -1559,7 +1559,12 @@ QV4::ReturnedValue QQuickJSContext2D::method_set_strokeStyle(const QV4::Function
r->d()->context()->m_strokeStyle.set(scope.engine, value);
r->d()->context()->state.strokePatternRepeatX = style->d()->patternRepeatX;
r->d()->context()->state.strokePatternRepeatY = style->d()->patternRepeatY;
-
+ } else if (!style && r->d()->context()->state.strokeStyle != QBrush(QColor())) {
+ // If there is no style object, then ensure that the strokeStyle is at least
+ // QColor in case it was previously set
+ r->d()->context()->state.strokeStyle = QBrush(QColor());
+ r->d()->context()->buffer()->setStrokeStyle(r->d()->context()->state.strokeStyle);
+ r->d()->context()->m_strokeStyle.set(scope.engine, value);
}
}
} else if (value->isString()) {