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