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 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
938 // Saturate a signed 32-bit integer in input to an unsigned 8-bit integer in | 938 // Saturate a signed 32-bit integer in input to an unsigned 8-bit integer in |
939 // output. | 939 // output. |
940 void ClampInt32ToUint8(Register in_out); | 940 void ClampInt32ToUint8(Register in_out); |
941 void ClampInt32ToUint8(Register output, Register input); | 941 void ClampInt32ToUint8(Register output, Register input); |
942 | 942 |
943 // Saturate a double in input to an unsigned 8-bit integer in output. | 943 // Saturate a double in input to an unsigned 8-bit integer in output. |
944 void ClampDoubleToUint8(Register output, | 944 void ClampDoubleToUint8(Register output, |
945 DoubleRegister input, | 945 DoubleRegister input, |
946 DoubleRegister dbl_scratch); | 946 DoubleRegister dbl_scratch); |
947 | 947 |
948 // Try to convert a double to a signed 32-bit int. | 948 // Try to represent a double as a signed 32-bit int. |
949 // This succeeds if the result compares equal to the input, so inputs of -0.0 | 949 // This succeeds if the result compares equal to the input, so inputs of -0.0 |
950 // are converted to 0 and handled as a success. | 950 // are represented as 0 and handled as a success. |
951 // | 951 // |
952 // On output the Z flag is set if the conversion was successful. | 952 // On output the Z flag is set if the operation was successful. |
953 void TryConvertDoubleToInt32(Register as_int, | 953 void TryRepresentDoubleAsInt32(Register as_int, |
954 FPRegister value, | 954 FPRegister value, |
955 FPRegister scratch_d, | 955 FPRegister scratch_d, |
956 Label* on_successful_conversion = NULL, | 956 Label* on_successful_conversion = NULL, |
957 Label* on_failed_conversion = NULL) { | 957 Label* on_failed_conversion = NULL) { |
958 ASSERT(as_int.Is32Bits()); | 958 ASSERT(as_int.Is32Bits()); |
959 TryConvertDoubleToInt(as_int, value, scratch_d, on_successful_conversion, | 959 TryRepresentDoubleAsInt(as_int, value, scratch_d, on_successful_conversion, |
960 on_failed_conversion); | 960 on_failed_conversion); |
961 } | 961 } |
962 | 962 |
963 // Try to convert a double to a signed 64-bit int. | 963 // Try to represent a double as a signed 64-bit int. |
964 // This succeeds if the result compares equal to the input, so inputs of -0.0 | 964 // This succeeds if the result compares equal to the input, so inputs of -0.0 |
965 // are converted to 0 and handled as a success. | 965 // are represented as 0 and handled as a success. |
966 // | 966 // |
967 // On output the Z flag is set if the conversion was successful. | 967 // On output the Z flag is set if the operation was successful. |
968 void TryConvertDoubleToInt64(Register as_int, | 968 void TryRepresentDoubleAsInt64(Register as_int, |
969 FPRegister value, | 969 FPRegister value, |
970 FPRegister scratch_d, | 970 FPRegister scratch_d, |
971 Label* on_successful_conversion = NULL, | 971 Label* on_successful_conversion = NULL, |
972 Label* on_failed_conversion = NULL) { | 972 Label* on_failed_conversion = NULL) { |
973 ASSERT(as_int.Is64Bits()); | 973 ASSERT(as_int.Is64Bits()); |
974 TryConvertDoubleToInt(as_int, value, scratch_d, on_successful_conversion, | 974 TryRepresentDoubleAsInt(as_int, value, scratch_d, on_successful_conversion, |
975 on_failed_conversion); | 975 on_failed_conversion); |
976 } | 976 } |
977 | 977 |
978 // ---- Object Utilities ---- | 978 // ---- Object Utilities ---- |
979 | 979 |
980 // Copy fields from 'src' to 'dst', where both are tagged objects. | 980 // Copy fields from 'src' to 'dst', where both are tagged objects. |
981 // The 'temps' list is a list of X registers which can be used for scratch | 981 // The 'temps' list is a list of X registers which can be used for scratch |
982 // values. The temps list must include at least one register. | 982 // values. The temps list must include at least one register. |
983 // | 983 // |
984 // Currently, CopyFields cannot make use of more than three registers from | 984 // Currently, CopyFields cannot make use of more than three registers from |
985 // the 'temps' list. | 985 // the 'temps' list. |
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2066 Register object, | 2066 Register object, |
2067 Register state, | 2067 Register state, |
2068 Register scratch1, | 2068 Register scratch1, |
2069 Register scratch2); | 2069 Register scratch2); |
2070 | 2070 |
2071 // Helper for implementing JumpIfNotInNewSpace and JumpIfInNewSpace. | 2071 // Helper for implementing JumpIfNotInNewSpace and JumpIfInNewSpace. |
2072 void InNewSpace(Register object, | 2072 void InNewSpace(Register object, |
2073 Condition cond, // eq for new space, ne otherwise. | 2073 Condition cond, // eq for new space, ne otherwise. |
2074 Label* branch); | 2074 Label* branch); |
2075 | 2075 |
2076 // Try to convert a double to an int so that integer fast-paths may be | 2076 // Try to represent a double as an int so that integer fast-paths may be |
2077 // used. Not every valid integer value is guaranteed to be caught. | 2077 // used. Not every valid integer value is guaranteed to be caught. |
2078 // It supports both 32-bit and 64-bit integers depending whether 'as_int' | 2078 // It supports both 32-bit and 64-bit integers depending whether 'as_int' |
2079 // is a W or X register. | 2079 // is a W or X register. |
2080 // | 2080 // |
2081 // This does not distinguish between +0 and -0, so if this distinction is | 2081 // This does not distinguish between +0 and -0, so if this distinction is |
2082 // important it must be checked separately. | 2082 // important it must be checked separately. |
2083 // | 2083 // |
2084 // On output the Z flag is set if the conversion was successful. | 2084 // On output the Z flag is set if the operation was successful. |
2085 void TryConvertDoubleToInt(Register as_int, | 2085 void TryRepresentDoubleAsInt(Register as_int, |
2086 FPRegister value, | 2086 FPRegister value, |
2087 FPRegister scratch_d, | 2087 FPRegister scratch_d, |
2088 Label* on_successful_conversion = NULL, | 2088 Label* on_successful_conversion = NULL, |
2089 Label* on_failed_conversion = NULL); | 2089 Label* on_failed_conversion = NULL); |
2090 | 2090 |
2091 bool generating_stub_; | 2091 bool generating_stub_; |
2092 #if DEBUG | 2092 #if DEBUG |
2093 // Tell whether any of the macro instruction can be used. When false the | 2093 // Tell whether any of the macro instruction can be used. When false the |
2094 // MacroAssembler will assert if a method which can emit a variable number | 2094 // MacroAssembler will assert if a method which can emit a variable number |
2095 // of instructions is called. | 2095 // of instructions is called. |
2096 bool allow_macro_instructions_; | 2096 bool allow_macro_instructions_; |
2097 #endif | 2097 #endif |
2098 bool has_frame_; | 2098 bool has_frame_; |
2099 | 2099 |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2307 #error "Unsupported option" | 2307 #error "Unsupported option" |
2308 #define CODE_COVERAGE_STRINGIFY(x) #x | 2308 #define CODE_COVERAGE_STRINGIFY(x) #x |
2309 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) | 2309 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) |
2310 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 2310 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
2311 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 2311 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
2312 #else | 2312 #else |
2313 #define ACCESS_MASM(masm) masm-> | 2313 #define ACCESS_MASM(masm) masm-> |
2314 #endif | 2314 #endif |
2315 | 2315 |
2316 #endif // V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ | 2316 #endif // V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ |
OLD | NEW |