OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
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 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
893 Register heap_number_map, | 893 Register heap_number_map, |
894 Label* on_heap_number, | 894 Label* on_heap_number, |
895 Label* on_not_heap_number = NULL); | 895 Label* on_not_heap_number = NULL); |
896 void JumpIfHeapNumber(Register object, | 896 void JumpIfHeapNumber(Register object, |
897 Label* on_heap_number, | 897 Label* on_heap_number, |
898 Register heap_number_map = NoReg); | 898 Register heap_number_map = NoReg); |
899 void JumpIfNotHeapNumber(Register object, | 899 void JumpIfNotHeapNumber(Register object, |
900 Label* on_not_heap_number, | 900 Label* on_not_heap_number, |
901 Register heap_number_map = NoReg); | 901 Register heap_number_map = NoReg); |
902 | 902 |
| 903 // Sets the vs flag if the input is -0.0. |
| 904 void TestForMinusZero(DoubleRegister input); |
| 905 |
903 // Jump to label if the input double register contains -0.0. | 906 // Jump to label if the input double register contains -0.0. |
904 void JumpIfMinusZero(DoubleRegister input, Label* on_negative_zero); | 907 void JumpIfMinusZero(DoubleRegister input, Label* on_negative_zero); |
905 | 908 |
906 // Generate code to do a lookup in the number string cache. If the number in | 909 // Generate code to do a lookup in the number string cache. If the number in |
907 // the register object is found in the cache the generated code falls through | 910 // the register object is found in the cache the generated code falls through |
908 // with the result in the result register. The object and the result register | 911 // with the result in the result register. The object and the result register |
909 // can be the same. If the number is not found in the cache the code jumps to | 912 // can be the same. If the number is not found in the cache the code jumps to |
910 // the label not_found with only the content of register object unchanged. | 913 // the label not_found with only the content of register object unchanged. |
911 void LookupNumberStringCache(Register object, | 914 void LookupNumberStringCache(Register object, |
912 Register result, | 915 Register result, |
913 Register scratch1, | 916 Register scratch1, |
914 Register scratch2, | 917 Register scratch2, |
915 Register scratch3, | 918 Register scratch3, |
916 Label* not_found); | 919 Label* not_found); |
917 | 920 |
918 // Saturate a signed 32-bit integer in input to an unsigned 8-bit integer in | 921 // Saturate a signed 32-bit integer in input to an unsigned 8-bit integer in |
919 // output. | 922 // output. |
920 void ClampInt32ToUint8(Register in_out); | 923 void ClampInt32ToUint8(Register in_out); |
921 void ClampInt32ToUint8(Register output, Register input); | 924 void ClampInt32ToUint8(Register output, Register input); |
922 | 925 |
923 // Saturate a double in input to an unsigned 8-bit integer in output. | 926 // Saturate a double in input to an unsigned 8-bit integer in output. |
924 void ClampDoubleToUint8(Register output, | 927 void ClampDoubleToUint8(Register output, |
925 DoubleRegister input, | 928 DoubleRegister input, |
926 DoubleRegister dbl_scratch); | 929 DoubleRegister dbl_scratch); |
927 | 930 |
928 // Try to convert a double to a signed 32-bit int. | 931 // Try to convert a double to a signed 32-bit int. |
929 // This succeeds if the result compares equal to the input, so inputs of -0.0 | 932 // This succeeds if the result compares equal to the input, so inputs of -0.0 |
930 // are converted to 0 and handled as a success. | 933 // are converted to 0 and handled as a success. |
| 934 // |
| 935 // On output the Z flag is set if the conversion was successful. |
931 void TryConvertDoubleToInt32(Register as_int, | 936 void TryConvertDoubleToInt32(Register as_int, |
932 FPRegister value, | 937 FPRegister value, |
933 FPRegister scratch_d, | 938 FPRegister scratch_d, |
934 Label* on_successful_conversion, | 939 Label* on_successful_conversion = NULL, |
935 Label* on_failed_conversion = NULL) { | 940 Label* on_failed_conversion = NULL) { |
936 ASSERT(as_int.Is32Bits()); | 941 ASSERT(as_int.Is32Bits()); |
937 TryConvertDoubleToInt(as_int, value, scratch_d, on_successful_conversion, | 942 TryConvertDoubleToInt(as_int, value, scratch_d, on_successful_conversion, |
938 on_failed_conversion); | 943 on_failed_conversion); |
939 } | 944 } |
940 | 945 |
941 // Try to convert a double to a signed 64-bit int. | 946 // Try to convert a double to a signed 64-bit int. |
942 // This succeeds if the result compares equal to the input, so inputs of -0.0 | 947 // This succeeds if the result compares equal to the input, so inputs of -0.0 |
943 // are converted to 0 and handled as a success. | 948 // are converted to 0 and handled as a success. |
| 949 // |
| 950 // On output the Z flag is set if the conversion was successful. |
944 void TryConvertDoubleToInt64(Register as_int, | 951 void TryConvertDoubleToInt64(Register as_int, |
945 FPRegister value, | 952 FPRegister value, |
946 FPRegister scratch_d, | 953 FPRegister scratch_d, |
947 Label* on_successful_conversion, | 954 Label* on_successful_conversion = NULL, |
948 Label* on_failed_conversion = NULL) { | 955 Label* on_failed_conversion = NULL) { |
949 ASSERT(as_int.Is64Bits()); | 956 ASSERT(as_int.Is64Bits()); |
950 TryConvertDoubleToInt(as_int, value, scratch_d, on_successful_conversion, | 957 TryConvertDoubleToInt(as_int, value, scratch_d, on_successful_conversion, |
951 on_failed_conversion); | 958 on_failed_conversion); |
952 } | 959 } |
953 | 960 |
954 // ---- Object Utilities ---- | 961 // ---- Object Utilities ---- |
955 | 962 |
956 // Copy fields from 'src' to 'dst', where both are tagged objects. | 963 // Copy fields from 'src' to 'dst', where both are tagged objects. |
957 // The 'temps' list is a list of X registers which can be used for scratch | 964 // The 'temps' list is a list of X registers which can be used for scratch |
(...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2064 Condition cond, // eq for new space, ne otherwise. | 2071 Condition cond, // eq for new space, ne otherwise. |
2065 Label* branch); | 2072 Label* branch); |
2066 | 2073 |
2067 // Try to convert a double to an int so that integer fast-paths may be | 2074 // Try to convert a double to an int so that integer fast-paths may be |
2068 // used. Not every valid integer value is guaranteed to be caught. | 2075 // used. Not every valid integer value is guaranteed to be caught. |
2069 // It supports both 32-bit and 64-bit integers depending whether 'as_int' | 2076 // It supports both 32-bit and 64-bit integers depending whether 'as_int' |
2070 // is a W or X register. | 2077 // is a W or X register. |
2071 // | 2078 // |
2072 // This does not distinguish between +0 and -0, so if this distinction is | 2079 // This does not distinguish between +0 and -0, so if this distinction is |
2073 // important it must be checked separately. | 2080 // important it must be checked separately. |
| 2081 // |
| 2082 // On output the Z flag is set if the conversion was successful. |
2074 void TryConvertDoubleToInt(Register as_int, | 2083 void TryConvertDoubleToInt(Register as_int, |
2075 FPRegister value, | 2084 FPRegister value, |
2076 FPRegister scratch_d, | 2085 FPRegister scratch_d, |
2077 Label* on_successful_conversion, | 2086 Label* on_successful_conversion = NULL, |
2078 Label* on_failed_conversion = NULL); | 2087 Label* on_failed_conversion = NULL); |
2079 | 2088 |
2080 bool generating_stub_; | 2089 bool generating_stub_; |
2081 #if DEBUG | 2090 #if DEBUG |
2082 // Tell whether any of the macro instruction can be used. When false the | 2091 // Tell whether any of the macro instruction can be used. When false the |
2083 // MacroAssembler will assert if a method which can emit a variable number | 2092 // MacroAssembler will assert if a method which can emit a variable number |
2084 // of instructions is called. | 2093 // of instructions is called. |
2085 bool allow_macro_instructions_; | 2094 bool allow_macro_instructions_; |
2086 #endif | 2095 #endif |
2087 bool has_frame_; | 2096 bool has_frame_; |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2289 #error "Unsupported option" | 2298 #error "Unsupported option" |
2290 #define CODE_COVERAGE_STRINGIFY(x) #x | 2299 #define CODE_COVERAGE_STRINGIFY(x) #x |
2291 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) | 2300 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) |
2292 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 2301 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
2293 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 2302 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
2294 #else | 2303 #else |
2295 #define ACCESS_MASM(masm) masm-> | 2304 #define ACCESS_MASM(masm) masm-> |
2296 #endif | 2305 #endif |
2297 | 2306 |
2298 #endif // V8_A64_MACRO_ASSEMBLER_A64_H_ | 2307 #endif // V8_A64_MACRO_ASSEMBLER_A64_H_ |
OLD | NEW |