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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/division-by-constant.h" | 10 #include "src/base/division-by-constant.h" |
(...skipping 3377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3388 | 3388 |
3389 bind(&maybe_nan); | 3389 bind(&maybe_nan); |
3390 // Could be NaN or Infinity. If fraction is not zero, it's NaN, otherwise | 3390 // Could be NaN or Infinity. If fraction is not zero, it's NaN, otherwise |
3391 // it's an Infinity, and the non-NaN code path applies. | 3391 // it's an Infinity, and the non-NaN code path applies. |
3392 j(greater, &is_nan, Label::kNear); | 3392 j(greater, &is_nan, Label::kNear); |
3393 cmpl(FieldOperand(maybe_number, HeapNumber::kValueOffset), Immediate(0)); | 3393 cmpl(FieldOperand(maybe_number, HeapNumber::kValueOffset), Immediate(0)); |
3394 j(zero, ¬_nan); | 3394 j(zero, ¬_nan); |
3395 bind(&is_nan); | 3395 bind(&is_nan); |
3396 // Convert all NaNs to the same canonical NaN value when they are stored in | 3396 // Convert all NaNs to the same canonical NaN value when they are stored in |
3397 // the double array. | 3397 // the double array. |
3398 Set(kScratchRegister, BitCast<uint64_t>( | 3398 Set(kScratchRegister, |
3399 FixedDoubleArray::canonical_not_the_hole_nan_as_double())); | 3399 bit_cast<uint64_t>( |
| 3400 FixedDoubleArray::canonical_not_the_hole_nan_as_double())); |
3400 movq(xmm_scratch, kScratchRegister); | 3401 movq(xmm_scratch, kScratchRegister); |
3401 jmp(&have_double_value, Label::kNear); | 3402 jmp(&have_double_value, Label::kNear); |
3402 | 3403 |
3403 bind(&smi_value); | 3404 bind(&smi_value); |
3404 // Value is a smi. convert to a double and store. | 3405 // Value is a smi. convert to a double and store. |
3405 // Preserve original value. | 3406 // Preserve original value. |
3406 SmiToInteger32(kScratchRegister, maybe_number); | 3407 SmiToInteger32(kScratchRegister, maybe_number); |
3407 Cvtlsi2sd(xmm_scratch, kScratchRegister); | 3408 Cvtlsi2sd(xmm_scratch, kScratchRegister); |
3408 movsd(FieldOperand(elements, index, times_8, | 3409 movsd(FieldOperand(elements, index, times_8, |
3409 FixedDoubleArray::kHeaderSize - elements_offset), | 3410 FixedDoubleArray::kHeaderSize - elements_offset), |
(...skipping 1969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5379 if (mag.shift > 0) sarl(rdx, Immediate(mag.shift)); | 5380 if (mag.shift > 0) sarl(rdx, Immediate(mag.shift)); |
5380 movl(rax, dividend); | 5381 movl(rax, dividend); |
5381 shrl(rax, Immediate(31)); | 5382 shrl(rax, Immediate(31)); |
5382 addl(rdx, rax); | 5383 addl(rdx, rax); |
5383 } | 5384 } |
5384 | 5385 |
5385 | 5386 |
5386 } } // namespace v8::internal | 5387 } } // namespace v8::internal |
5387 | 5388 |
5388 #endif // V8_TARGET_ARCH_X64 | 5389 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |