| 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 #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/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 3873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3884 __ sqrtsd(input_reg, input_reg); | 3884 __ sqrtsd(input_reg, input_reg); |
| 3885 __ bind(&done); | 3885 __ bind(&done); |
| 3886 } | 3886 } |
| 3887 | 3887 |
| 3888 | 3888 |
| 3889 void LCodeGen::DoPower(LPower* instr) { | 3889 void LCodeGen::DoPower(LPower* instr) { |
| 3890 Representation exponent_type = instr->hydrogen()->right()->representation(); | 3890 Representation exponent_type = instr->hydrogen()->right()->representation(); |
| 3891 // Having marked this as a call, we can use any registers. | 3891 // Having marked this as a call, we can use any registers. |
| 3892 // Just make sure that the input/output registers are the expected ones. | 3892 // Just make sure that the input/output registers are the expected ones. |
| 3893 | 3893 |
| 3894 Register exponent = rdx; | 3894 Register tagged_exponent = MathPowTaggedDescriptor::exponent(); |
| 3895 DCHECK(!instr->right()->IsRegister() || | 3895 DCHECK(!instr->right()->IsRegister() || |
| 3896 ToRegister(instr->right()).is(exponent)); | 3896 ToRegister(instr->right()).is(tagged_exponent)); |
| 3897 DCHECK(!instr->right()->IsDoubleRegister() || | 3897 DCHECK(!instr->right()->IsDoubleRegister() || |
| 3898 ToDoubleRegister(instr->right()).is(xmm1)); | 3898 ToDoubleRegister(instr->right()).is(xmm1)); |
| 3899 DCHECK(ToDoubleRegister(instr->left()).is(xmm2)); | 3899 DCHECK(ToDoubleRegister(instr->left()).is(xmm2)); |
| 3900 DCHECK(ToDoubleRegister(instr->result()).is(xmm3)); | 3900 DCHECK(ToDoubleRegister(instr->result()).is(xmm3)); |
| 3901 | 3901 |
| 3902 if (exponent_type.IsSmi()) { | 3902 if (exponent_type.IsSmi()) { |
| 3903 MathPowStub stub(isolate(), MathPowStub::TAGGED); | 3903 MathPowStub stub(isolate(), MathPowStub::TAGGED); |
| 3904 __ CallStub(&stub); | 3904 __ CallStub(&stub); |
| 3905 } else if (exponent_type.IsTagged()) { | 3905 } else if (exponent_type.IsTagged()) { |
| 3906 Label no_deopt; | 3906 Label no_deopt; |
| 3907 __ JumpIfSmi(exponent, &no_deopt, Label::kNear); | 3907 __ JumpIfSmi(tagged_exponent, &no_deopt, Label::kNear); |
| 3908 __ CmpObjectType(exponent, HEAP_NUMBER_TYPE, rcx); | 3908 __ CmpObjectType(tagged_exponent, HEAP_NUMBER_TYPE, rcx); |
| 3909 DeoptimizeIf(not_equal, instr->environment()); | 3909 DeoptimizeIf(not_equal, instr->environment()); |
| 3910 __ bind(&no_deopt); | 3910 __ bind(&no_deopt); |
| 3911 MathPowStub stub(isolate(), MathPowStub::TAGGED); | 3911 MathPowStub stub(isolate(), MathPowStub::TAGGED); |
| 3912 __ CallStub(&stub); | 3912 __ CallStub(&stub); |
| 3913 } else if (exponent_type.IsInteger32()) { | 3913 } else if (exponent_type.IsInteger32()) { |
| 3914 MathPowStub stub(isolate(), MathPowStub::INTEGER); | 3914 MathPowStub stub(isolate(), MathPowStub::INTEGER); |
| 3915 __ CallStub(&stub); | 3915 __ CallStub(&stub); |
| 3916 } else { | 3916 } else { |
| 3917 DCHECK(exponent_type.IsDouble()); | 3917 DCHECK(exponent_type.IsDouble()); |
| 3918 MathPowStub stub(isolate(), MathPowStub::DOUBLE); | 3918 MathPowStub stub(isolate(), MathPowStub::DOUBLE); |
| (...skipping 1955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5874 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5874 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5875 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5875 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5876 } | 5876 } |
| 5877 | 5877 |
| 5878 | 5878 |
| 5879 #undef __ | 5879 #undef __ |
| 5880 | 5880 |
| 5881 } } // namespace v8::internal | 5881 } } // namespace v8::internal |
| 5882 | 5882 |
| 5883 #endif // V8_TARGET_ARCH_X64 | 5883 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |