[SCM] qtdeclarative packaging branch, experimental, updated. debian/5.7.0-3-4-gfe1dbcb

Dmitry Shachnev mitya57 at moszumanska.debian.org
Wed Oct 5 20:05:04 UTC 2016


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

The following commit has been merged in the experimental branch:
commit 64836cc671503ad656016832c1d17ebce964f34f
Author: Dmitry Shachnev <mitya57 at gmail.com>
Date:   Wed Oct 5 22:47:34 2016 +0300

    Add no_value_without_tag.diff from upstream.
    
    It was the missing part in the series of three patches.
---
 debian/changelog                                 |   7 +
 debian/patches/fix-V4-on-big-endian.patch        |  38 +--
 debian/patches/fix_engine_64bits_big_endian.diff |   8 +-
 debian/patches/no_value_without_tag.diff         | 343 +++++++++++++++++++++++
 debian/patches/series                            |   1 +
 5 files changed, 369 insertions(+), 28 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 9253722..2004184 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,12 @@
 qtdeclarative-opensource-src (5.7.0-4) UNRELEASED; urgency=medium
 
+  [ Dmitry Shachnev ]
+  * Backport upstream patch to remove setTag() and setValue() methods, and
+    leave only setTagValue() (no_value_without_tag.diff). Without this patch
+    the current version of fix_engine_64bits_big_endian.diff did not make
+    any sense.
+  * Rebase fix_engine_64bits_big_endian.diff and fix-V4-on-big-endian.patch
+    on top of the above patch.
 
  -- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>  Wed, 05 Oct 2016 22:45:29 +0300
 
diff --git a/debian/patches/fix-V4-on-big-endian.patch b/debian/patches/fix-V4-on-big-endian.patch
index 44ddbeb..1a3dc2e 100644
--- a/debian/patches/fix-V4-on-big-endian.patch
+++ b/debian/patches/fix-V4-on-big-endian.patch
@@ -1,30 +1,20 @@
-From 2a658344397729450f869138bf77e063a0a6166b Mon Sep 17 00:00:00 2001
-From: Allan Sandfeld Jensen <allan.jensen at theqtcompany.com>
-Date: Mon, 12 Sep 2016 13:15:20 +0200
-Subject: [PATCH] Fix V4 on big-endian
-
-We can't both invert offset position and inter-value positions of tag
-and value.
-
-This patch changes 32-bit big-endian to use the same order inside
-the tag/value but just at different offsets. This also make it
-compatible with how we use it with doubles.
-
-This fixes value/tag reads on 32-bit big-endian and offsets on 64-bit.
-
-Change-Id: I95cf792c29ac3f42a4018ce1f115193c143a0df0
-Reviewed-by: Erik Verbruggen <erik.verbruggen at qt.io>
-Backport-By: Sandro Knauß <bugs at sandroknauss.de>
-Backport-Info: Upstream has developed this patch for 5.7
----
- src/qml/jsruntime/qv4value_p.h | 13 +++++--------
- 1 file changed, 5 insertions(+), 8 deletions(-)
+Description: Fix V4 on big-endian
+ We can't both invert offset position and inter-value positions of tag
+ and value.
+ .
+ This patch changes 32-bit big-endian to use the same order inside
+ the tag/value but just at different offsets. This also make it
+ compatible with how we use it with doubles.
+ .
+ This fixes value/tag reads on 32-bit big-endian and offsets on 64-bit.
+Origin: upstream, https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=2a65834439772945
+Last-Update: 2016-10-05
 
 --- a/src/qml/jsruntime/qv4value_p.h
 +++ b/src/qml/jsruntime/qv4value_p.h
-@@ -101,19 +101,16 @@
-     Q_ALWAYS_INLINE void setValue(quint32 v) { memcpy(&_val, &v, 4); }
-     Q_ALWAYS_INLINE void setTag(quint32 t) { memcpy(4 + (quint8 *)&_val, &t, 4); }
+@@ -102,19 +102,16 @@
+     Q_ALWAYS_INLINE quint64 rawValue() const { return _val; }
+     Q_ALWAYS_INLINE void setRawValue(quint64 raw) { _val = raw; }
  
 -#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN || defined(QV4_USE_64_BIT_VALUE_ENCODING)
 +#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
diff --git a/debian/patches/fix_engine_64bits_big_endian.diff b/debian/patches/fix_engine_64bits_big_endian.diff
index fb0ee00..c086fe5 100644
--- a/debian/patches/fix_engine_64bits_big_endian.diff
+++ b/debian/patches/fix_engine_64bits_big_endian.diff
@@ -1,12 +1,12 @@
 Description: fix QQmlEngine crash on big endian 64 bit architectures (s390x)
 Origin: upstream, https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=d6ac86f59250e05e
-Last-Update: 2016-07-20
+Last-Update: 2016-10-05
 
 --- a/src/qml/jsruntime/qv4value_p.h
 +++ b/src/qml/jsruntime/qv4value_p.h
-@@ -101,13 +101,13 @@
-     Q_ALWAYS_INLINE void setValue(quint32 v) { memcpy(&_val, &v, 4); }
-     Q_ALWAYS_INLINE void setTag(quint32 t) { memcpy(4 + (quint8 *)&_val, &t, 4); }
+@@ -102,13 +102,13 @@
+     Q_ALWAYS_INLINE quint64 rawValue() const { return _val; }
+     Q_ALWAYS_INLINE void setRawValue(quint64 raw) { _val = raw; }
  
 -#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
 +#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN || defined(QV4_USE_64_BIT_VALUE_ENCODING)
