Chromium Code Reviews| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 UNARY_MATH_FUNCTION(cos, CreateTranscendentalFunction(TranscendentalCache::COS)) | 142 UNARY_MATH_FUNCTION(cos, CreateTranscendentalFunction(TranscendentalCache::COS)) |
| 143 UNARY_MATH_FUNCTION(tan, CreateTranscendentalFunction(TranscendentalCache::TAN)) | 143 UNARY_MATH_FUNCTION(tan, CreateTranscendentalFunction(TranscendentalCache::TAN)) |
| 144 UNARY_MATH_FUNCTION(log, CreateTranscendentalFunction(TranscendentalCache::LOG)) | 144 UNARY_MATH_FUNCTION(log, CreateTranscendentalFunction(TranscendentalCache::LOG)) |
| 145 UNARY_MATH_FUNCTION(sqrt, CreateSqrtFunction()) | 145 UNARY_MATH_FUNCTION(sqrt, CreateSqrtFunction()) |
| 146 | 146 |
| 147 #undef MATH_FUNCTION | 147 #undef MATH_FUNCTION |
| 148 | 148 |
| 149 | 149 |
| 150 double OS::nan_value() { | 150 double OS::nan_value() { |
| 151 // NAN from math.h is defined in C99 and not in POSIX. | 151 // NAN from math.h is defined in C99 and not in POSIX. |
| 152 | |
| 153 #if defined(V8_TARGET_ARCH_SH4) | |
| 154 // return a qNaN as exepcted by the v8 core. In sh4 tool chain, the NAN macro | |
|
Jakob Kummerow
2012/11/07 11:18:24
nit: "Return", "expected"
remi.duraffort
2012/11/07 11:59:26
Fixed.
| |
| 155 // is defined to be an sNaN while the C specifications require a qNaN. | |
| 156 union { | |
| 157 uint64_t ui64; | |
| 158 double d; | |
| 159 } value; | |
| 160 value.ui64 = (static_cast<uint64_t>(0x7ff00000) << 32) | 0x00000001; | |
| 161 return value.d; | |
| 162 #else | |
| 152 return NAN; | 163 return NAN; |
| 164 #endif | |
| 153 } | 165 } |
| 154 | 166 |
| 155 | 167 |
| 156 int OS::GetCurrentProcessId() { | 168 int OS::GetCurrentProcessId() { |
| 157 return static_cast<int>(getpid()); | 169 return static_cast<int>(getpid()); |
| 158 } | 170 } |
| 159 | 171 |
| 160 | 172 |
| 161 // ---------------------------------------------------------------------------- | 173 // ---------------------------------------------------------------------------- |
| 162 // POSIX date/time support. | 174 // POSIX date/time support. |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 541 return ntohl(value); | 553 return ntohl(value); |
| 542 } | 554 } |
| 543 | 555 |
| 544 | 556 |
| 545 Socket* OS::CreateSocket() { | 557 Socket* OS::CreateSocket() { |
| 546 return new POSIXSocket(); | 558 return new POSIXSocket(); |
| 547 } | 559 } |
| 548 | 560 |
| 549 | 561 |
| 550 } } // namespace v8::internal | 562 } } // namespace v8::internal |
| OLD | NEW |