Fix a small bug in conversion to SInt32
authorLars Knoll <lars.knoll@digia.com>
Mon, 14 Oct 2013 06:54:44 +0000 (08:54 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 14 Oct 2013 18:23:57 +0000 (20:23 +0200)
If the truncation from double returned out of bounds,
the code was not generating the right call to the fallback
method on 64 bit.

Change-Id: I6a126dd013c5b6373762beef0c1459fae1c26ef2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/qml/compiler/qv4isel_masm.cpp

index 1495619..842b261 100644 (file)
@@ -1612,9 +1612,6 @@ void InstructionSelection::convertTypeToSInt32(V4IR::Temp *source, V4IR::Temp *t
         Assembler::Jump success =
                 _as->branchTruncateDoubleToInt32(Assembler::FPGpr0, Assembler::ReturnValueRegister,
                                                  Assembler::BranchIfTruncateSuccessful);
-        generateFunctionCall(Assembler::ReturnValueRegister, __qmljs_double_to_int32,
-                             Assembler::PointerToValue(source));
-        Assembler::Jump converted = _as->jump();
 
         // not an int:
         fallback.link(_as);
@@ -1623,12 +1620,7 @@ void InstructionSelection::convertTypeToSInt32(V4IR::Temp *source, V4IR::Temp *t
 
         isInt.link(_as);
         success.link(_as);
-        converted.link(_as);
         if (target->kind == V4IR::Temp::StackSlot) {
-//            _as->move(Assembler::TrustedImm32(QV4::Value::_Integer_Type), Assembler::ScratchRegister);
-//            _as->lshift64(Assembler::TrustedImm32(32), Assembler::ScratchRegister);
-//            _as->or64(Assembler::ScratchRegister, Assembler::ReturnValueRegister, Assembler::ScratchRegister);
-//            _as->store64(Assembler::ScratchRegister, target);
             Assembler::Pointer targetAddr = _as->stackSlotPointer(target);
             _as->store32(Assembler::ReturnValueRegister, targetAddr);
             targetAddr.offset += 4;