Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Side by Side Diff: src/assembler.cc

Issue 2034523003: Fix failure in mjsunit/wasm/embenchen/lua_binarytrees on 32-bit architectures (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 ExternalReference ExternalReference::wasm_word32_popcnt(Isolate* isolate) { 1281 ExternalReference ExternalReference::wasm_word32_popcnt(Isolate* isolate) {
1282 return ExternalReference( 1282 return ExternalReference(
1283 Redirect(isolate, FUNCTION_ADDR(wasm::word32_popcnt_wrapper))); 1283 Redirect(isolate, FUNCTION_ADDR(wasm::word32_popcnt_wrapper)));
1284 } 1284 }
1285 1285
1286 ExternalReference ExternalReference::wasm_word64_popcnt(Isolate* isolate) { 1286 ExternalReference ExternalReference::wasm_word64_popcnt(Isolate* isolate) {
1287 return ExternalReference( 1287 return ExternalReference(
1288 Redirect(isolate, FUNCTION_ADDR(wasm::word64_popcnt_wrapper))); 1288 Redirect(isolate, FUNCTION_ADDR(wasm::word64_popcnt_wrapper)));
1289 } 1289 }
1290 1290
1291 static void f64_acos_wrapper(double* param) { *param = std::acos(*param); } 1291 static void f64_acos_wrapper(double* param) {
1292 WriteDoubleValue(param, std::acos(ReadDoubleValue(param)));
1293 }
1292 1294
1293 ExternalReference ExternalReference::f64_acos_wrapper_function( 1295 ExternalReference ExternalReference::f64_acos_wrapper_function(
1294 Isolate* isolate) { 1296 Isolate* isolate) {
1295 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_acos_wrapper))); 1297 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_acos_wrapper)));
1296 } 1298 }
1297 1299
1298 static void f64_asin_wrapper(double* param) { *param = std::asin(*param); } 1300 static void f64_asin_wrapper(double* param) {
1301 WriteDoubleValue(param, std::asin(ReadDoubleValue(param)));
1302 }
1299 1303
1300 ExternalReference ExternalReference::f64_asin_wrapper_function( 1304 ExternalReference ExternalReference::f64_asin_wrapper_function(
1301 Isolate* isolate) { 1305 Isolate* isolate) {
1302 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_asin_wrapper))); 1306 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_asin_wrapper)));
1303 } 1307 }
1304 1308
1305 static void f64_atan_wrapper(double* param) { *param = std::atan(*param); } 1309 static void f64_atan_wrapper(double* param) {
1310 WriteDoubleValue(param, std::atan(ReadDoubleValue(param)));
1311 }
1306 1312
1307 ExternalReference ExternalReference::f64_atan_wrapper_function( 1313 ExternalReference ExternalReference::f64_atan_wrapper_function(
1308 Isolate* isolate) { 1314 Isolate* isolate) {
1309 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_atan_wrapper))); 1315 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_atan_wrapper)));
1310 } 1316 }
1311 1317
1312 static void f64_cos_wrapper(double* param) { *param = std::cos(*param); } 1318 static void f64_cos_wrapper(double* param) {
1319 WriteDoubleValue(param, std::cos(ReadDoubleValue(param)));
1320 }
1313 1321
1314 ExternalReference ExternalReference::f64_cos_wrapper_function( 1322 ExternalReference ExternalReference::f64_cos_wrapper_function(
1315 Isolate* isolate) { 1323 Isolate* isolate) {
1316 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_cos_wrapper))); 1324 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_cos_wrapper)));
1317 } 1325 }
1318 1326
1319 static void f64_sin_wrapper(double* param) { *param = std::sin(*param); } 1327 static void f64_sin_wrapper(double* param) {
1328 WriteDoubleValue(param, std::sin(ReadDoubleValue(param)));
1329 }
1320 1330
1321 ExternalReference ExternalReference::f64_sin_wrapper_function( 1331 ExternalReference ExternalReference::f64_sin_wrapper_function(
1322 Isolate* isolate) { 1332 Isolate* isolate) {
1323 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_sin_wrapper))); 1333 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_sin_wrapper)));
1324 } 1334 }
1325 1335
1326 static void f64_tan_wrapper(double* param) { *param = std::tan(*param); } 1336 static void f64_tan_wrapper(double* param) {
1337 WriteDoubleValue(param, std::tan(ReadDoubleValue(param)));
1338 }
1327 1339
1328 ExternalReference ExternalReference::f64_tan_wrapper_function( 1340 ExternalReference ExternalReference::f64_tan_wrapper_function(
1329 Isolate* isolate) { 1341 Isolate* isolate) {
1330 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_tan_wrapper))); 1342 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_tan_wrapper)));
1331 } 1343 }
1332 1344
1333 static void f64_exp_wrapper(double* param) { *param = std::exp(*param); } 1345 static void f64_exp_wrapper(double* param) {
1346 WriteDoubleValue(param, std::exp(ReadDoubleValue(param)));
1347 }
1334 1348
1335 ExternalReference ExternalReference::f64_exp_wrapper_function( 1349 ExternalReference ExternalReference::f64_exp_wrapper_function(
1336 Isolate* isolate) { 1350 Isolate* isolate) {
1337 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_exp_wrapper))); 1351 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_exp_wrapper)));
1338 } 1352 }
1339 1353
1340 static void f64_log_wrapper(double* param) { *param = std::log(*param); } 1354 static void f64_log_wrapper(double* param) {
1355 WriteDoubleValue(param, std::log(ReadDoubleValue(param)));
1356 }
1341 1357
1342 ExternalReference ExternalReference::f64_log_wrapper_function( 1358 ExternalReference ExternalReference::f64_log_wrapper_function(
1343 Isolate* isolate) { 1359 Isolate* isolate) {
1344 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_log_wrapper))); 1360 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_log_wrapper)));
1345 } 1361 }
1346 1362
1347 static void f64_pow_wrapper(double* param0, double* param1) { 1363 static void f64_pow_wrapper(double* param0, double* param1) {
1348 *param0 = power_double_double(*param0, *param1); 1364 WriteDoubleValue(param0, power_double_double(ReadDoubleValue(param0),
1365 ReadDoubleValue(param1)));
1349 } 1366 }
1350 1367
1351 ExternalReference ExternalReference::f64_pow_wrapper_function( 1368 ExternalReference ExternalReference::f64_pow_wrapper_function(
1352 Isolate* isolate) { 1369 Isolate* isolate) {
1353 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_pow_wrapper))); 1370 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_pow_wrapper)));
1354 } 1371 }
1355 1372
1356 static void f64_atan2_wrapper(double* param0, double* param1) { 1373 static void f64_atan2_wrapper(double* param0, double* param1) {
1357 double x = *param0; 1374 double x = ReadDoubleValue(param0);
1358 double y = *param1; 1375 double y = ReadDoubleValue(param1);
1359 // TODO(bradnelson): Find a good place to put this to share 1376 // TODO(bradnelson): Find a good place to put this to share
1360 // with the same code in src/runtime/runtime-math.cc 1377 // with the same code in src/runtime/runtime-math.cc
1361 static const double kPiDividedBy4 = 0.78539816339744830962; 1378 static const double kPiDividedBy4 = 0.78539816339744830962;
1362 if (std::isinf(x) && std::isinf(y)) { 1379 if (std::isinf(x) && std::isinf(y)) {
1363 // Make sure that the result in case of two infinite arguments 1380 // Make sure that the result in case of two infinite arguments
1364 // is a multiple of Pi / 4. The sign of the result is determined 1381 // is a multiple of Pi / 4. The sign of the result is determined
1365 // by the first argument (x) and the sign of the second argument 1382 // by the first argument (x) and the sign of the second argument
1366 // determines the multiplier: one or three. 1383 // determines the multiplier: one or three.
1367 int multiplier = (x < 0) ? -1 : 1; 1384 int multiplier = (x < 0) ? -1 : 1;
1368 if (y < 0) multiplier *= 3; 1385 if (y < 0) multiplier *= 3;
1369 *param0 = multiplier * kPiDividedBy4; 1386 WriteDoubleValue(param0, multiplier * kPiDividedBy4);
1370 } else { 1387 } else {
1371 *param0 = std::atan2(x, y); 1388 WriteDoubleValue(param0, std::atan2(x, y));
1372 } 1389 }
1373 } 1390 }
1374 1391
1375 ExternalReference ExternalReference::f64_atan2_wrapper_function( 1392 ExternalReference ExternalReference::f64_atan2_wrapper_function(
1376 Isolate* isolate) { 1393 Isolate* isolate) {
1377 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_atan2_wrapper))); 1394 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_atan2_wrapper)));
1378 } 1395 }
1379 1396
1380 static void f64_mod_wrapper(double* param0, double* param1) { 1397 static void f64_mod_wrapper(double* param0, double* param1) {
1381 *param0 = modulo(*param0, *param1); 1398 WriteDoubleValue(param0,
1399 modulo(ReadDoubleValue(param0), ReadDoubleValue(param1)));
1382 } 1400 }
1383 1401
1384 ExternalReference ExternalReference::f64_mod_wrapper_function( 1402 ExternalReference ExternalReference::f64_mod_wrapper_function(
1385 Isolate* isolate) { 1403 Isolate* isolate) {
1386 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_mod_wrapper))); 1404 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f64_mod_wrapper)));
1387 } 1405 }
1388 1406
1389 ExternalReference ExternalReference::log_enter_external_function( 1407 ExternalReference ExternalReference::log_enter_external_function(
1390 Isolate* isolate) { 1408 Isolate* isolate) {
1391 return ExternalReference( 1409 return ExternalReference(
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
2088 2106
2089 2107
2090 void Assembler::DataAlign(int m) { 2108 void Assembler::DataAlign(int m) {
2091 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m)); 2109 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m));
2092 while ((pc_offset() & (m - 1)) != 0) { 2110 while ((pc_offset() & (m - 1)) != 0) {
2093 db(0); 2111 db(0);
2094 } 2112 }
2095 } 2113 }
2096 } // namespace internal 2114 } // namespace internal
2097 } // namespace v8 2115 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698