diff options
author | Erik Verbruggen <erik.verbruggen@qt.io> | 2017-10-11 11:59:40 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-10-23 06:27:49 +0000 |
commit | 44a47106419ea4daea077320cf5f857fe6ae8b47 (patch) | |
tree | 6782e08c532ff43342ae88ff7d0fb7ad54ddfd8b /src/qml/jsruntime/qv4value_p.h | |
parent | 2a8d1f27df08aa42fae3d9b80abc4a7935d3ba63 (diff) |
Remove Binop/BinopContext instructions and implement missing binops
Change-Id: Ibefac50246045066c90c4c2dbc36d2776c5dab0e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4value_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4value_p.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h index 63433b7955..8497d47800 100644 --- a/src/qml/jsruntime/qv4value_p.h +++ b/src/qml/jsruntime/qv4value_p.h @@ -788,12 +788,13 @@ ReturnedValue value_convert(ExecutionEngine *e, const Value &v); inline int Value::toInt32() const { - if (integerCompatible()) + if (Q_LIKELY(integerCompatible())) return int_32(); - double d = isDouble() ? doubleValue() : toNumberImpl(); + if (Q_LIKELY(isDouble())) + return Double::toInt32(doubleValue()); - return Double::toInt32(d); + return Double::toInt32(toNumberImpl()); } inline unsigned int Value::toUInt32() const |