aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-02-06 14:53:52 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-07 10:44:13 +0100
commit9a61f10f268f15dc3dcdabe70ec2c4969cf206d8 (patch)
tree19a8bd87ec5fd011fb46126de0ff2537a5c0a9f4 /src/qml
parentc95d34c25d68e92468c1c5cc920d7006b1deb9c2 (diff)
Simplify some runtime methods
This gives as performant but simpler code, as the first line in toInt() checks if the value is integercompatible. Change-Id: I15d0ade231719116ca1c6c03a86106b7f5aaa9aa Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/jsruntime/qv4runtime_p.h16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/qml/jsruntime/qv4runtime_p.h b/src/qml/jsruntime/qv4runtime_p.h
index c64d120cee..3c2824ee23 100644
--- a/src/qml/jsruntime/qv4runtime_p.h
+++ b/src/qml/jsruntime/qv4runtime_p.h
@@ -306,12 +306,7 @@ inline QV4::ReturnedValue __qmljs_compl(const QV4::ValueRef value)
{
TRACE1(value);
- int n;
- if (value->integerCompatible())
- n = value->int_32;
- else
- n = value->toInt32();
-
+ int n = value->toInt32();
return Encode((int)~n);
}
@@ -328,9 +323,6 @@ inline ReturnedValue __qmljs_bit_or(const QV4::ValueRef left, const QV4::ValueRe
{
TRACE2(left, right);
- if (QV4::Value::integerCompatible(*left, *right))
- return Encode(left->integerValue() | right->integerValue());
-
int lval = left->toInt32();
int rval = right->toInt32();
return Encode(lval | rval);
@@ -340,9 +332,6 @@ inline ReturnedValue __qmljs_bit_xor(const QV4::ValueRef left, const QV4::ValueR
{
TRACE2(left, right);
- if (QV4::Value::integerCompatible(*left, *right))
- return Encode(left->integerValue() ^ right->integerValue());
-
int lval = left->toInt32();
int rval = right->toInt32();
return Encode(lval ^ rval);
@@ -352,9 +341,6 @@ inline ReturnedValue __qmljs_bit_and(const QV4::ValueRef left, const QV4::ValueR
{
TRACE2(left, right);
- if (QV4::Value::integerCompatible(*left, *right))
- return Encode(left->integerValue() & right->integerValue());
-
int lval = left->toInt32();
int rval = right->toInt32();
return Encode(lval & rval);