[SCM] qtdeclarative packaging branch, ubuntu, updated. debian/5.6.1-11-109-gd6cd1a9

Timo Jyrinki timo at moszumanska.debian.org
Mon Oct 17 15:58:03 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/qt/qtdeclarative.git;a=commitdiff;h=d6cd1a9

The following commit has been merged in the ubuntu branch:
commit d6cd1a9c2ce954d2fd8f98a63c8137673079fbf6
Author: Timo Jyrinki <timo.jyrinki at canonical.com>
Date:   Mon Oct 17 14:55:50 2016 +0000

    Add debian/patches/V4-Fix-usage-of-QV4-Value-tags-types.patch also  recommended by upstream.
---
 debian/changelog                                   |   2 +
 .../V4-Fix-usage-of-QV4-Value-tags-types.patch     | 210 +++++++++++++++++++++
 debian/patches/series                              |   1 +
 3 files changed, 213 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index c043f09..e5587a1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,8 @@ qtdeclarative-opensource-src (5.6.1-11ubuntu1) UNRELEASED; urgency=medium
   * Merge with Debian 5.6.1-11 changes.
   * Use fix-V4-on-big-endian.patch version from upstream 5.6 branch.
   * Skip certain failing tests on i386 and ppc64el tests on xenial.
+  * Add debian/patches/V4-Fix-usage-of-QV4-Value-tags-types.patch also 
+    recommended by upstream.
 
  -- Timo Jyrinki <timo-jyrinki at ubuntu.com>  Thu, 06 Oct 2016 14:39:07 +0000
 
