| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 3826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3837 DoubleRegister input = ToDoubleRegister(instr->value()); | 3837 DoubleRegister input = ToDoubleRegister(instr->value()); |
| 3838 DoubleRegister result = ToDoubleRegister(instr->result()); | 3838 DoubleRegister result = ToDoubleRegister(instr->result()); |
| 3839 DoubleRegister temp = ToDoubleRegister(instr->temp()); | 3839 DoubleRegister temp = ToDoubleRegister(instr->temp()); |
| 3840 | 3840 |
| 3841 DCHECK(!input.is(result)); | 3841 DCHECK(!input.is(result)); |
| 3842 | 3842 |
| 3843 // Note that according to ECMA-262 15.8.2.13: | 3843 // Note that according to ECMA-262 15.8.2.13: |
| 3844 // Math.pow(-Infinity, 0.5) == Infinity | 3844 // Math.pow(-Infinity, 0.5) == Infinity |
| 3845 // Math.sqrt(-Infinity) == NaN | 3845 // Math.sqrt(-Infinity) == NaN |
| 3846 Label done; | 3846 Label done; |
| 3847 __ Move(temp, std::numeric_limits<double>::infinity()); | 3847 __ Move(temp, -std::numeric_limits<double>::infinity()); |
| 3848 __ BranchF(USE_DELAY_SLOT, &done, NULL, eq, temp, input); | 3848 __ BranchF(USE_DELAY_SLOT, &done, NULL, eq, temp, input); |
| 3849 // Set up Infinity in the delay slot. | 3849 // Set up Infinity in the delay slot. |
| 3850 // result is overwritten if the branch is not taken. | 3850 // result is overwritten if the branch is not taken. |
| 3851 __ neg_d(result, temp); | 3851 __ neg_d(result, temp); |
| 3852 | 3852 |
| 3853 // Add +0 to convert -0 to +0. | 3853 // Add +0 to convert -0 to +0. |
| 3854 __ add_d(result, input, kDoubleRegZero); | 3854 __ add_d(result, input, kDoubleRegZero); |
| 3855 __ sqrt_d(result, result); | 3855 __ sqrt_d(result, result); |
| 3856 __ bind(&done); | 3856 __ bind(&done); |
| 3857 } | 3857 } |
| (...skipping 2105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5963 __ li(at, scope_info); | 5963 __ li(at, scope_info); |
| 5964 __ Push(at, ToRegister(instr->function())); | 5964 __ Push(at, ToRegister(instr->function())); |
| 5965 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5965 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5966 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5966 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5967 } | 5967 } |
| 5968 | 5968 |
| 5969 | 5969 |
| 5970 #undef __ | 5970 #undef __ |
| 5971 | 5971 |
| 5972 } } // namespace v8::internal | 5972 } } // namespace v8::internal |
| OLD | NEW |