aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4value_p.h
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2019-02-19 15:48:12 +0100
committerErik Verbruggen <erik.verbruggen@qt.io>2019-02-21 09:25:40 +0000
commit0526c0464dc271e9c7b5dce58cb3e85dab4340c8 (patch)
treebdbe544e53278515de64963f979defc3af66c82c /src/qml/jsruntime/qv4value_p.h
parent573afc9fdd093724dd58f818b965f42fca8bd1a8 (diff)
Tweak managed/undefined checks in QV4::Value for 32bit systems
On 32 bit systems, the pointers can only be 32 bit. So instead of shifting bits 32-49 away in the upper part of the 64 bit value, we can just check if the tag (the upper 32 bits) is 0. Change-Id: I25e6542676e8aa2c566f10c70c532dd8bf5c7192 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4value_p.h')
-rw-r--r--src/qml/jsruntime/qv4value_p.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h
index 20a84beccd..b1cae8796f 100644
--- a/src/qml/jsruntime/qv4value_p.h
+++ b/src/qml/jsruntime/qv4value_p.h
@@ -281,8 +281,22 @@ struct Q_QML_PRIVATE_EXPORT Value
inline bool isUndefined() const { return _val == 0; }
inline bool isDouble() const { return (_val >> IsDouble_Shift); }
- inline bool isManaged() const { return _val && ((_val >> IsManagedOrUndefined_Shift) == 0); }
- inline bool isManagedOrUndefined() const { return ((_val >> IsManagedOrUndefined_Shift) == 0); }
+ inline bool isManaged() const
+ {
+#if QT_POINTER_SIZE == 4
+ return value() && tag() == Managed_Type_Internal;
+#else
+ return _val && ((_val >> IsManagedOrUndefined_Shift) == 0);
+#endif
+ }
+ inline bool isManagedOrUndefined() const
+ {
+#if QT_POINTER_SIZE == 4
+ return tag() == Managed_Type_Internal;
+#else
+ return ((_val >> IsManagedOrUndefined_Shift) == 0);
+#endif
+ }
inline bool isIntOrBool() const {
return (_val >> IsIntegerOrBool_Shift) == 3;