Chromium Code Reviews| 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 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1202 static void f64_nearest_int_wrapper(double* param) { | 1202 static void f64_nearest_int_wrapper(double* param) { |
| 1203 *param = nearbyint(*param); | 1203 *param = nearbyint(*param); |
| 1204 } | 1204 } |
| 1205 | 1205 |
| 1206 ExternalReference ExternalReference::f64_nearest_int_wrapper_function( | 1206 ExternalReference ExternalReference::f64_nearest_int_wrapper_function( |
| 1207 Isolate* isolate) { | 1207 Isolate* isolate) { |
| 1208 return ExternalReference( | 1208 return ExternalReference( |
| 1209 Redirect(isolate, FUNCTION_ADDR(f64_nearest_int_wrapper))); | 1209 Redirect(isolate, FUNCTION_ADDR(f64_nearest_int_wrapper))); |
| 1210 } | 1210 } |
| 1211 | 1211 |
| 1212 static void f64_acos_wrapper(double* param) { *param = std::acos(*param); } | |
| 1213 | |
| 1214 ExternalReference ExternalReference::f64_acos_wrapper_function( | |
| 1215 Isolate* isolate) { | |
| 1216 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_acos_wrapper))); | |
| 1217 } | |
| 1218 | |
| 1219 static void f64_asin_wrapper(double* param) { *param = std::asin(*param); } | |
| 1220 | |
| 1221 ExternalReference ExternalReference::f64_asin_wrapper_function( | |
| 1222 Isolate* isolate) { | |
| 1223 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_asin_wrapper))); | |
| 1224 } | |
| 1225 | |
| 1226 static void f64_atan_wrapper(double* param) { *param = std::atan(*param); } | |
| 1227 | |
| 1228 ExternalReference ExternalReference::f64_atan_wrapper_function( | |
| 1229 Isolate* isolate) { | |
| 1230 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_atan_wrapper))); | |
| 1231 } | |
| 1232 | |
| 1233 static void f64_cos_wrapper(double* param) { *param = std::cos(*param); } | |
| 1234 | |
| 1235 ExternalReference ExternalReference::f64_cos_wrapper_function( | |
| 1236 Isolate* isolate) { | |
| 1237 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_cos_wrapper))); | |
| 1238 } | |
| 1239 | |
| 1240 static void f64_sin_wrapper(double* param) { *param = std::sin(*param); } | |
| 1241 | |
| 1242 ExternalReference ExternalReference::f64_sin_wrapper_function( | |
| 1243 Isolate* isolate) { | |
| 1244 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_sin_wrapper))); | |
| 1245 } | |
| 1246 | |
| 1247 static void f64_tan_wrapper(double* param) { *param = std::tan(*param); } | |
| 1248 | |
| 1249 ExternalReference ExternalReference::f64_tan_wrapper_function( | |
| 1250 Isolate* isolate) { | |
| 1251 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_tan_wrapper))); | |
| 1252 } | |
| 1253 | |
| 1254 static void f64_exp_wrapper(double* param) { *param = std::exp(*param); } | |
| 1255 | |
| 1256 ExternalReference ExternalReference::f64_exp_wrapper_function( | |
| 1257 Isolate* isolate) { | |
| 1258 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_exp_wrapper))); | |
| 1259 } | |
| 1260 | |
| 1261 static void f64_log_wrapper(double* param) { *param = std::log(*param); } | |
| 1262 | |
| 1263 ExternalReference ExternalReference::f64_log_wrapper_function( | |
| 1264 Isolate* isolate) { | |
| 1265 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_log_wrapper))); | |
| 1266 } | |
| 1267 | |
| 1268 static void f64_pow_wrapper(double* param) { | |
| 1269 *param = power_double_double(param[0], param[1]); | |
| 1270 } | |
| 1271 | |
| 1272 ExternalReference ExternalReference::f64_pow_wrapper_function( | |
| 1273 Isolate* isolate) { | |
| 1274 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_pow_wrapper))); | |
| 1275 } | |
| 1276 | |
| 1277 static void f64_atan2_wrapper(double* param) { | |
| 1278 double x = param[0]; | |
| 1279 double y = param[1]; | |
| 1280 static const double kPiDividedBy4 = 0.78539816339744830962; | |
| 1281 if (std::isinf(x) && std::isinf(y)) { | |
|
bradnelson
2016/03/02 03:49:12
This is lifted from Runtime_atan2
Should I move t
| |
| 1282 // Make sure that the result in case of two infinite arguments | |
| 1283 // is a multiple of Pi / 4. The sign of the result is determined | |
| 1284 // by the first argument (x) and the sign of the second argument | |
| 1285 // determines the multiplier: one or three. | |
| 1286 int multiplier = (x < 0) ? -1 : 1; | |
| 1287 if (y < 0) multiplier *= 3; | |
| 1288 *param = multiplier * kPiDividedBy4; | |
| 1289 } else { | |
| 1290 *param = std::atan2(x, y); | |
| 1291 } | |
| 1292 } | |
| 1293 | |
| 1294 ExternalReference ExternalReference::f64_atan2_wrapper_function( | |
| 1295 Isolate* isolate) { | |
| 1296 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_atan2_wrapper))); | |
| 1297 } | |
| 1298 | |
| 1299 static void f64_mod_wrapper(double* param) { | |
| 1300 *param = modulo(param[0], param[1]); | |
| 1301 } | |
| 1302 | |
| 1303 ExternalReference ExternalReference::f64_mod_wrapper_function( | |
| 1304 Isolate* isolate) { | |
| 1305 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_mod_wrapper))); | |
| 1306 } | |
| 1307 | |
| 1212 ExternalReference ExternalReference::log_enter_external_function( | 1308 ExternalReference ExternalReference::log_enter_external_function( |
| 1213 Isolate* isolate) { | 1309 Isolate* isolate) { |
| 1214 return ExternalReference( | 1310 return ExternalReference( |
| 1215 Redirect(isolate, FUNCTION_ADDR(Logger::EnterExternal))); | 1311 Redirect(isolate, FUNCTION_ADDR(Logger::EnterExternal))); |
| 1216 } | 1312 } |
| 1217 | 1313 |
| 1218 | 1314 |
| 1219 ExternalReference ExternalReference::log_leave_external_function( | 1315 ExternalReference ExternalReference::log_leave_external_function( |
| 1220 Isolate* isolate) { | 1316 Isolate* isolate) { |
| 1221 return ExternalReference( | 1317 return ExternalReference( |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1936 | 2032 |
| 1937 | 2033 |
| 1938 void Assembler::DataAlign(int m) { | 2034 void Assembler::DataAlign(int m) { |
| 1939 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m)); | 2035 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m)); |
| 1940 while ((pc_offset() & (m - 1)) != 0) { | 2036 while ((pc_offset() & (m - 1)) != 0) { |
| 1941 db(0); | 2037 db(0); |
| 1942 } | 2038 } |
| 1943 } | 2039 } |
| 1944 } // namespace internal | 2040 } // namespace internal |
| 1945 } // namespace v8 | 2041 } // namespace v8 |
| OLD | NEW |