OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
(...skipping 1957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1968 XMMRegister left_reg = ToDoubleRegister(left); | 1968 XMMRegister left_reg = ToDoubleRegister(left); |
1969 XMMRegister right_reg = ToDoubleRegister(right); | 1969 XMMRegister right_reg = ToDoubleRegister(right); |
1970 __ ucomisd(left_reg, right_reg); | 1970 __ ucomisd(left_reg, right_reg); |
1971 __ j(parity_even, &check_nan_left, Label::kNear); // At least one NaN. | 1971 __ j(parity_even, &check_nan_left, Label::kNear); // At least one NaN. |
1972 __ j(equal, &check_zero, Label::kNear); // left == right. | 1972 __ j(equal, &check_zero, Label::kNear); // left == right. |
1973 __ j(condition, &return_left, Label::kNear); | 1973 __ j(condition, &return_left, Label::kNear); |
1974 __ jmp(&return_right, Label::kNear); | 1974 __ jmp(&return_right, Label::kNear); |
1975 | 1975 |
1976 __ bind(&check_zero); | 1976 __ bind(&check_zero); |
1977 XMMRegister xmm_scratch = double_scratch0(); | 1977 XMMRegister xmm_scratch = double_scratch0(); |
1978 __ xorps(xmm_scratch, xmm_scratch); | 1978 __ Xorpd(xmm_scratch, xmm_scratch); |
1979 __ ucomisd(left_reg, xmm_scratch); | 1979 __ ucomisd(left_reg, xmm_scratch); |
1980 __ j(not_equal, &return_left, Label::kNear); // left == right != 0. | 1980 __ j(not_equal, &return_left, Label::kNear); // left == right != 0. |
1981 // At this point, both left and right are either 0 or -0. | 1981 // At this point, both left and right are either 0 or -0. |
1982 if (operation == HMathMinMax::kMathMin) { | 1982 if (operation == HMathMinMax::kMathMin) { |
1983 __ orps(left_reg, right_reg); | 1983 __ orps(left_reg, right_reg); |
1984 } else { | 1984 } else { |
1985 // Since we operate on +0 and/or -0, addsd and andsd have the same effect. | 1985 // Since we operate on +0 and/or -0, addsd and andsd have the same effect. |
1986 __ addsd(left_reg, right_reg); | 1986 __ addsd(left_reg, right_reg); |
1987 } | 1987 } |
1988 __ jmp(&return_left, Label::kNear); | 1988 __ jmp(&return_left, Label::kNear); |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2121 EmitBranch(instr, not_zero); | 2121 EmitBranch(instr, not_zero); |
2122 } else if (r.IsSmi()) { | 2122 } else if (r.IsSmi()) { |
2123 DCHECK(!info()->IsStub()); | 2123 DCHECK(!info()->IsStub()); |
2124 Register reg = ToRegister(instr->value()); | 2124 Register reg = ToRegister(instr->value()); |
2125 __ testp(reg, reg); | 2125 __ testp(reg, reg); |
2126 EmitBranch(instr, not_zero); | 2126 EmitBranch(instr, not_zero); |
2127 } else if (r.IsDouble()) { | 2127 } else if (r.IsDouble()) { |
2128 DCHECK(!info()->IsStub()); | 2128 DCHECK(!info()->IsStub()); |
2129 XMMRegister reg = ToDoubleRegister(instr->value()); | 2129 XMMRegister reg = ToDoubleRegister(instr->value()); |
2130 XMMRegister xmm_scratch = double_scratch0(); | 2130 XMMRegister xmm_scratch = double_scratch0(); |
2131 __ xorps(xmm_scratch, xmm_scratch); | 2131 __ Xorpd(xmm_scratch, xmm_scratch); |
2132 __ ucomisd(reg, xmm_scratch); | 2132 __ ucomisd(reg, xmm_scratch); |
2133 EmitBranch(instr, not_equal); | 2133 EmitBranch(instr, not_equal); |
2134 } else { | 2134 } else { |
2135 DCHECK(r.IsTagged()); | 2135 DCHECK(r.IsTagged()); |
2136 Register reg = ToRegister(instr->value()); | 2136 Register reg = ToRegister(instr->value()); |
2137 HType type = instr->hydrogen()->value()->type(); | 2137 HType type = instr->hydrogen()->value()->type(); |
2138 if (type.IsBoolean()) { | 2138 if (type.IsBoolean()) { |
2139 DCHECK(!info()->IsStub()); | 2139 DCHECK(!info()->IsStub()); |
2140 __ CompareRoot(reg, Heap::kTrueValueRootIndex); | 2140 __ CompareRoot(reg, Heap::kTrueValueRootIndex); |
2141 EmitBranch(instr, equal); | 2141 EmitBranch(instr, equal); |
2142 } else if (type.IsSmi()) { | 2142 } else if (type.IsSmi()) { |
2143 DCHECK(!info()->IsStub()); | 2143 DCHECK(!info()->IsStub()); |
2144 __ SmiCompare(reg, Smi::FromInt(0)); | 2144 __ SmiCompare(reg, Smi::FromInt(0)); |
2145 EmitBranch(instr, not_equal); | 2145 EmitBranch(instr, not_equal); |
2146 } else if (type.IsJSArray()) { | 2146 } else if (type.IsJSArray()) { |
2147 DCHECK(!info()->IsStub()); | 2147 DCHECK(!info()->IsStub()); |
2148 EmitBranch(instr, no_condition); | 2148 EmitBranch(instr, no_condition); |
2149 } else if (type.IsHeapNumber()) { | 2149 } else if (type.IsHeapNumber()) { |
2150 DCHECK(!info()->IsStub()); | 2150 DCHECK(!info()->IsStub()); |
2151 XMMRegister xmm_scratch = double_scratch0(); | 2151 XMMRegister xmm_scratch = double_scratch0(); |
2152 __ xorps(xmm_scratch, xmm_scratch); | 2152 __ Xorpd(xmm_scratch, xmm_scratch); |
2153 __ ucomisd(xmm_scratch, FieldOperand(reg, HeapNumber::kValueOffset)); | 2153 __ ucomisd(xmm_scratch, FieldOperand(reg, HeapNumber::kValueOffset)); |
2154 EmitBranch(instr, not_equal); | 2154 EmitBranch(instr, not_equal); |
2155 } else if (type.IsString()) { | 2155 } else if (type.IsString()) { |
2156 DCHECK(!info()->IsStub()); | 2156 DCHECK(!info()->IsStub()); |
2157 __ cmpp(FieldOperand(reg, String::kLengthOffset), Immediate(0)); | 2157 __ cmpp(FieldOperand(reg, String::kLengthOffset), Immediate(0)); |
2158 EmitBranch(instr, not_equal); | 2158 EmitBranch(instr, not_equal); |
2159 } else { | 2159 } else { |
2160 ToBooleanStub::Types expected = instr->hydrogen()->expected_input_types(); | 2160 ToBooleanStub::Types expected = instr->hydrogen()->expected_input_types(); |
2161 // Avoid deopts in the case where we've never executed this path before. | 2161 // Avoid deopts in the case where we've never executed this path before. |
2162 if (expected.IsEmpty()) expected = ToBooleanStub::Types::Generic(); | 2162 if (expected.IsEmpty()) expected = ToBooleanStub::Types::Generic(); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2231 __ CmpInstanceType(map, SIMD128_VALUE_TYPE); | 2231 __ CmpInstanceType(map, SIMD128_VALUE_TYPE); |
2232 __ j(equal, instr->TrueLabel(chunk_)); | 2232 __ j(equal, instr->TrueLabel(chunk_)); |
2233 } | 2233 } |
2234 | 2234 |
2235 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { | 2235 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { |
2236 // heap number -> false iff +0, -0, or NaN. | 2236 // heap number -> false iff +0, -0, or NaN. |
2237 Label not_heap_number; | 2237 Label not_heap_number; |
2238 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex); | 2238 __ CompareRoot(map, Heap::kHeapNumberMapRootIndex); |
2239 __ j(not_equal, ¬_heap_number, Label::kNear); | 2239 __ j(not_equal, ¬_heap_number, Label::kNear); |
2240 XMMRegister xmm_scratch = double_scratch0(); | 2240 XMMRegister xmm_scratch = double_scratch0(); |
2241 __ xorps(xmm_scratch, xmm_scratch); | 2241 __ Xorpd(xmm_scratch, xmm_scratch); |
2242 __ ucomisd(xmm_scratch, FieldOperand(reg, HeapNumber::kValueOffset)); | 2242 __ ucomisd(xmm_scratch, FieldOperand(reg, HeapNumber::kValueOffset)); |
2243 __ j(zero, instr->FalseLabel(chunk_)); | 2243 __ j(zero, instr->FalseLabel(chunk_)); |
2244 __ jmp(instr->TrueLabel(chunk_)); | 2244 __ jmp(instr->TrueLabel(chunk_)); |
2245 __ bind(¬_heap_number); | 2245 __ bind(¬_heap_number); |
2246 } | 2246 } |
2247 | 2247 |
2248 if (!expected.IsGeneric()) { | 2248 if (!expected.IsGeneric()) { |
2249 // We've seen something for the first time -> deopt. | 2249 // We've seen something for the first time -> deopt. |
2250 // This can only happen if we are not generic already. | 2250 // This can only happen if we are not generic already. |
2251 DeoptimizeIf(no_condition, instr, Deoptimizer::kUnexpectedObject); | 2251 DeoptimizeIf(no_condition, instr, Deoptimizer::kUnexpectedObject); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2400 } | 2400 } |
2401 | 2401 |
2402 | 2402 |
2403 void LCodeGen::DoCompareMinusZeroAndBranch(LCompareMinusZeroAndBranch* instr) { | 2403 void LCodeGen::DoCompareMinusZeroAndBranch(LCompareMinusZeroAndBranch* instr) { |
2404 Representation rep = instr->hydrogen()->value()->representation(); | 2404 Representation rep = instr->hydrogen()->value()->representation(); |
2405 DCHECK(!rep.IsInteger32()); | 2405 DCHECK(!rep.IsInteger32()); |
2406 | 2406 |
2407 if (rep.IsDouble()) { | 2407 if (rep.IsDouble()) { |
2408 XMMRegister value = ToDoubleRegister(instr->value()); | 2408 XMMRegister value = ToDoubleRegister(instr->value()); |
2409 XMMRegister xmm_scratch = double_scratch0(); | 2409 XMMRegister xmm_scratch = double_scratch0(); |
2410 __ xorps(xmm_scratch, xmm_scratch); | 2410 __ Xorpd(xmm_scratch, xmm_scratch); |
2411 __ ucomisd(xmm_scratch, value); | 2411 __ ucomisd(xmm_scratch, value); |
2412 EmitFalseBranch(instr, not_equal); | 2412 EmitFalseBranch(instr, not_equal); |
2413 __ movmskpd(kScratchRegister, value); | 2413 __ movmskpd(kScratchRegister, value); |
2414 __ testl(kScratchRegister, Immediate(1)); | 2414 __ testl(kScratchRegister, Immediate(1)); |
2415 EmitBranch(instr, not_zero); | 2415 EmitBranch(instr, not_zero); |
2416 } else { | 2416 } else { |
2417 Register value = ToRegister(instr->value()); | 2417 Register value = ToRegister(instr->value()); |
2418 Handle<Map> map = masm()->isolate()->factory()->heap_number_map(); | 2418 Handle<Map> map = masm()->isolate()->factory()->heap_number_map(); |
2419 __ CheckMap(value, map, instr->FalseLabel(chunk()), DO_SMI_CHECK); | 2419 __ CheckMap(value, map, instr->FalseLabel(chunk()), DO_SMI_CHECK); |
2420 __ cmpl(FieldOperand(value, HeapNumber::kExponentOffset), | 2420 __ cmpl(FieldOperand(value, HeapNumber::kExponentOffset), |
(...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3569 private: | 3569 private: |
3570 LMathAbs* instr_; | 3570 LMathAbs* instr_; |
3571 }; | 3571 }; |
3572 | 3572 |
3573 DCHECK(instr->value()->Equals(instr->result())); | 3573 DCHECK(instr->value()->Equals(instr->result())); |
3574 Representation r = instr->hydrogen()->value()->representation(); | 3574 Representation r = instr->hydrogen()->value()->representation(); |
3575 | 3575 |
3576 if (r.IsDouble()) { | 3576 if (r.IsDouble()) { |
3577 XMMRegister scratch = double_scratch0(); | 3577 XMMRegister scratch = double_scratch0(); |
3578 XMMRegister input_reg = ToDoubleRegister(instr->value()); | 3578 XMMRegister input_reg = ToDoubleRegister(instr->value()); |
3579 __ xorps(scratch, scratch); | 3579 __ Xorpd(scratch, scratch); |
3580 __ subsd(scratch, input_reg); | 3580 __ subsd(scratch, input_reg); |
3581 __ andps(input_reg, scratch); | 3581 __ andps(input_reg, scratch); |
3582 } else if (r.IsInteger32()) { | 3582 } else if (r.IsInteger32()) { |
3583 EmitIntegerMathAbs(instr); | 3583 EmitIntegerMathAbs(instr); |
3584 } else if (r.IsSmi()) { | 3584 } else if (r.IsSmi()) { |
3585 EmitSmiMathAbs(instr); | 3585 EmitSmiMathAbs(instr); |
3586 } else { // Tagged case. | 3586 } else { // Tagged case. |
3587 DeferredMathAbsTaggedHeapNumber* deferred = | 3587 DeferredMathAbsTaggedHeapNumber* deferred = |
3588 new(zone()) DeferredMathAbsTaggedHeapNumber(this, instr); | 3588 new(zone()) DeferredMathAbsTaggedHeapNumber(this, instr); |
3589 Register input_reg = ToRegister(instr->value()); | 3589 Register input_reg = ToRegister(instr->value()); |
(...skipping 18 matching lines...) Expand all Loading... |
3608 __ subq(output_reg, Immediate(1)); | 3608 __ subq(output_reg, Immediate(1)); |
3609 DeoptimizeIf(overflow, instr, Deoptimizer::kMinusZero); | 3609 DeoptimizeIf(overflow, instr, Deoptimizer::kMinusZero); |
3610 } | 3610 } |
3611 __ roundsd(xmm_scratch, input_reg, kRoundDown); | 3611 __ roundsd(xmm_scratch, input_reg, kRoundDown); |
3612 __ cvttsd2si(output_reg, xmm_scratch); | 3612 __ cvttsd2si(output_reg, xmm_scratch); |
3613 __ cmpl(output_reg, Immediate(0x1)); | 3613 __ cmpl(output_reg, Immediate(0x1)); |
3614 DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow); | 3614 DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow); |
3615 } else { | 3615 } else { |
3616 Label negative_sign, done; | 3616 Label negative_sign, done; |
3617 // Deoptimize on unordered. | 3617 // Deoptimize on unordered. |
3618 __ xorps(xmm_scratch, xmm_scratch); // Zero the register. | 3618 __ Xorpd(xmm_scratch, xmm_scratch); // Zero the register. |
3619 __ ucomisd(input_reg, xmm_scratch); | 3619 __ ucomisd(input_reg, xmm_scratch); |
3620 DeoptimizeIf(parity_even, instr, Deoptimizer::kNaN); | 3620 DeoptimizeIf(parity_even, instr, Deoptimizer::kNaN); |
3621 __ j(below, &negative_sign, Label::kNear); | 3621 __ j(below, &negative_sign, Label::kNear); |
3622 | 3622 |
3623 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { | 3623 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
3624 // Check for negative zero. | 3624 // Check for negative zero. |
3625 Label positive_sign; | 3625 Label positive_sign; |
3626 __ j(above, &positive_sign, Label::kNear); | 3626 __ j(above, &positive_sign, Label::kNear); |
3627 __ movmskpd(output_reg, input_reg); | 3627 __ movmskpd(output_reg, input_reg); |
3628 __ testq(output_reg, Immediate(1)); | 3628 __ testq(output_reg, Immediate(1)); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3744 // Check base for -Infinity. According to IEEE-754, double-precision | 3744 // Check base for -Infinity. According to IEEE-754, double-precision |
3745 // -Infinity has the highest 12 bits set and the lowest 52 bits cleared. | 3745 // -Infinity has the highest 12 bits set and the lowest 52 bits cleared. |
3746 __ movq(kScratchRegister, V8_INT64_C(0xFFF0000000000000)); | 3746 __ movq(kScratchRegister, V8_INT64_C(0xFFF0000000000000)); |
3747 __ Movq(xmm_scratch, kScratchRegister); | 3747 __ Movq(xmm_scratch, kScratchRegister); |
3748 __ ucomisd(xmm_scratch, input_reg); | 3748 __ ucomisd(xmm_scratch, input_reg); |
3749 // Comparing -Infinity with NaN results in "unordered", which sets the | 3749 // Comparing -Infinity with NaN results in "unordered", which sets the |
3750 // zero flag as if both were equal. However, it also sets the carry flag. | 3750 // zero flag as if both were equal. However, it also sets the carry flag. |
3751 __ j(not_equal, &sqrt, Label::kNear); | 3751 __ j(not_equal, &sqrt, Label::kNear); |
3752 __ j(carry, &sqrt, Label::kNear); | 3752 __ j(carry, &sqrt, Label::kNear); |
3753 // If input is -Infinity, return Infinity. | 3753 // If input is -Infinity, return Infinity. |
3754 __ xorps(input_reg, input_reg); | 3754 __ Xorpd(input_reg, input_reg); |
3755 __ subsd(input_reg, xmm_scratch); | 3755 __ subsd(input_reg, xmm_scratch); |
3756 __ jmp(&done, Label::kNear); | 3756 __ jmp(&done, Label::kNear); |
3757 | 3757 |
3758 // Square root. | 3758 // Square root. |
3759 __ bind(&sqrt); | 3759 __ bind(&sqrt); |
3760 __ xorps(xmm_scratch, xmm_scratch); | 3760 __ Xorpd(xmm_scratch, xmm_scratch); |
3761 __ addsd(input_reg, xmm_scratch); // Convert -0 to +0. | 3761 __ addsd(input_reg, xmm_scratch); // Convert -0 to +0. |
3762 __ sqrtsd(input_reg, input_reg); | 3762 __ sqrtsd(input_reg, input_reg); |
3763 __ bind(&done); | 3763 __ bind(&done); |
3764 } | 3764 } |
3765 | 3765 |
3766 | 3766 |
3767 void LCodeGen::DoPower(LPower* instr) { | 3767 void LCodeGen::DoPower(LPower* instr) { |
3768 Representation exponent_type = instr->hydrogen()->right()->representation(); | 3768 Representation exponent_type = instr->hydrogen()->right()->representation(); |
3769 // Having marked this as a call, we can use any registers. | 3769 // Having marked this as a call, we can use any registers. |
3770 // Just make sure that the input/output registers are the expected ones. | 3770 // Just make sure that the input/output registers are the expected ones. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3808 | 3808 |
3809 MathExpGenerator::EmitMathExp(masm(), input, result, temp0, temp1, temp2); | 3809 MathExpGenerator::EmitMathExp(masm(), input, result, temp0, temp1, temp2); |
3810 } | 3810 } |
3811 | 3811 |
3812 | 3812 |
3813 void LCodeGen::DoMathLog(LMathLog* instr) { | 3813 void LCodeGen::DoMathLog(LMathLog* instr) { |
3814 DCHECK(instr->value()->Equals(instr->result())); | 3814 DCHECK(instr->value()->Equals(instr->result())); |
3815 XMMRegister input_reg = ToDoubleRegister(instr->value()); | 3815 XMMRegister input_reg = ToDoubleRegister(instr->value()); |
3816 XMMRegister xmm_scratch = double_scratch0(); | 3816 XMMRegister xmm_scratch = double_scratch0(); |
3817 Label positive, done, zero; | 3817 Label positive, done, zero; |
3818 __ xorps(xmm_scratch, xmm_scratch); | 3818 __ Xorpd(xmm_scratch, xmm_scratch); |
3819 __ ucomisd(input_reg, xmm_scratch); | 3819 __ ucomisd(input_reg, xmm_scratch); |
3820 __ j(above, &positive, Label::kNear); | 3820 __ j(above, &positive, Label::kNear); |
3821 __ j(not_carry, &zero, Label::kNear); | 3821 __ j(not_carry, &zero, Label::kNear); |
3822 __ pcmpeqd(input_reg, input_reg); | 3822 __ pcmpeqd(input_reg, input_reg); |
3823 __ jmp(&done, Label::kNear); | 3823 __ jmp(&done, Label::kNear); |
3824 __ bind(&zero); | 3824 __ bind(&zero); |
3825 ExternalReference ninf = | 3825 ExternalReference ninf = |
3826 ExternalReference::address_of_negative_infinity(); | 3826 ExternalReference::address_of_negative_infinity(); |
3827 Operand ninf_operand = masm()->ExternalOperand(ninf); | 3827 Operand ninf_operand = masm()->ExternalOperand(ninf); |
3828 __ Movsd(input_reg, ninf_operand); | 3828 __ Movsd(input_reg, ninf_operand); |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4286 LOperand* key = instr->key(); | 4286 LOperand* key = instr->key(); |
4287 if (kPointerSize == kInt32Size && !key->IsConstantOperand() && | 4287 if (kPointerSize == kInt32Size && !key->IsConstantOperand() && |
4288 instr->hydrogen()->IsDehoisted()) { | 4288 instr->hydrogen()->IsDehoisted()) { |
4289 // Sign extend key because it could be a 32 bit negative value | 4289 // Sign extend key because it could be a 32 bit negative value |
4290 // and the dehoisted address computation happens in 64 bits | 4290 // and the dehoisted address computation happens in 64 bits |
4291 __ movsxlq(ToRegister(key), ToRegister(key)); | 4291 __ movsxlq(ToRegister(key), ToRegister(key)); |
4292 } | 4292 } |
4293 if (instr->NeedsCanonicalization()) { | 4293 if (instr->NeedsCanonicalization()) { |
4294 XMMRegister xmm_scratch = double_scratch0(); | 4294 XMMRegister xmm_scratch = double_scratch0(); |
4295 // Turn potential sNaN value into qNaN. | 4295 // Turn potential sNaN value into qNaN. |
4296 __ xorps(xmm_scratch, xmm_scratch); | 4296 __ Xorpd(xmm_scratch, xmm_scratch); |
4297 __ subsd(value, xmm_scratch); | 4297 __ subsd(value, xmm_scratch); |
4298 } | 4298 } |
4299 | 4299 |
4300 Operand double_store_operand = BuildFastArrayOperand( | 4300 Operand double_store_operand = BuildFastArrayOperand( |
4301 instr->elements(), | 4301 instr->elements(), |
4302 key, | 4302 key, |
4303 instr->hydrogen()->key()->representation(), | 4303 instr->hydrogen()->key()->representation(), |
4304 FAST_DOUBLE_ELEMENTS, | 4304 FAST_DOUBLE_ELEMENTS, |
4305 instr->base_offset()); | 4305 instr->base_offset()); |
4306 | 4306 |
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4917 __ Movsd(result_reg, FieldOperand(input_reg, HeapNumber::kValueOffset)); | 4917 __ Movsd(result_reg, FieldOperand(input_reg, HeapNumber::kValueOffset)); |
4918 | 4918 |
4919 if (can_convert_undefined_to_nan) { | 4919 if (can_convert_undefined_to_nan) { |
4920 __ j(not_equal, &convert, Label::kNear); | 4920 __ j(not_equal, &convert, Label::kNear); |
4921 } else { | 4921 } else { |
4922 DeoptimizeIf(not_equal, instr, Deoptimizer::kNotAHeapNumber); | 4922 DeoptimizeIf(not_equal, instr, Deoptimizer::kNotAHeapNumber); |
4923 } | 4923 } |
4924 | 4924 |
4925 if (deoptimize_on_minus_zero) { | 4925 if (deoptimize_on_minus_zero) { |
4926 XMMRegister xmm_scratch = double_scratch0(); | 4926 XMMRegister xmm_scratch = double_scratch0(); |
4927 __ xorps(xmm_scratch, xmm_scratch); | 4927 __ Xorpd(xmm_scratch, xmm_scratch); |
4928 __ ucomisd(xmm_scratch, result_reg); | 4928 __ ucomisd(xmm_scratch, result_reg); |
4929 __ j(not_equal, &done, Label::kNear); | 4929 __ j(not_equal, &done, Label::kNear); |
4930 __ movmskpd(kScratchRegister, result_reg); | 4930 __ movmskpd(kScratchRegister, result_reg); |
4931 __ testq(kScratchRegister, Immediate(1)); | 4931 __ testq(kScratchRegister, Immediate(1)); |
4932 DeoptimizeIf(not_zero, instr, Deoptimizer::kMinusZero); | 4932 DeoptimizeIf(not_zero, instr, Deoptimizer::kMinusZero); |
4933 } | 4933 } |
4934 __ jmp(&done, Label::kNear); | 4934 __ jmp(&done, Label::kNear); |
4935 | 4935 |
4936 if (can_convert_undefined_to_nan) { | 4936 if (can_convert_undefined_to_nan) { |
4937 __ bind(&convert); | 4937 __ bind(&convert); |
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5905 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5905 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5906 } | 5906 } |
5907 | 5907 |
5908 | 5908 |
5909 #undef __ | 5909 #undef __ |
5910 | 5910 |
5911 } // namespace internal | 5911 } // namespace internal |
5912 } // namespace v8 | 5912 } // namespace v8 |
5913 | 5913 |
5914 #endif // V8_TARGET_ARCH_X64 | 5914 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |