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

Side by Side Diff: src/assembler.cc

Issue 121303005: Use std:: on symbols declared in C++-style C headers. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Same as the previous CL, but with an addition to cctest/test-log.cc Created 6 years, 11 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 | « src/arm/simulator-arm.cc ('k') | src/bignum-dtoa.cc » ('j') | 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 917 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 928
929 math_exp_constants_array = new double[9]; 929 math_exp_constants_array = new double[9];
930 // Input values smaller than this always return 0. 930 // Input values smaller than this always return 0.
931 math_exp_constants_array[0] = -708.39641853226408; 931 math_exp_constants_array[0] = -708.39641853226408;
932 // Input values larger than this always return +Infinity. 932 // Input values larger than this always return +Infinity.
933 math_exp_constants_array[1] = 709.78271289338397; 933 math_exp_constants_array[1] = 709.78271289338397;
934 math_exp_constants_array[2] = V8_INFINITY; 934 math_exp_constants_array[2] = V8_INFINITY;
935 // The rest is black magic. Do not attempt to understand it. It is 935 // The rest is black magic. Do not attempt to understand it. It is
936 // loosely based on the "expd" function published at: 936 // loosely based on the "expd" function published at:
937 // http://herumi.blogspot.com/2011/08/fast-double-precision-exponential.html 937 // http://herumi.blogspot.com/2011/08/fast-double-precision-exponential.html
938 const double constant3 = (1 << kTableSizeBits) / log(2.0); 938 const double constant3 = (1 << kTableSizeBits) / std::log(2.0);
939 math_exp_constants_array[3] = constant3; 939 math_exp_constants_array[3] = constant3;
940 math_exp_constants_array[4] = 940 math_exp_constants_array[4] =
941 static_cast<double>(static_cast<int64_t>(3) << 51); 941 static_cast<double>(static_cast<int64_t>(3) << 51);
942 math_exp_constants_array[5] = 1 / constant3; 942 math_exp_constants_array[5] = 1 / constant3;
943 math_exp_constants_array[6] = 3.0000000027955394; 943 math_exp_constants_array[6] = 3.0000000027955394;
944 math_exp_constants_array[7] = 0.16666666685227835; 944 math_exp_constants_array[7] = 0.16666666685227835;
945 math_exp_constants_array[8] = 1; 945 math_exp_constants_array[8] = 1;
946 946
947 math_exp_log_table_array = new double[kTableSize]; 947 math_exp_log_table_array = new double[kTableSize];
948 for (int i = 0; i < kTableSize; i++) { 948 for (int i = 0; i < kTableSize; i++) {
949 double value = pow(2, i / kTableSizeDouble); 949 double value = std::pow(2, i / kTableSizeDouble);
950 uint64_t bits = BitCast<uint64_t, double>(value); 950 uint64_t bits = BitCast<uint64_t, double>(value);
951 bits &= (static_cast<uint64_t>(1) << 52) - 1; 951 bits &= (static_cast<uint64_t>(1) << 52) - 1;
952 double mantissa = BitCast<double, uint64_t>(bits); 952 double mantissa = BitCast<double, uint64_t>(bits);
953 math_exp_log_table_array[i] = mantissa; 953 math_exp_log_table_array[i] = mantissa;
954 } 954 }
955 955
956 math_exp_data_initialized = true; 956 math_exp_data_initialized = true;
957 } 957 }
958 } 958 }
959 959
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
1382 return ExternalReference(isolate->regexp_stack()->memory_size_address()); 1382 return ExternalReference(isolate->regexp_stack()->memory_size_address());
1383 } 1383 }
1384 1384
1385 #endif // V8_INTERPRETED_REGEXP 1385 #endif // V8_INTERPRETED_REGEXP
1386 1386
1387 1387
1388 ExternalReference ExternalReference::math_log_double_function( 1388 ExternalReference ExternalReference::math_log_double_function(
1389 Isolate* isolate) { 1389 Isolate* isolate) {
1390 typedef double (*d2d)(double x); 1390 typedef double (*d2d)(double x);
1391 return ExternalReference(Redirect(isolate, 1391 return ExternalReference(Redirect(isolate,
1392 FUNCTION_ADDR(static_cast<d2d>(log)), 1392 FUNCTION_ADDR(static_cast<d2d>(std::log)),
1393 BUILTIN_FP_CALL)); 1393 BUILTIN_FP_CALL));
1394 } 1394 }
1395 1395
1396 1396
1397 ExternalReference ExternalReference::math_exp_constants(int constant_index) { 1397 ExternalReference ExternalReference::math_exp_constants(int constant_index) {
1398 ASSERT(math_exp_data_initialized); 1398 ASSERT(math_exp_data_initialized);
1399 return ExternalReference( 1399 return ExternalReference(
1400 reinterpret_cast<void*>(math_exp_constants_array + constant_index)); 1400 reinterpret_cast<void*>(math_exp_constants_array + constant_index));
1401 } 1401 }
1402 1402
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1453 } 1453 }
1454 1454
1455 1455
1456 double power_double_double(double x, double y) { 1456 double power_double_double(double x, double y) {
1457 #if defined(__MINGW64_VERSION_MAJOR) && \ 1457 #if defined(__MINGW64_VERSION_MAJOR) && \
1458 (!defined(__MINGW64_VERSION_RC) || __MINGW64_VERSION_RC < 1) 1458 (!defined(__MINGW64_VERSION_RC) || __MINGW64_VERSION_RC < 1)
1459 // MinGW64 has a custom implementation for pow. This handles certain 1459 // MinGW64 has a custom implementation for pow. This handles certain
1460 // special cases that are different. 1460 // special cases that are different.
1461 if ((x == 0.0 || std::isinf(x)) && std::isfinite(y)) { 1461 if ((x == 0.0 || std::isinf(x)) && std::isfinite(y)) {
1462 double f; 1462 double f;
1463 if (modf(y, &f) != 0.0) return ((x == 0.0) ^ (y > 0)) ? V8_INFINITY : 0; 1463 if (std::modf(y, &f) != 0.0) {
1464 return ((x == 0.0) ^ (y > 0)) ? V8_INFINITY : 0;
1465 }
1464 } 1466 }
1465 1467
1466 if (x == 2.0) { 1468 if (x == 2.0) {
1467 int y_int = static_cast<int>(y); 1469 int y_int = static_cast<int>(y);
1468 if (y == y_int) return ldexp(1.0, y_int); 1470 if (y == y_int) {
1471 return std::ldexp(1.0, y_int);
1472 }
1469 } 1473 }
1470 #endif 1474 #endif
1471 1475
1472 // The checks for special cases can be dropped in ia32 because it has already 1476 // The checks for special cases can be dropped in ia32 because it has already
1473 // been done in generated code before bailing out here. 1477 // been done in generated code before bailing out here.
1474 if (std::isnan(y) || ((x == 1 || x == -1) && std::isinf(y))) { 1478 if (std::isnan(y) || ((x == 1 || x == -1) && std::isinf(y))) {
1475 return OS::nan_value(); 1479 return OS::nan_value();
1476 } 1480 }
1477 return pow(x, y); 1481 return std::pow(x, y);
1478 } 1482 }
1479 1483
1480 1484
1481 ExternalReference ExternalReference::power_double_double_function( 1485 ExternalReference ExternalReference::power_double_double_function(
1482 Isolate* isolate) { 1486 Isolate* isolate) {
1483 return ExternalReference(Redirect(isolate, 1487 return ExternalReference(Redirect(isolate,
1484 FUNCTION_ADDR(power_double_double), 1488 FUNCTION_ADDR(power_double_double),
1485 BUILTIN_FP_FP_CALL)); 1489 BUILTIN_FP_FP_CALL));
1486 } 1490 }
1487 1491
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
1586 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); 1590 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position);
1587 state_.written_position = state_.current_position; 1591 state_.written_position = state_.current_position;
1588 written = true; 1592 written = true;
1589 } 1593 }
1590 1594
1591 // Return whether something was written. 1595 // Return whether something was written.
1592 return written; 1596 return written;
1593 } 1597 }
1594 1598
1595 } } // namespace v8::internal 1599 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/simulator-arm.cc ('k') | src/bignum-dtoa.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698