aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-25 13:52:15 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-28 13:33:32 +0200
commit4d40fa24c3ee8def2f27bd237fc8dec25cf3f473 (patch)
treecb4ad758f03cf204cbae1e7d086bfeaf73a64bc3 /src/qml/compiler
parentabd82c68d564c97a4452a3afa2d63320e7292b30 (diff)
Move Value::toInteger(double) and related to Primitive
Also clean up a few other direct uses of Value Change-Id: Ie27d42c1b31b9e6d16d0a60071cb5e4e1c5b9e8b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/compiler')
-rw-r--r--src/qml/compiler/qv4codegen.cpp8
-rw-r--r--src/qml/compiler/qv4ssa.cpp10
2 files changed, 9 insertions, 9 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp
index bf2cb8e5c5..74aa0892f9 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -556,7 +556,7 @@ V4IR::Expr *Codegen::unop(V4IR::AluOp op, V4IR::Expr *expr)
case V4IR::OpUPlus:
return expr;
case V4IR::OpCompl:
- return _block->CONST(V4IR::NumberType, ~QV4::Value::toInt32(c->value));
+ return _block->CONST(V4IR::NumberType, ~QV4::Primitive::toInt32(c->value));
case V4IR::OpIncrement:
return _block->CONST(V4IR::NumberType, c->value + 1);
case V4IR::OpDecrement:
@@ -595,13 +595,13 @@ V4IR::Expr *Codegen::binop(V4IR::AluOp op, V4IR::Expr *left, V4IR::Expr *right)
case V4IR::OpGt: return _block->CONST(V4IR::BoolType, c1->value > c2->value);
case V4IR::OpLe: return _block->CONST(V4IR::BoolType, c1->value <= c2->value);
case V4IR::OpLt: return _block->CONST(V4IR::BoolType, c1->value < c2->value);
- case V4IR::OpLShift: return _block->CONST(V4IR::NumberType, QV4::Value::toInt32(c1->value) << (QV4::Value::toUInt32(c2->value) & 0x1f));
+ case V4IR::OpLShift: return _block->CONST(V4IR::NumberType, QV4::Primitive::toInt32(c1->value) << (QV4::Primitive::toUInt32(c2->value) & 0x1f));
case V4IR::OpMod: return _block->CONST(V4IR::NumberType, std::fmod(c1->value, c2->value));
case V4IR::OpMul: return _block->CONST(V4IR::NumberType, c1->value * c2->value);
case V4IR::OpOr: return _block->CONST(V4IR::NumberType, c1->value ? c1->value : c2->value);
- case V4IR::OpRShift: return _block->CONST(V4IR::NumberType, QV4::Value::toInt32(c1->value) >> (QV4::Value::toUInt32(c2->value) & 0x1f));
+ case V4IR::OpRShift: return _block->CONST(V4IR::NumberType, QV4::Primitive::toInt32(c1->value) >> (QV4::Primitive::toUInt32(c2->value) & 0x1f));
case V4IR::OpSub: return _block->CONST(V4IR::NumberType, c1->value - c2->value);
- case V4IR::OpURShift: return _block->CONST(V4IR::NumberType,QV4::Value::toUInt32(c1->value) >> (QV4::Value::toUInt32(c2->value) & 0x1f));
+ case V4IR::OpURShift: return _block->CONST(V4IR::NumberType,QV4::Primitive::toUInt32(c1->value) >> (QV4::Primitive::toUInt32(c2->value) & 0x1f));
case V4IR::OpInstanceof:
case V4IR::OpIn:
diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp
index f39517b647..13820851e7 100644
--- a/src/qml/compiler/qv4ssa.cpp
+++ b/src/qml/compiler/qv4ssa.cpp
@@ -1583,10 +1583,10 @@ public:
case DoubleType:
break;
case SInt32Type:
- c->value = QV4::Value::toInt32(c->value);
+ c->value = QV4::Primitive::toInt32(c->value);
break;
case UInt32Type:
- c->value = QV4::Value::toUInt32(c->value);
+ c->value = QV4::Primitive::toUInt32(c->value);
break;
case BoolType:
c->value = !(c->value == 0 || std::isnan(c->value));
@@ -1626,9 +1626,9 @@ protected:
virtual void visitConst(Const *c) {
if (_ty & NumberType && c->type & NumberType) {
if (_ty == SInt32Type)
- c->value = QV4::Value::toInt32(c->value);
+ c->value = QV4::Primitive::toInt32(c->value);
else if (_ty == UInt32Type)
- c->value = QV4::Value::toUInt32(c->value);
+ c->value = QV4::Primitive::toUInt32(c->value);
c->type = _ty;
}
}
@@ -2347,7 +2347,7 @@ void optimizeSSA(Function *function, DefUsesCalculator &defUses)
doneSomething = true;
break;
case OpCompl:
- constOperand->value = ~QV4::Value::toInt32(constOperand->value);
+ constOperand->value = ~QV4::Primitive::toInt32(constOperand->value);
constOperand->type = SInt32Type;
doneSomething = true;
break;