From 44a47106419ea4daea077320cf5f857fe6ae8b47 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Wed, 11 Oct 2017 11:59:40 +0200 Subject: Remove Binop/BinopContext instructions and implement missing binops Change-Id: Ibefac50246045066c90c4c2dbc36d2776c5dab0e Reviewed-by: Lars Knoll --- src/qml/jsruntime/qv4value_p.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/qml/jsruntime/qv4value_p.h') 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 -- cgit v1.2.3