OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 3801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3812 __ vstr(d0, r5, HeapNumber::kValueOffset); | 3812 __ vstr(d0, r5, HeapNumber::kValueOffset); |
3813 __ Ret(); | 3813 __ Ret(); |
3814 } else { | 3814 } else { |
3815 // Allocate a HeapNumber for the result and perform int-to-double | 3815 // Allocate a HeapNumber for the result and perform int-to-double |
3816 // conversion. Don't touch r0 or r1 as they are needed if allocation | 3816 // conversion. Don't touch r0 or r1 as they are needed if allocation |
3817 // fails. | 3817 // fails. |
3818 __ LoadRoot(r6, Heap::kHeapNumberMapRootIndex); | 3818 __ LoadRoot(r6, Heap::kHeapNumberMapRootIndex); |
3819 __ AllocateHeapNumber(r5, r3, r4, r6, &slow, TAG_RESULT); | 3819 __ AllocateHeapNumber(r5, r3, r4, r6, &slow, TAG_RESULT); |
3820 // Now we can use r0 for the result as key is not needed any more. | 3820 // Now we can use r0 for the result as key is not needed any more. |
3821 __ mov(r0, r5); | 3821 __ mov(r0, r5); |
3822 Register dst1 = r1; | 3822 Register dst_mantissa = r1; |
3823 Register dst2 = r3; | 3823 Register dst_exponent = r3; |
3824 FloatingPointHelper::Destination dest = | 3824 FloatingPointHelper::Destination dest = |
3825 FloatingPointHelper::kCoreRegisters; | 3825 FloatingPointHelper::kCoreRegisters; |
3826 FloatingPointHelper::ConvertIntToDouble(masm, | 3826 FloatingPointHelper::ConvertIntToDouble(masm, |
3827 value, | 3827 value, |
3828 dest, | 3828 dest, |
3829 d0, | 3829 d0, |
3830 dst1, | 3830 dst_mantissa, |
3831 dst2, | 3831 dst_exponent, |
3832 r9, | 3832 r9, |
3833 s0); | 3833 s0); |
3834 __ str(dst1, FieldMemOperand(r0, HeapNumber::kMantissaOffset)); | 3834 __ str(dst_mantissa, FieldMemOperand(r0, HeapNumber::kMantissaOffset)); |
3835 __ str(dst2, FieldMemOperand(r0, HeapNumber::kExponentOffset)); | 3835 __ str(dst_exponent, FieldMemOperand(r0, HeapNumber::kExponentOffset)); |
3836 __ Ret(); | 3836 __ Ret(); |
3837 } | 3837 } |
3838 } else if (elements_kind == EXTERNAL_UNSIGNED_INT_ELEMENTS) { | 3838 } else if (elements_kind == EXTERNAL_UNSIGNED_INT_ELEMENTS) { |
3839 // The test is different for unsigned int values. Since we need | 3839 // The test is different for unsigned int values. Since we need |
3840 // the value to be in the range of a positive smi, we can't | 3840 // the value to be in the range of a positive smi, we can't |
3841 // handle either of the top two bits being set in the value. | 3841 // handle either of the top two bits being set in the value. |
3842 if (CpuFeatures::IsSupported(VFP2)) { | 3842 if (CpuFeatures::IsSupported(VFP2)) { |
3843 CpuFeatures::Scope scope(VFP2); | 3843 CpuFeatures::Scope scope(VFP2); |
3844 Label box_int, done; | 3844 Label box_int, done; |
3845 __ tst(value, Operand(0xC0000000)); | 3845 __ tst(value, Operand(0xC0000000)); |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4094 __ add(r3, r3, Operand(key, LSL, 2)); | 4094 __ add(r3, r3, Operand(key, LSL, 2)); |
4095 // r3: effective address of the double element | 4095 // r3: effective address of the double element |
4096 FloatingPointHelper::Destination destination; | 4096 FloatingPointHelper::Destination destination; |
4097 if (CpuFeatures::IsSupported(VFP2)) { | 4097 if (CpuFeatures::IsSupported(VFP2)) { |
4098 destination = FloatingPointHelper::kVFPRegisters; | 4098 destination = FloatingPointHelper::kVFPRegisters; |
4099 } else { | 4099 } else { |
4100 destination = FloatingPointHelper::kCoreRegisters; | 4100 destination = FloatingPointHelper::kCoreRegisters; |
4101 } | 4101 } |
4102 FloatingPointHelper::ConvertIntToDouble( | 4102 FloatingPointHelper::ConvertIntToDouble( |
4103 masm, r5, destination, | 4103 masm, r5, destination, |
4104 d0, r6, r7, // These are: double_dst, dst1, dst2. | 4104 d0, r6, r7, // These are: double_dst, dst_mantissa, dst_exponent. |
4105 r4, s2); // These are: scratch2, single_scratch. | 4105 r4, s2); // These are: scratch2, single_scratch. |
4106 if (destination == FloatingPointHelper::kVFPRegisters) { | 4106 if (destination == FloatingPointHelper::kVFPRegisters) { |
4107 CpuFeatures::Scope scope(VFP2); | 4107 CpuFeatures::Scope scope(VFP2); |
4108 __ vstr(d0, r3, 0); | 4108 __ vstr(d0, r3, 0); |
4109 } else { | 4109 } else { |
4110 __ str(r6, MemOperand(r3, 0)); | 4110 __ str(r6, MemOperand(r3, 0)); |
4111 __ str(r7, MemOperand(r3, Register::kSizeInBytes)); | 4111 __ str(r7, MemOperand(r3, Register::kSizeInBytes)); |
4112 } | 4112 } |
4113 break; | 4113 break; |
4114 case FAST_ELEMENTS: | 4114 case FAST_ELEMENTS: |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4787 __ Jump(ic_slow, RelocInfo::CODE_TARGET); | 4787 __ Jump(ic_slow, RelocInfo::CODE_TARGET); |
4788 } | 4788 } |
4789 } | 4789 } |
4790 | 4790 |
4791 | 4791 |
4792 #undef __ | 4792 #undef __ |
4793 | 4793 |
4794 } } // namespace v8::internal | 4794 } } // namespace v8::internal |
4795 | 4795 |
4796 #endif // V8_TARGET_ARCH_ARM | 4796 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |