diff options
author | Lars Knoll <lars.knoll@digia.com> | 2012-11-11 22:29:25 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2012-11-12 10:10:23 +0100 |
commit | d5a17daf7bed4b4507676d0058486d7bcb5972bc (patch) | |
tree | d694af5f2e5038c009971f9d6476bb4a526a6542 /qmljs_runtime.h | |
parent | fa3b6bd3fc7f2cc7060286b7c8ad14450533a5a6 (diff) |
Smaller 64 bit optimisation
Change-Id: I78311310c6f986bf187e3923d1fb71e09f4569fb
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'qmljs_runtime.h')
-rw-r--r-- | qmljs_runtime.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/qmljs_runtime.h b/qmljs_runtime.h index 751fd128c2..12690357ca 100644 --- a/qmljs_runtime.h +++ b/qmljs_runtime.h @@ -225,12 +225,23 @@ struct Value inline Value toObject(Context *ctx) const; inline bool isPrimitive() const { return !isObject(); } +#if CPU(X86_64) + static inline bool integerCompatible(Value a, Value b) { + const quint64 mask = quint64(ConvertibleToInt) << 32; + return ((a.val & b.val) & mask) == mask; + } + static inline bool bothDouble(Value a, Value b) { + const quint64 mask = quint64(NotDouble_Mask) << 32; + return ((a.val | b.val) & mask) != mask; + } +#else static inline bool integerCompatible(Value a, Value b) { return ((a.tag & b.tag) & ConvertibleToInt) == ConvertibleToInt; } static inline bool bothDouble(Value a, Value b) { return ((a.tag | b.tag) & NotDouble_Mask) != NotDouble_Mask; } +#endif inline bool tryIntegerConversion() { bool b = isConvertibleToInt(); if (b) |