OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <limits.h> // For LONG_MIN, LONG_MAX. | 5 #include <limits.h> // For LONG_MIN, LONG_MAX. |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #if V8_TARGET_ARCH_MIPS | 9 #if V8_TARGET_ARCH_MIPS |
10 | 10 |
(...skipping 3899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3910 | 3910 |
3911 // Ensure that the object is a heap number | 3911 // Ensure that the object is a heap number |
3912 CheckMap(value_reg, | 3912 CheckMap(value_reg, |
3913 scratch1, | 3913 scratch1, |
3914 Heap::kHeapNumberMapRootIndex, | 3914 Heap::kHeapNumberMapRootIndex, |
3915 fail, | 3915 fail, |
3916 DONT_DO_SMI_CHECK); | 3916 DONT_DO_SMI_CHECK); |
3917 | 3917 |
3918 // Check for nan: all NaN values have a value greater (signed) than 0x7ff00000 | 3918 // Check for nan: all NaN values have a value greater (signed) than 0x7ff00000 |
3919 // in the exponent. | 3919 // in the exponent. |
3920 li(scratch1, Operand(kNaNOrInfinityLowerBoundUpper32)); | 3920 li(scratch1, Operand(kHoleNanUpper32 & HeapNumber::kExponentMask)); |
3921 lw(exponent_reg, FieldMemOperand(value_reg, HeapNumber::kExponentOffset)); | 3921 lw(exponent_reg, FieldMemOperand(value_reg, HeapNumber::kExponentOffset)); |
3922 Branch(&maybe_nan, ge, exponent_reg, Operand(scratch1)); | 3922 Branch(&maybe_nan, ge, exponent_reg, Operand(scratch1)); |
3923 | 3923 |
3924 lw(mantissa_reg, FieldMemOperand(value_reg, HeapNumber::kMantissaOffset)); | 3924 lw(mantissa_reg, FieldMemOperand(value_reg, HeapNumber::kMantissaOffset)); |
3925 | 3925 |
3926 bind(&have_double_value); | 3926 bind(&have_double_value); |
3927 sll(scratch1, key_reg, kDoubleSizeLog2 - kSmiTagSize); | 3927 sll(scratch1, key_reg, kDoubleSizeLog2 - kSmiTagSize); |
3928 Addu(scratch1, scratch1, elements_reg); | 3928 Addu(scratch1, scratch1, elements_reg); |
3929 sw(mantissa_reg, | 3929 sw(mantissa_reg, |
3930 FieldMemOperand(scratch1, FixedDoubleArray::kHeaderSize - elements_offset | 3930 FieldMemOperand(scratch1, FixedDoubleArray::kHeaderSize - elements_offset |
(...skipping 2213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6144 } | 6144 } |
6145 if (mag.shift > 0) sra(result, result, mag.shift); | 6145 if (mag.shift > 0) sra(result, result, mag.shift); |
6146 srl(at, dividend, 31); | 6146 srl(at, dividend, 31); |
6147 Addu(result, result, Operand(at)); | 6147 Addu(result, result, Operand(at)); |
6148 } | 6148 } |
6149 | 6149 |
6150 | 6150 |
6151 } } // namespace v8::internal | 6151 } } // namespace v8::internal |
6152 | 6152 |
6153 #endif // V8_TARGET_ARCH_MIPS | 6153 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |