diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2012-03-28 09:33:16 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-03 16:22:04 +0200 |
commit | faa4e0254525baf9eef6971810c839d01fca57ab (patch) | |
tree | 5d28a594501712954d01fc4922536bc36978d3bd /src/qml/qml/v4/qv4irbuilder.cpp | |
parent | 60b9151d36a9fb84b771f18d2c517e122b08ed70 (diff) |
Change V4 to explicitly use doubles to represent numbers.
Rename the V4 instructions to match the new type system.
Change-Id: I640ab52c024a29179e816e29a12f0a36813d18c6
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Diffstat (limited to 'src/qml/qml/v4/qv4irbuilder.cpp')
-rw-r--r-- | src/qml/qml/v4/qv4irbuilder.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/qml/qml/v4/qv4irbuilder.cpp b/src/qml/qml/v4/qv4irbuilder.cpp index 453120c6c7..57cea57088 100644 --- a/src/qml/qml/v4/qv4irbuilder.cpp +++ b/src/qml/qml/v4/qv4irbuilder.cpp @@ -61,8 +61,8 @@ static IR::Type irTypeFromVariantType(int t, QQmlEnginePrivate *engine, const QM case QMetaType::Int: return IR::IntType; - case QMetaType::QReal: - return IR::RealType; + case QMetaType::Double: + return IR::NumberType; case QMetaType::QString: return IR::StringType; @@ -542,7 +542,7 @@ bool QV4IRBuilder::visit(AST::NumericLiteral *ast) _expr.format = ExprResult::cx; _block->JUMP(ast->value ? _expr.iftrue : _expr.iffalse); } else { - _expr.code = _block->CONST(IR::RealType, ast->value); + _expr.code = _block->CONST(IR::NumberType, ast->value); } return false; } @@ -977,8 +977,8 @@ bool QV4IRBuilder::visit(AST::BinaryExpression *ast) if (left.type() == IR::StringType && right.type() == IR::StringType) { binop(ast, left, right); } else if (left.isValid() && right.isValid()) { - implicitCvt(left, IR::RealType); - implicitCvt(right, IR::RealType); + implicitCvt(left, IR::NumberType); + implicitCvt(right, IR::NumberType); binop(ast, left, right); } } break; @@ -998,8 +998,8 @@ bool QV4IRBuilder::visit(AST::BinaryExpression *ast) } } else if ((left.type() == IR::StringType && right.type() >= IR::FirstNumberType) || (left.type() >= IR::FirstNumberType && right.type() == IR::StringType)) { - implicitCvt(left, IR::RealType); - implicitCvt(right, IR::RealType); + implicitCvt(left, IR::NumberType); + implicitCvt(right, IR::NumberType); binop(ast, left, right); } else if (left.isValid() && right.isValid()) { binop(ast, left, right); @@ -1086,8 +1086,8 @@ bool QV4IRBuilder::visit(AST::BinaryExpression *ast) IR::Type t = maxType(left.type(), right.type()); if (t >= IR::FirstNumberType) { - implicitCvt(left, IR::RealType); - implicitCvt(right, IR::RealType); + implicitCvt(left, IR::NumberType); + implicitCvt(right, IR::NumberType); IR::Expr *code = _block->BINOP(IR::binaryOperator(ast->op), left, right); _expr.code = _block->TEMP(code->type); |