OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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> |
| 6 |
5 #include "src/v8.h" | 7 #include "src/v8.h" |
6 | 8 |
7 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 11 #include "src/code-stubs.h" |
10 #include "src/hydrogen-osr.h" | 12 #include "src/hydrogen-osr.h" |
11 #include "src/ic/ic.h" | 13 #include "src/ic/ic.h" |
12 #include "src/ic/stub-cache.h" | 14 #include "src/ic/stub-cache.h" |
13 #include "src/ppc/lithium-codegen-ppc.h" | 15 #include "src/ppc/lithium-codegen-ppc.h" |
14 #include "src/ppc/lithium-gap-resolver-ppc.h" | 16 #include "src/ppc/lithium-gap-resolver-ppc.h" |
(...skipping 4014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4029 void LCodeGen::DoMathPowHalf(LMathPowHalf* instr) { | 4031 void LCodeGen::DoMathPowHalf(LMathPowHalf* instr) { |
4030 DoubleRegister input = ToDoubleRegister(instr->value()); | 4032 DoubleRegister input = ToDoubleRegister(instr->value()); |
4031 DoubleRegister result = ToDoubleRegister(instr->result()); | 4033 DoubleRegister result = ToDoubleRegister(instr->result()); |
4032 DoubleRegister temp = double_scratch0(); | 4034 DoubleRegister temp = double_scratch0(); |
4033 | 4035 |
4034 // Note that according to ECMA-262 15.8.2.13: | 4036 // Note that according to ECMA-262 15.8.2.13: |
4035 // Math.pow(-Infinity, 0.5) == Infinity | 4037 // Math.pow(-Infinity, 0.5) == Infinity |
4036 // Math.sqrt(-Infinity) == NaN | 4038 // Math.sqrt(-Infinity) == NaN |
4037 Label skip, done; | 4039 Label skip, done; |
4038 | 4040 |
4039 __ LoadDoubleLiteral(temp, -V8_INFINITY, scratch0()); | 4041 __ LoadDoubleLiteral(temp, -std::numeric_limits<double>::infinity(), |
| 4042 scratch0()); |
4040 __ fcmpu(input, temp); | 4043 __ fcmpu(input, temp); |
4041 __ bne(&skip); | 4044 __ bne(&skip); |
4042 __ fneg(result, temp); | 4045 __ fneg(result, temp); |
4043 __ b(&done); | 4046 __ b(&done); |
4044 | 4047 |
4045 // Add +0 to convert -0 to +0. | 4048 // Add +0 to convert -0 to +0. |
4046 __ bind(&skip); | 4049 __ bind(&skip); |
4047 __ fadd(result, input, kDoubleRegZero); | 4050 __ fadd(result, input, kDoubleRegZero); |
4048 __ fsqrt(result, result); | 4051 __ fsqrt(result, result); |
4049 __ bind(&done); | 4052 __ bind(&done); |
(...skipping 2077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6127 __ Push(scope_info); | 6130 __ Push(scope_info); |
6128 __ push(ToRegister(instr->function())); | 6131 __ push(ToRegister(instr->function())); |
6129 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6132 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6130 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6133 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6131 } | 6134 } |
6132 | 6135 |
6133 | 6136 |
6134 #undef __ | 6137 #undef __ |
6135 } | 6138 } |
6136 } // namespace v8::internal | 6139 } // namespace v8::internal |
OLD | NEW |