| 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 <limits> | 5 #include <limits> |
| 6 | 6 |
| 7 #include "src/v8.h" | 7 #include "src/v8.h" |
| 8 | 8 |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 3858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3869 DoubleRegister input = ToDoubleRegister(instr->value()); | 3869 DoubleRegister input = ToDoubleRegister(instr->value()); |
| 3870 DoubleRegister result = ToDoubleRegister(instr->result()); | 3870 DoubleRegister result = ToDoubleRegister(instr->result()); |
| 3871 DoubleRegister temp = ToDoubleRegister(instr->temp()); | 3871 DoubleRegister temp = ToDoubleRegister(instr->temp()); |
| 3872 | 3872 |
| 3873 DCHECK(!input.is(result)); | 3873 DCHECK(!input.is(result)); |
| 3874 | 3874 |
| 3875 // Note that according to ECMA-262 15.8.2.13: | 3875 // Note that according to ECMA-262 15.8.2.13: |
| 3876 // Math.pow(-Infinity, 0.5) == Infinity | 3876 // Math.pow(-Infinity, 0.5) == Infinity |
| 3877 // Math.sqrt(-Infinity) == NaN | 3877 // Math.sqrt(-Infinity) == NaN |
| 3878 Label done; | 3878 Label done; |
| 3879 __ Move(temp, -std::numeric_limits<double>::infinity()); | 3879 __ Move(temp, std::numeric_limits<double>::infinity()); |
| 3880 __ BranchF(USE_DELAY_SLOT, &done, NULL, eq, temp, input); | 3880 __ BranchF(USE_DELAY_SLOT, &done, NULL, eq, temp, input); |
| 3881 // Set up Infinity in the delay slot. | 3881 // Set up Infinity in the delay slot. |
| 3882 // result is overwritten if the branch is not taken. | 3882 // result is overwritten if the branch is not taken. |
| 3883 __ neg_d(result, temp); | 3883 __ neg_d(result, temp); |
| 3884 | 3884 |
| 3885 // Add +0 to convert -0 to +0. | 3885 // Add +0 to convert -0 to +0. |
| 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 } |
| (...skipping 2103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5993 __ li(at, scope_info); | 5993 __ li(at, scope_info); |
| 5994 __ Push(at, ToRegister(instr->function())); | 5994 __ Push(at, ToRegister(instr->function())); |
| 5995 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5995 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5996 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5996 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5997 } | 5997 } |
| 5998 | 5998 |
| 5999 | 5999 |
| 6000 #undef __ | 6000 #undef __ |
| 6001 | 6001 |
| 6002 } } // namespace v8::internal | 6002 } } // namespace v8::internal |
| OLD | NEW |