diff --git a/debian/patches/V4-Fix-usage-of-QV4-Value-tags-types.patch b/debian/patches/V4-Fix-usage-of-QV4-Value-tags-types.patch
new file mode 100644
index 0000000..00f7b40
--- /dev/null
+++ b/debian/patches/V4-Fix-usage-of-QV4-Value-tags-types.patch
@@ -0,0 +1,210 @@
+From 9d2169a2d8b81b8707b20ab892550f4a55c07feb Mon Sep 17 00:00:00 2001
+From: Erik Verbruggen <erik.verbruggen at qt.io>
+Date: Wed, 12 Oct 2016 11:15:09 +0200
+Subject: [PATCH] V4: Fix usage of QV4::Value tags/types
+
+These two were mixed, but have completely different values.
+
+Task-number: QTBUG-56471
+Change-Id: Ifbf6da3032335ea89bfbc3acde17f64a571b9dc0
+Reviewed-by: Simon Hausmann <simon.hausmann at qt.io>
+---
+ src/qml/jit/qv4isel_masm.cpp        |  6 +++---
+ src/qml/jsruntime/qv4arraydata.cpp  | 29 +++++++++++++++++------------
+ src/qml/jsruntime/qv4persistent.cpp |  2 +-
+ src/qml/jsruntime/qv4value_p.h      | 19 +++++++++++++++++++
+ src/qml/memory/qv4mm.cpp            |  2 +-
+ 5 files changed, 41 insertions(+), 17 deletions(-)
+
+diff --git a/src/qml/jit/qv4isel_masm.cpp b/src/qml/jit/qv4isel_masm.cpp
+index 1913b39..05afc1e 100644
+--- a/src/qml/jit/qv4isel_masm.cpp
++++ b/src/qml/jit/qv4isel_masm.cpp
+@@ -965,7 +965,7 @@ void InstructionSelection::swapValues(IR::Expr *source, IR::Expr *target)
+                 tag = QV4::Value::Integer_Type_Internal;
+                 break;
+             default:
+-                tag = QV4::Value::Undefined_Type;
++                tag = 31337; // bogus value
+                 Q_UNREACHABLE();
+             }
+             _as->store32(Assembler::TrustedImm32(tag), addr);
+@@ -1412,7 +1412,7 @@ void InstructionSelection::visitCJump(IR::CJump *s)
+             Address temp = _as->loadAddress(Assembler::ScratchRegister, s->cond);
+             Address tag = temp;
+             tag.offset += QV4::Value::tagOffset();
+-            Assembler::Jump booleanConversion = _as->branch32(Assembler::NotEqual, tag, Assembler::TrustedImm32(QV4::Value::Boolean_Type));
++            Assembler::Jump booleanConversion = _as->branch32(Assembler::NotEqual, tag, Assembler::TrustedImm32(QV4::Value::Boolean_Type_Internal));
+ 
+             Address data = temp;
+             data.offset += QV4::Value::valueOffset();
+@@ -1576,7 +1576,7 @@ void InstructionSelection::visitRet(IR::Ret *s)
+                     tag = QV4::Value::Boolean_Type_Internal;
+                     break;
+                 default:
+-                    tag = QV4::Value::Undefined_Type;
++                    tag = 31337; // bogus value
+                     Q_UNREACHABLE();
+                 }
+                 _as->or64(Assembler::TrustedImm64(tag << 32),
+diff --git a/src/qml/jsruntime/qv4arraydata.cpp b/src/qml/jsruntime/qv4arraydata.cpp
+index 85d8155..6316737 100644
+--- a/src/qml/jsruntime/qv4arraydata.cpp
++++ b/src/qml/jsruntime/qv4arraydata.cpp
+@@ -98,7 +98,7 @@ Q_STATIC_ASSERT(sizeof(Heap::ArrayData) == sizeof(Heap::SparseArrayData));
+ static Q_ALWAYS_INLINE void storeValue(ReturnedValue *target, uint value)
+ {
+     Value v;
+-    v.setTagValue(Value::fromReturnedValue(*target).tag(), value);
++    v.setEmpty(value);
+     *target = v.asReturnedValue();
+ }
+ 
+@@ -187,6 +187,7 @@ void ArrayData::realloc(Object *o, Type newType, uint requested, bool enforceAtt
+     } else {
+         sparse->sparse = new SparseArray;
+         lastFree = &sparse->freeList;
++        storeValue(lastFree, 0);
+         for (uint i = 0; i < toCopy; ++i) {
+             if (!sparse->arrayData[i].isEmpty()) {
+                 SparseArrayNode *n = sparse->sparse->insert(i);
+@@ -207,6 +208,8 @@ void ArrayData::realloc(Object *o, Type newType, uint requested, bool enforceAtt
+         }
+         storeValue(lastFree, UINT_MAX);
+     }
++
++    Q_ASSERT(Value::fromReturnedValue(sparse->freeList).isEmpty());
+     // ### Could explicitly free the old data
+ }
+ 
+@@ -355,12 +358,12 @@ void SparseArrayData::free(Heap::ArrayData *d, uint idx)
+     Value *v = d->arrayData + idx;
+     if (d->attrs && d->attrs[idx].isAccessor()) {
+         // double slot, free both. Order is important, so we have a double slot for allocation again afterwards.
+-        v[1].setTagValue(Value::Empty_Type, Value::fromReturnedValue(d->freeList).value());
+-        v[0].setTagValue(Value::Empty_Type, idx + 1);
++        v[1].setEmpty(Value::fromReturnedValue(d->freeList).emptyValue());
++        v[0].setEmpty(idx + 1);
+     } else {
+-        v->setTagValue(Value::Empty_Type, Value::fromReturnedValue(d->freeList).value());
++        v->setEmpty(Value::fromReturnedValue(d->freeList).emptyValue());
+     }
+-    d->freeList = idx;
++    d->freeList = Primitive::emptyValue(idx).asReturnedValue();
+     if (d->attrs)
+         d->attrs[idx].clear();
+ }
+@@ -398,9 +401,9 @@ uint SparseArrayData::allocate(Object *o, bool doubleSlot)
+             Q_ASSERT(dd->arrayData[Value::fromReturnedValue(*last).value()].value() != Value::fromReturnedValue(*last).value());
+             if (dd->arrayData[Value::fromReturnedValue(*last).value()].value() == (Value::fromReturnedValue(*last).value() + 1)) {
+                 // found two slots in a row
+-                uint idx = Value::fromReturnedValue(*last).uint_32();
++                uint idx = Value::fromReturnedValue(*last).emptyValue();
+                 Value lastV = Value::fromReturnedValue(*last);
+-                lastV.setTagValue(lastV.tag(), dd->arrayData[lastV.value() + 1].value());
++                lastV.setEmpty(dd->arrayData[lastV.emptyValue() + 1].value());
+                 *last = lastV.rawValue();
+                 dd->attrs[idx] = Attr_Accessor;
+                 return idx;
+@@ -414,7 +417,8 @@ uint SparseArrayData::allocate(Object *o, bool doubleSlot)
+         }
+         uint idx = Value::fromReturnedValue(dd->freeList).value();
+         Q_ASSERT(idx != UINT_MAX);
+-        dd->freeList = dd->arrayData[idx].uint_32();
++        dd->freeList = dd->arrayData[idx].asReturnedValue();
++        Q_ASSERT(Value::fromReturnedValue(dd->freeList).isEmpty());
+         if (dd->attrs)
+             dd->attrs[idx] = Attr_Data;
+         return idx;
+@@ -469,13 +473,14 @@ bool SparseArrayData::del(Object *o, uint index)
+ 
+     if (isAccessor) {
+         // free up both indices
+-        dd->arrayData[pidx + 1].setTagValue(Value::Empty_Type, Value::fromReturnedValue(dd->freeList).value());
+-        dd->arrayData[pidx].setTagValue(Value::Undefined_Type, pidx + 1);
++        dd->arrayData[pidx + 1].setEmpty(Value::fromReturnedValue(dd->freeList).emptyValue());
++        dd->arrayData[pidx].setEmpty(pidx + 1);
+     } else {
+-        dd->arrayData[pidx].setTagValue(Value::Empty_Type, Value::fromReturnedValue(dd->freeList).value());
++        Q_ASSERT(dd->type == Heap::ArrayData::Sparse);
++        dd->arrayData[pidx].setEmpty(Value::fromReturnedValue(dd->freeList).emptyValue());
+     }
+ 
+-    dd->freeList = pidx;
++    dd->freeList = Primitive::emptyValue(pidx).asReturnedValue();
+     dd->sparse->erase(n);
+     return true;
+ }
+diff --git a/src/qml/jsruntime/qv4persistent.cpp b/src/qml/jsruntime/qv4persistent.cpp
+index fd3bd1f..3f70a41 100644
+--- a/src/qml/jsruntime/qv4persistent.cpp
++++ b/src/qml/jsruntime/qv4persistent.cpp
+@@ -133,7 +133,7 @@ PersistentValueStorage::Iterator &PersistentValueStorage::Iterator::operator++()
+     while (p) {
+         while (index < kEntriesPerPage - 1) {
+             ++index;
+-            if (static_cast<Page *>(p)->values[index].tag() != QV4::Value::Empty_Type)
++            if (!static_cast<Page *>(p)->values[index].isEmpty())
+                 return *this;
+         }
+         index = -1;
+diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h
+index ebe43b5..1333912 100644
+--- a/src/qml/jsruntime/qv4value_p.h
++++ b/src/qml/jsruntime/qv4value_p.h
+@@ -220,6 +220,17 @@ public:
+         setTagValue(Empty_Type_Internal, quint32(i));
+     }
+ 
++    Q_ALWAYS_INLINE void setEmpty(quint32 i)
++    {
++        setTagValue(Empty_Type_Internal, i);
++    }
++
++    Q_ALWAYS_INLINE quint32 emptyValue()
++    {
++        Q_ASSERT(isEmpty());
++        return quint32(value());
++    }
++
+     enum Type {
+         Undefined_Type,
+         Managed_Type,
+@@ -524,6 +535,7 @@ ReturnedValue Heap::Base::asReturnedValue() const
+ struct Q_QML_PRIVATE_EXPORT Primitive : public Value
+ {
+     inline static Primitive emptyValue();
++    inline static Primitive emptyValue(uint v);
+     static inline Primitive fromBoolean(bool b);
+     static inline Primitive fromInt32(int i);
+     inline static Primitive undefinedValue();
+@@ -553,6 +565,13 @@ inline Primitive Primitive::emptyValue()
+     return v;
+ }
+ 
++inline Primitive Primitive::emptyValue(uint e)
++{
++    Primitive v;
++    v.setEmpty(e);
++    return v;
++}
++
+ inline Primitive Primitive::nullValue()
+ {
+     Primitive v;
+diff --git a/src/qml/memory/qv4mm.cpp b/src/qml/memory/qv4mm.cpp
+index 2588d8d..b11c8c5 100644
+--- a/src/qml/memory/qv4mm.cpp
++++ b/src/qml/memory/qv4mm.cpp
+@@ -454,7 +454,7 @@ void MemoryManager::sweep(bool lastSweep)
+         remainingWeakQObjectWrappers.reserve(pendingCount);
+         for (int i = 0; i < pendingCount; ++i) {
+             Value *v = m_pendingFreedObjectWrapperValue.at(i);
+-            if (v->tag() == Value::Undefined_Type)
++            if (v->isUndefined() || v->isEmpty())
+                 PersistentValueStorage::free(v);
+             else
+                 remainingWeakQObjectWrappers.append(v);
+-- 
+2.9.3
+
diff --git a/debian/patches/series b/debian/patches/series
index d4e8dc0..8357a42 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -11,6 +11,7 @@ Flickable-fix-minXExtent-minYExtent-when-content-is-.patch
 QQuickWindow-Fill-out-timestamps-in-QHoverEvents-sen.patch
 Fix-visibility-of-properties-in-value-types.patch
 Revert-Remove-this-piece-of-code.patch
+V4-Fix-usage-of-QV4-Value-tags-types.patch
 
 # Debian patches
 check_system_double-conversion.patch

-- 
qtdeclarative packaging



More information about the pkg-kde-commits mailing list