aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4value_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4value_p.h')
-rw-r--r--src/qml/jsruntime/qv4value_p.h105
1 files changed, 4 insertions, 101 deletions
diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h
index 6941c11f44..f2d01c56cd 100644
--- a/src/qml/jsruntime/qv4value_p.h
+++ b/src/qml/jsruntime/qv4value_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QV4VALUE_P_H
#define QV4VALUE_P_H
@@ -70,9 +34,8 @@ namespace Heap {
struct Base;
}
-struct Q_QML_PRIVATE_EXPORT Value : public StaticValue
+struct Q_QML_EXPORT Value : public StaticValue
{
- using HeapBasePtr = Heap::Base *;
using ManagedPtr = Managed *;
Value() = default;
@@ -83,53 +46,6 @@ struct Q_QML_PRIVATE_EXPORT Value : public StaticValue
return {staticValue._val};
}
-#if QT_POINTER_SIZE == 8
- QML_NEARLY_ALWAYS_INLINE HeapBasePtr m() const
- {
- HeapBasePtr 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(HeapBasePtr 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 HeapBasePtr m() const
- {
- Q_STATIC_ASSERT(sizeof(HeapBasePtr) == sizeof(quint32));
- HeapBasePtr b;
- quint32 v = value();
- memcpy(&b, &v, 4);
- return b;
- }
- QML_NEARLY_ALWAYS_INLINE void setM(HeapBasePtr b)
- {
- quint32 v;
- memcpy(&v, &b, 4);
- setTagValue(Managed_Type_Internal, v);
- }
-#else
-# error "unsupported pointer size"
-#endif
-
inline bool isString() const;
inline bool isStringOrSymbol() const;
inline bool isSymbol() const;
@@ -311,7 +227,7 @@ struct Q_QML_PRIVATE_EXPORT Value : public StaticValue
template<typename T>
Value &operator=(const Scoped<T> &t);
};
-Q_STATIC_ASSERT(std::is_trivial<Value>::value);
+Q_STATIC_ASSERT(std::is_trivial_v<Value>);
Q_STATIC_ASSERT(sizeof(Value) == sizeof(StaticValue));
template<>
@@ -526,19 +442,6 @@ struct ValueArray {
return values;
}
- void insertData(EngineBase *e, uint index, Value v) {
- for (uint i = size - 1; i > index; --i) {
- values[i] = values[i - 1];
- }
- set(e, index, v);
- }
- void removeData(EngineBase *e, uint index, int n = 1) {
- Q_UNUSED(e);
- for (uint i = index; i < size - n; ++i) {
- values[i] = values[i + n];
- }
- }
-
void mark(MarkStack *markStack) {
for (Value *v = values, *end = values + alloc; v < end; ++v)
v->mark(markStack);