OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 17647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17658 i::OS::MemCopy(&target, &value, sizeof(target)); | 17658 i::OS::MemCopy(&target, &value, sizeof(target)); |
17659 return target; | 17659 return target; |
17660 } | 17660 } |
17661 | 17661 |
17662 | 17662 |
17663 static double DoubleToDateTime(double input) { | 17663 static double DoubleToDateTime(double input) { |
17664 double date_limit = 864e13; | 17664 double date_limit = 864e13; |
17665 if (std::isnan(input) || input < -date_limit || input > date_limit) { | 17665 if (std::isnan(input) || input < -date_limit || input > date_limit) { |
17666 return i::OS::nan_value(); | 17666 return i::OS::nan_value(); |
17667 } | 17667 } |
17668 return (input < 0) ? -(floor(-input)) : floor(input); | 17668 return (input < 0) ? -(std::floor(-input)) : std::floor(input); |
17669 } | 17669 } |
17670 | 17670 |
17671 | 17671 |
17672 // We don't have a consistent way to write 64-bit constants syntactically, so we | 17672 // We don't have a consistent way to write 64-bit constants syntactically, so we |
17673 // split them into two 32-bit constants and combine them programmatically. | 17673 // split them into two 32-bit constants and combine them programmatically. |
17674 static double DoubleFromBits(uint32_t high_bits, uint32_t low_bits) { | 17674 static double DoubleFromBits(uint32_t high_bits, uint32_t low_bits) { |
17675 return DoubleFromBits((static_cast<uint64_t>(high_bits) << 32) | low_bits); | 17675 return DoubleFromBits((static_cast<uint64_t>(high_bits) << 32) | low_bits); |
17676 } | 17676 } |
17677 | 17677 |
17678 | 17678 |
(...skipping 3793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
21472 } | 21472 } |
21473 for (int i = 0; i < runs; i++) { | 21473 for (int i = 0; i < runs; i++) { |
21474 Local<String> expected; | 21474 Local<String> expected; |
21475 if (i != 0) { | 21475 if (i != 0) { |
21476 CHECK_EQ(v8_str("escape value"), values[i]); | 21476 CHECK_EQ(v8_str("escape value"), values[i]); |
21477 } else { | 21477 } else { |
21478 CHECK(values[i].IsEmpty()); | 21478 CHECK(values[i].IsEmpty()); |
21479 } | 21479 } |
21480 } | 21480 } |
21481 } | 21481 } |
OLD | NEW |