| 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 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
| 8 #include "src/hydrogen-osr.h" | 8 #include "src/hydrogen-osr.h" |
| 9 #include "src/ic/stub-cache.h" | 9 #include "src/ic/stub-cache.h" |
| 10 #include "src/mips64/lithium-codegen-mips64.h" | 10 #include "src/mips64/lithium-codegen-mips64.h" |
| (...skipping 3875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3886 __ add_d(result, input, kDoubleRegZero); | 3886 __ add_d(result, input, kDoubleRegZero); |
| 3887 __ sqrt_d(result, result); | 3887 __ sqrt_d(result, result); |
| 3888 __ bind(&done); | 3888 __ bind(&done); |
| 3889 } | 3889 } |
| 3890 | 3890 |
| 3891 | 3891 |
| 3892 void LCodeGen::DoPower(LPower* instr) { | 3892 void LCodeGen::DoPower(LPower* instr) { |
| 3893 Representation exponent_type = instr->hydrogen()->right()->representation(); | 3893 Representation exponent_type = instr->hydrogen()->right()->representation(); |
| 3894 // Having marked this as a call, we can use any registers. | 3894 // Having marked this as a call, we can use any registers. |
| 3895 // Just make sure that the input/output registers are the expected ones. | 3895 // Just make sure that the input/output registers are the expected ones. |
| 3896 Register tagged_exponent = MathPowTaggedDescriptor::exponent(); |
| 3896 DCHECK(!instr->right()->IsDoubleRegister() || | 3897 DCHECK(!instr->right()->IsDoubleRegister() || |
| 3897 ToDoubleRegister(instr->right()).is(f4)); | 3898 ToDoubleRegister(instr->right()).is(f4)); |
| 3898 DCHECK(!instr->right()->IsRegister() || | 3899 DCHECK(!instr->right()->IsRegister() || |
| 3899 ToRegister(instr->right()).is(a2)); | 3900 ToRegister(instr->right()).is(tagged_exponent)); |
| 3900 DCHECK(ToDoubleRegister(instr->left()).is(f2)); | 3901 DCHECK(ToDoubleRegister(instr->left()).is(f2)); |
| 3901 DCHECK(ToDoubleRegister(instr->result()).is(f0)); | 3902 DCHECK(ToDoubleRegister(instr->result()).is(f0)); |
| 3902 | 3903 |
| 3903 if (exponent_type.IsSmi()) { | 3904 if (exponent_type.IsSmi()) { |
| 3904 MathPowStub stub(isolate(), MathPowStub::TAGGED); | 3905 MathPowStub stub(isolate(), MathPowStub::TAGGED); |
| 3905 __ CallStub(&stub); | 3906 __ CallStub(&stub); |
| 3906 } else if (exponent_type.IsTagged()) { | 3907 } else if (exponent_type.IsTagged()) { |
| 3907 Label no_deopt; | 3908 Label no_deopt; |
| 3908 __ JumpIfSmi(a2, &no_deopt); | 3909 __ JumpIfSmi(tagged_exponent, &no_deopt); |
| 3909 __ ld(a7, FieldMemOperand(a2, HeapObject::kMapOffset)); | 3910 DCHECK(!a7.is(tagged_exponent)); |
| 3911 __ lw(a7, FieldMemOperand(tagged_exponent, HeapObject::kMapOffset)); |
| 3910 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); | 3912 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); |
| 3911 DeoptimizeIf(ne, instr->environment(), a7, Operand(at)); | 3913 DeoptimizeIf(ne, instr->environment(), a7, Operand(at)); |
| 3912 __ bind(&no_deopt); | 3914 __ bind(&no_deopt); |
| 3913 MathPowStub stub(isolate(), MathPowStub::TAGGED); | 3915 MathPowStub stub(isolate(), MathPowStub::TAGGED); |
| 3914 __ CallStub(&stub); | 3916 __ CallStub(&stub); |
| 3915 } else if (exponent_type.IsInteger32()) { | 3917 } else if (exponent_type.IsInteger32()) { |
| 3916 MathPowStub stub(isolate(), MathPowStub::INTEGER); | 3918 MathPowStub stub(isolate(), MathPowStub::INTEGER); |
| 3917 __ CallStub(&stub); | 3919 __ CallStub(&stub); |
| 3918 } else { | 3920 } else { |
| 3919 DCHECK(exponent_type.IsDouble()); | 3921 DCHECK(exponent_type.IsDouble()); |
| (...skipping 2044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5964 __ li(at, scope_info); | 5966 __ li(at, scope_info); |
| 5965 __ Push(at, ToRegister(instr->function())); | 5967 __ Push(at, ToRegister(instr->function())); |
| 5966 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5968 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5967 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5969 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5968 } | 5970 } |
| 5969 | 5971 |
| 5970 | 5972 |
| 5971 #undef __ | 5973 #undef __ |
| 5972 | 5974 |
| 5973 } } // namespace v8::internal | 5975 } } // namespace v8::internal |
| OLD | NEW |