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 #if V8_TARGET_ARCH_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
875 double_scratch); | 875 double_scratch); |
876 // double_scratch can be overwritten in the delay slot. | 876 // double_scratch can be overwritten in the delay slot. |
877 // Calculates square root of base. Check for the special case of | 877 // Calculates square root of base. Check for the special case of |
878 // Math.pow(-Infinity, -0.5) == 0 (ECMA spec, 15.8.2.13). | 878 // Math.pow(-Infinity, -0.5) == 0 (ECMA spec, 15.8.2.13). |
879 __ Move(double_scratch, -V8_INFINITY); | 879 __ Move(double_scratch, -V8_INFINITY); |
880 __ BranchF(USE_DELAY_SLOT, &done, NULL, eq, double_base, double_scratch); | 880 __ BranchF(USE_DELAY_SLOT, &done, NULL, eq, double_base, double_scratch); |
881 __ Move(double_result, kDoubleRegZero); | 881 __ Move(double_result, kDoubleRegZero); |
882 | 882 |
883 // Add +0 to convert -0 to +0. | 883 // Add +0 to convert -0 to +0. |
884 __ add_d(double_scratch, double_base, kDoubleRegZero); | 884 __ add_d(double_scratch, double_base, kDoubleRegZero); |
885 __ Move(double_result, 1); | 885 __ Move(double_result, 1.); |
886 __ sqrt_d(double_scratch, double_scratch); | 886 __ sqrt_d(double_scratch, double_scratch); |
887 __ div_d(double_result, double_result, double_scratch); | 887 __ div_d(double_result, double_result, double_scratch); |
888 __ jmp(&done); | 888 __ jmp(&done); |
889 } | 889 } |
890 | 890 |
891 __ push(ra); | 891 __ push(ra); |
892 { | 892 { |
893 AllowExternalCallThatCantCauseGC scope(masm); | 893 AllowExternalCallThatCantCauseGC scope(masm); |
894 __ PrepareCallCFunction(0, 2, scratch2); | 894 __ PrepareCallCFunction(0, 2, scratch2); |
895 __ MovToFloatParameters(double_base, double_exponent); | 895 __ MovToFloatParameters(double_base, double_exponent); |
(...skipping 4036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4932 MemOperand(fp, 6 * kPointerSize), | 4932 MemOperand(fp, 6 * kPointerSize), |
4933 NULL); | 4933 NULL); |
4934 } | 4934 } |
4935 | 4935 |
4936 | 4936 |
4937 #undef __ | 4937 #undef __ |
4938 | 4938 |
4939 } } // namespace v8::internal | 4939 } } // namespace v8::internal |
4940 | 4940 |
4941 #endif // V8_TARGET_ARCH_MIPS | 4941 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |