diff options
author | Jason Duerstock <jason.duerstock@gmail.com> | 2019-05-28 11:58:38 -0400 |
---|---|---|
committer | Jason Duerstock <jason.duerstock@gmail.com> | 2019-05-30 11:02:37 +0000 |
commit | 677af8c7e8d4b7627cb4b8227c3cd869aba577ef (patch) | |
tree | 76543ac4098ded6d0b457c2c58b4bccd2c8ec5cc /src/qml/jsruntime/qv4value_p.h | |
parent | 306843e180207665c88de22165cf96b3d5450f42 (diff) |
Add a workaround for ia64 to move Value bits 63-61 to 49-47 for pointers
Task-number: QTBUG-56264
Change-Id: Ifdede70d95f5846e160772c43d22bc2a4123959b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/qml/jsruntime/qv4value_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4value_p.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h index b4a045edfb..ce85e48b72 100644 --- a/src/qml/jsruntime/qv4value_p.h +++ b/src/qml/jsruntime/qv4value_p.h @@ -146,12 +146,29 @@ struct Q_QML_PRIVATE_EXPORT Value QML_NEARLY_ALWAYS_INLINE Heap::Base *m() const { Heap::Base *b; +#ifdef __ia64 +// Restore bits 49-47 to bits 63-61, undoing the workaround explained in +// setM below. + quint64 _tmp; + + _tmp = _val & (7L << 47); // 0x3800000000000 + _tmp = (_tmp << 14) | (_val ^ _tmp); + memcpy(&b, &_tmp, 8); +#else memcpy(&b, &_val, 8); +#endif return b; } QML_NEARLY_ALWAYS_INLINE void setM(Heap::Base *b) { memcpy(&_val, &b, 8); +#ifdef __ia64 +// On ia64, bits 63-61 in a 64-bit pointer are used to store the virtual region +// number. Since this implementation is not 64-bit clean, we move bits 63-61 +// to bits 49-47 and hope for the best. This is undone in *m(), above. + _val |= ((_val & (7L << 61)) >> 14); + _val &= ((1L << 50)-1); +#endif } #elif QT_POINTER_SIZE == 4 QML_NEARLY_ALWAYS_INLINE Heap::Base *m() const |