diff --git a/debian/patches/no_value_without_tag.diff b/debian/patches/no_value_without_tag.diff
new file mode 100644
index 0000000..c58a189
--- /dev/null
+++ b/debian/patches/no_value_without_tag.diff
@@ -0,0 +1,343 @@
+Description: V4: Always set the tag when boxing a pointer in QV4::Value
+Origin: upstream, https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=aa7c3b35ef9b737c
+Last-Update: 2016-10-05
+
+--- a/src/plugins/qmltooling/qmldbg_debugger/qqmlnativedebugservice.cpp
++++ b/src/plugins/qmltooling/qmldbg_debugger/qqmlnativedebugservice.cpp
+@@ -554,7 +554,7 @@
+             dict[QStringLiteral("name")] = name;
+             dict[QStringLiteral("valueencoded")] = QStringLiteral("undefined");
+             output.append(dict);
+-        } else if (result.ptr && result.ptr->_val) {
++        } else if (result.ptr && result.ptr->rawValue()) {
+             collector.collect(&output, QString(), name, *result);
+         } else {
+             QJsonObject dict;
+--- a/src/qml/jsruntime/qv4arraydata.cpp
++++ b/src/qml/jsruntime/qv4arraydata.cpp
+@@ -99,8 +99,8 @@
+ 
+ static Q_ALWAYS_INLINE void storeValue(ReturnedValue *target, uint value)
+ {
+-    Value v = Value::fromReturnedValue(*target);
+-    v.setValue(value);
++    Value v;
++    v.setTagValue(Value::fromReturnedValue(*target).tag(), value);
+     *target = v.asReturnedValue();
+ }
+ 
+@@ -195,7 +195,7 @@
+                 n->value = i;
+             } else {
+                 storeValue(lastFree, i);
+-                sparse->arrayData[i].setTag(Value::Empty_Type);
++                sparse->arrayData[i].setEmpty();
+                 lastFree = &sparse->arrayData[i].rawValueRef();
+             }
+         }
+@@ -204,7 +204,7 @@
+     if (toCopy < sparse->alloc) {
+         for (uint i = toCopy; i < sparse->alloc; ++i) {
+             storeValue(lastFree, i);
+-            sparse->arrayData[i].setTag(Value::Empty_Type);
++            sparse->arrayData[i].setEmpty();
+             lastFree = &sparse->arrayData[i].rawValueRef();
+         }
+         storeValue(lastFree, UINT_MAX);
+@@ -402,7 +402,7 @@
+                 // found two slots in a row
+                 uint idx = Value::fromReturnedValue(*last).uint_32();
+                 Value lastV = Value::fromReturnedValue(*last);
+-                lastV.setValue(dd->arrayData[lastV.value() + 1].value());
++                lastV.setTagValue(lastV.tag(), dd->arrayData[lastV.value() + 1].value());
+                 *last = lastV.rawValue();
+                 dd->attrs[idx] = Attr_Accessor;
+                 return idx;
+--- a/src/qml/jsruntime/qv4objectiterator.cpp
++++ b/src/qml/jsruntime/qv4objectiterator.cpp
+@@ -74,11 +74,6 @@
+     object->setM(o ? o->m() : 0);
+     current->setM(o ? o->m() : 0);
+ 
+-#ifndef QV4_USE_64_BIT_VALUE_ENCODING
+-    object->setTag(QV4::Value::Managed_Type);
+-    current->setTag(QV4::Value::Managed_Type);
+-#endif
+-
+     if (object->as<ArgumentsObject>()) {
+         Scope scope(engine);
+         Scoped<ArgumentsObject> (scope, object->asReturnedValue())->fullyCreate();
+--- a/src/qml/jsruntime/qv4persistent.cpp
++++ b/src/qml/jsruntime/qv4persistent.cpp
+@@ -85,11 +85,9 @@
+     if (p->header.next)
+         p->header.next->header.prev = &p->header.next;
+     for (int i = 0; i < kEntriesPerPage - 1; ++i) {
+-        p->values[i].setTag(QV4::Value::Empty_Type);
+-        p->values[i].setInt_32(i + 1);
++        p->values[i].setEmpty(i + 1);
+     }
+-    p->values[kEntriesPerPage - 1].setTag(QV4::Value::Empty_Type);
+-    p->values[kEntriesPerPage - 1].setInt_32(-1);
++    p->values[kEntriesPerPage - 1].setEmpty(-1);
+ 
+     storage->firstPage = p;
+ 
+@@ -211,8 +209,7 @@
+ 
+     Page *p = getPage(v);
+ 
+-    v->setTag(QV4::Value::Empty_Type);
+-    v->setInt_32(p->header.freeList);
++    v->setEmpty(p->header.freeList);
+     p->header.freeList = v - p->values;
+     if (!--p->header.refCount)
+         freePage(p);
+--- a/src/qml/jsruntime/qv4scopedvalue_p.h
++++ b/src/qml/jsruntime/qv4scopedvalue_p.h
+@@ -126,9 +126,6 @@
+     {
+         ptr = scope.engine->jsStackTop++;
+         ptr->setM(o);
+-#ifndef QV4_USE_64_BIT_VALUE_ENCODING
+-        ptr->setTag(QV4::Value::Managed_Type);
+-#endif
+     }
+ 
+     ScopedValue(const Scope &scope, Managed *m)
+@@ -150,9 +147,6 @@
+ 
+     ScopedValue &operator=(Heap::Base *o) {
+         ptr->setM(o);
+-#ifndef QV4_USE_64_BIT_VALUE_ENCODING
+-        ptr->setTag(QV4::Value::Managed_Type);
+-#endif
+         return *this;
+     }
+ 
+@@ -192,18 +186,12 @@
+ 
+     inline void setPointer(const Managed *p) {
+         ptr->setM(p ? p->m() : 0);
+-#ifndef QV4_USE_64_BIT_VALUE_ENCODING
+-        ptr->setTag(QV4::Value::Managed_Type);
+-#endif
+     }
+ 
+     Scoped(const Scope &scope)
+     {
+         ptr = scope.engine->jsStackTop++;
+         ptr->setM(0);
+-#ifndef QV4_USE_64_BIT_VALUE_ENCODING
+-        ptr->setTag(QV4::Value::Managed_Type);
+-#endif
+     }
+ 
+     Scoped(const Scope &scope, const Value &v)
+@@ -345,14 +333,14 @@
+ 
+ inline Value &Value::operator =(const ScopedValue &v)
+ {
+-    _val = v.ptr->val();
++    _val = v.ptr->rawValue();
+     return *this;
+ }
+ 
+ template<typename T>
+ inline Value &Value::operator=(const Scoped<T> &t)
+ {
+-    _val = t.ptr->val();
++    _val = t.ptr->rawValue();
+     return *this;
+ }
+ 
+--- a/src/qml/jsruntime/qv4value_p.h
++++ b/src/qml/jsruntime/qv4value_p.h
+@@ -72,6 +72,7 @@
+ 
+ struct Q_QML_PRIVATE_EXPORT Value
+ {
++private:
+     /*
+         We use two different ways of encoding JS values. One for 32bit and one for 64bit systems.
+ 
+@@ -96,10 +97,10 @@
+ 
+     quint64 _val;
+ 
+-    Q_ALWAYS_INLINE quint64 val() const { return _val; }
+-    Q_ALWAYS_INLINE void setVal(quint64 v) { _val = v; }
+-    Q_ALWAYS_INLINE void setValue(quint32 v) { memcpy(&_val, &v, 4); }
+-    Q_ALWAYS_INLINE void setTag(quint32 t) { memcpy(4 + (quint8 *)&_val, &t, 4); }
++public:
++    Q_ALWAYS_INLINE quint64 &rawValueRef() { return _val; }
++    Q_ALWAYS_INLINE quint64 rawValue() const { return _val; }
++    Q_ALWAYS_INLINE void setRawValue(quint64 raw) { _val = raw; }
+ 
+ #if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
+     static inline int valueOffset() { return 0; }
+@@ -119,17 +120,53 @@
+     Q_ALWAYS_INLINE Heap::Base *m() const { Q_UNREACHABLE(); return Q_NULLPTR; }
+     Q_ALWAYS_INLINE void setM(Heap::Base *b) { Q_UNUSED(b); Q_UNREACHABLE(); }
+ #elif defined(QV4_USE_64_BIT_VALUE_ENCODING)
+-    Q_ALWAYS_INLINE Heap::Base *m() const { Heap::Base *b; memcpy(&b, &_val, 8); return b; }
+-    Q_ALWAYS_INLINE void setM(Heap::Base *b) { memcpy(&_val, &b, 8); }
++    Q_ALWAYS_INLINE Heap::Base *m() const
++    {
++        Heap::Base *b;
++        memcpy(&b, &_val, 8);
++        return b;
++    }
++    Q_ALWAYS_INLINE void setM(Heap::Base *b)
++    {
++        memcpy(&_val, &b, 8);
++    }
+ #else // !QV4_USE_64_BIT_VALUE_ENCODING
+-    Q_ALWAYS_INLINE Heap::Base *m() const { Q_STATIC_ASSERT(sizeof(Heap::Base*) == sizeof(quint32)); Heap::Base *b; quint32 v = value(); memcpy(&b, &v, 4); return b; }
+-    Q_ALWAYS_INLINE void setM(Heap::Base *b) { quint32 v; memcpy(&v, &b, 4); setValue(v); }
++    Q_ALWAYS_INLINE Heap::Base *m() const
++    {
++        Q_STATIC_ASSERT(sizeof(Heap::Base*) == sizeof(quint32));
++        Heap::Base *b;
++        quint32 v = value();
++        memcpy(&b, &v, 4);
++        return b;
++    }
++    Q_ALWAYS_INLINE void setM(Heap::Base *b)
++    {
++        quint32 v;
++        memcpy(&v, &b, 4);
++        setTagValue(Managed_Type, v);
++    }
+ #endif
+ 
+-    Q_ALWAYS_INLINE int int_32() const { int i; quint32 v = value(); memcpy(&i, &v, 4); return i; }
+-    Q_ALWAYS_INLINE void setInt_32(int i) { quint32 u; memcpy(&u, &i, 4); setValue(u); }
++    Q_ALWAYS_INLINE int int_32() const
++    {
++        return int(value());
++    }
++    Q_ALWAYS_INLINE void setInt_32(int i)
++    {
++        setTagValue(Integer_Type_Internal, quint32(i));
++    }
+     Q_ALWAYS_INLINE uint uint_32() const { return value(); }
+ 
++    Q_ALWAYS_INLINE void setEmpty()
++    {
++        setTagValue(Empty_Type, value());
++    }
++
++    Q_ALWAYS_INLINE void setEmpty(int i)
++    {
++        setTagValue(Empty_Type, quint32(i));
++    }
++
+ #ifndef QV4_USE_64_BIT_VALUE_ENCODING
+     enum Masks {
+         SilentNaNBit           =                  0x00040000,
+@@ -266,7 +303,6 @@
+             int i = (int)d;
+             if (i == d) {
+                 setInt_32(i);
+-                setTag(Integer_Type_Internal);
+                 return true;
+             }
+         }
+@@ -298,22 +334,10 @@
+         return m();
+     }
+ 
+-    Q_ALWAYS_INLINE quint64 &rawValueRef() {
+-        return _val;
+-    }
+-    Q_ALWAYS_INLINE quint64 rawValue() const {
+-        return _val;
+-    }
+-    Q_ALWAYS_INLINE void setRawValue(quint64 raw) { _val = raw; }
+-
+     static inline Value fromHeapObject(Heap::Base *m)
+     {
+         Value v;
+-        v.setRawValue(0);
+         v.setM(m);
+-#ifndef QV4_USE_64_BIT_VALUE_ENCODING
+-        v.setTag(Managed_Type);
+-#endif
+         return v;
+     }
+ 
+@@ -334,7 +358,7 @@
+     inline bool tryIntegerConversion() {
+         bool b = integerCompatible();
+         if (b)
+-            setTag(Integer_Type_Internal);
++            setTagValue(Integer_Type_Internal, value());
+         return b;
+     }
+ 
+@@ -384,7 +408,7 @@
+     Value &operator=(ReturnedValue v) { _val = v; return *this; }
+     Value &operator=(Managed *m) {
+         if (!m) {
+-            setTagValue(Undefined_Type, 0);
++            setM(0);
+         } else {
+             _val = reinterpret_cast<Value *>(m)->_val;
+         }
+@@ -392,9 +416,6 @@
+     }
+     Value &operator=(Heap::Base *o) {
+         setM(o);
+-#ifndef QV4_USE_64_BIT_VALUE_ENCODING
+-        setTag(Managed_Type);
+-#endif
+         return *this;
+     }
+ 
+@@ -485,13 +506,7 @@
+ inline Primitive Primitive::undefinedValue()
+ {
+     Primitive v;
+-#ifdef QV4_USE_64_BIT_VALUE_ENCODING
+-    v.setRawValue(quint64(Undefined_Type) << Tag_Shift);
+-#else
+-    v.setRawValue(0);
+-    v.setTag(Undefined_Type);
+-    v.setValue(0);
+-#endif
++    v.setTagValue(Undefined_Type, 0);
+     return v;
+ }
+ 
+@@ -505,11 +520,7 @@
+ inline Primitive Primitive::nullValue()
+ {
+     Primitive v;
+-#ifndef QV4_USE_64_BIT_VALUE_ENCODING
+-    v.setRawValue(quint64(Null_Type_Internal) << Tag_Shift);
+-#else
+     v.setTagValue(Null_Type_Internal, 0);
+-#endif
+     return v;
+ }
+ 
+@@ -530,7 +541,7 @@
+ inline Primitive Primitive::fromInt32(int i)
+ {
+     Primitive v;
+-    v.setTagValue(Integer_Type_Internal, 0); // For mingw482, because it complains, and for VS9, because of internal compiler errors.
++    v.setTagValue(Integer_Type_Internal, 0);
+     v.setInt_32(i);
+     return v;
+ }
+@@ -539,8 +550,7 @@
+ {
+     Primitive v;
+     if (i < INT_MAX) {
+-        v.setTagValue(Integer_Type_Internal, 0); // For mingw482, because it complains, and for VS9, because of internal compiler errors.
+-        v.setInt_32((int)i);
++        v.setTagValue(Integer_Type_Internal, i);
+     } else {
+         v.setDouble(i);
+     }
diff --git a/debian/patches/series b/debian/patches/series
index dc703e5..88ba873 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,5 +1,6 @@
 # Backported patches
 no_lifetime_dse.diff
+no_value_without_tag.diff
 fix_engine_64bits_big_endian.diff
 fix-V4-on-big-endian.patch
 

-- 
qtdeclarative packaging



More information about the pkg-kde-commits mailing list