OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
880 | 880 |
881 static double math_log_double(double x) { | 881 static double math_log_double(double x) { |
882 return log(x); | 882 return log(x); |
883 } | 883 } |
884 | 884 |
885 | 885 |
886 ExternalReference ExternalReference::math_sin_double_function( | 886 ExternalReference ExternalReference::math_sin_double_function( |
887 Isolate* isolate) { | 887 Isolate* isolate) { |
888 return ExternalReference(Redirect(isolate, | 888 return ExternalReference(Redirect(isolate, |
889 FUNCTION_ADDR(math_sin_double), | 889 FUNCTION_ADDR(math_sin_double), |
890 FP_RETURN_CALL)); | 890 BUILTIN_FP_CALL)); |
891 } | 891 } |
892 | 892 |
893 | 893 |
894 ExternalReference ExternalReference::math_cos_double_function( | 894 ExternalReference ExternalReference::math_cos_double_function( |
895 Isolate* isolate) { | 895 Isolate* isolate) { |
896 return ExternalReference(Redirect(isolate, | 896 return ExternalReference(Redirect(isolate, |
897 FUNCTION_ADDR(math_cos_double), | 897 FUNCTION_ADDR(math_cos_double), |
898 FP_RETURN_CALL)); | 898 BUILTIN_FP_CALL)); |
899 } | 899 } |
900 | 900 |
901 | 901 |
902 ExternalReference ExternalReference::math_log_double_function( | 902 ExternalReference ExternalReference::math_log_double_function( |
903 Isolate* isolate) { | 903 Isolate* isolate) { |
904 return ExternalReference(Redirect(isolate, | 904 return ExternalReference(Redirect(isolate, |
905 FUNCTION_ADDR(math_log_double), | 905 FUNCTION_ADDR(math_log_double), |
906 FP_RETURN_CALL)); | 906 BUILTIN_FP_CALL)); |
907 } | 907 } |
908 | 908 |
909 | 909 |
910 // Helper function to compute x^y, where y is known to be an | 910 // Helper function to compute x^y, where y is known to be an |
911 // integer. Uses binary decomposition to limit the number of | 911 // integer. Uses binary decomposition to limit the number of |
912 // multiplications; see the discussion in "Hacker's Delight" by Henry | 912 // multiplications; see the discussion in "Hacker's Delight" by Henry |
913 // S. Warren, Jr., figure 11-6, page 213. | 913 // S. Warren, Jr., figure 11-6, page 213. |
914 double power_double_int(double x, int y) { | 914 double power_double_int(double x, int y) { |
915 double m = (y < 0) ? 1 / x : x; | 915 double m = (y < 0) ? 1 / x : x; |
916 unsigned n = (y < 0) ? -y : y; | 916 unsigned n = (y < 0) ? -y : y; |
(...skipping 22 matching lines...) Expand all Loading... |
939 return OS::nan_value(); | 939 return OS::nan_value(); |
940 } | 940 } |
941 return pow(x, y); | 941 return pow(x, y); |
942 } | 942 } |
943 | 943 |
944 | 944 |
945 ExternalReference ExternalReference::power_double_double_function( | 945 ExternalReference ExternalReference::power_double_double_function( |
946 Isolate* isolate) { | 946 Isolate* isolate) { |
947 return ExternalReference(Redirect(isolate, | 947 return ExternalReference(Redirect(isolate, |
948 FUNCTION_ADDR(power_double_double), | 948 FUNCTION_ADDR(power_double_double), |
949 FP_RETURN_CALL)); | 949 BUILTIN_FP_FP_CALL)); |
950 } | 950 } |
951 | 951 |
952 | 952 |
953 ExternalReference ExternalReference::power_double_int_function( | 953 ExternalReference ExternalReference::power_double_int_function( |
954 Isolate* isolate) { | 954 Isolate* isolate) { |
955 return ExternalReference(Redirect(isolate, | 955 return ExternalReference(Redirect(isolate, |
956 FUNCTION_ADDR(power_double_int), | 956 FUNCTION_ADDR(power_double_int), |
957 FP_RETURN_CALL)); | 957 BUILTIN_FP_INT_CALL)); |
958 } | 958 } |
959 | 959 |
960 | 960 |
961 static int native_compare_doubles(double y, double x) { | 961 static int native_compare_doubles(double y, double x) { |
962 if (x == y) return EQUAL; | 962 if (x == y) return EQUAL; |
963 return x < y ? LESS : GREATER; | 963 return x < y ? LESS : GREATER; |
964 } | 964 } |
965 | 965 |
966 | 966 |
967 ExternalReference ExternalReference::double_fp_operation( | 967 ExternalReference ExternalReference::double_fp_operation( |
(...skipping 15 matching lines...) Expand all Loading... |
983 break; | 983 break; |
984 case Token::MOD: | 984 case Token::MOD: |
985 function = &mod_two_doubles; | 985 function = &mod_two_doubles; |
986 break; | 986 break; |
987 default: | 987 default: |
988 UNREACHABLE(); | 988 UNREACHABLE(); |
989 } | 989 } |
990 // Passing true as 2nd parameter indicates that they return an fp value. | 990 // Passing true as 2nd parameter indicates that they return an fp value. |
991 return ExternalReference(Redirect(isolate, | 991 return ExternalReference(Redirect(isolate, |
992 FUNCTION_ADDR(function), | 992 FUNCTION_ADDR(function), |
993 FP_RETURN_CALL)); | 993 BUILTIN_FP_FP_CALL)); |
994 } | 994 } |
995 | 995 |
996 | 996 |
997 ExternalReference ExternalReference::compare_doubles(Isolate* isolate) { | 997 ExternalReference ExternalReference::compare_doubles(Isolate* isolate) { |
998 return ExternalReference(Redirect(isolate, | 998 return ExternalReference(Redirect(isolate, |
999 FUNCTION_ADDR(native_compare_doubles), | 999 FUNCTION_ADDR(native_compare_doubles), |
1000 BUILTIN_CALL)); | 1000 BUILTIN_CALL)); |
1001 } | 1001 } |
1002 | 1002 |
1003 | 1003 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1059 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); | 1059 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); |
1060 state_.written_position = state_.current_position; | 1060 state_.written_position = state_.current_position; |
1061 written = true; | 1061 written = true; |
1062 } | 1062 } |
1063 | 1063 |
1064 // Return whether something was written. | 1064 // Return whether something was written. |
1065 return written; | 1065 return written; |
1066 } | 1066 } |
1067 | 1067 |
1068 } } // namespace v8::internal | 1068 } } // namespace v8::internal |
OLD | NEW |