| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Platform-specific code for Solaris 10 goes here. For the POSIX-compatible | 5 // Platform-specific code for Solaris 10 goes here. For the POSIX-compatible |
| 6 // parts, the implementation is in platform-posix.cc. | 6 // parts, the implementation is in platform-posix.cc. |
| 7 | 7 |
| 8 #ifdef __sparc | 8 #ifdef __sparc |
| 9 # error "V8 does not support the SPARC CPU architecture." | 9 # error "V8 does not support the SPARC CPU architecture." |
| 10 #endif | 10 #endif |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include <unistd.h> // getpagesize(), usleep() | 24 #include <unistd.h> // getpagesize(), usleep() |
| 25 | 25 |
| 26 #include <cmath> | 26 #include <cmath> |
| 27 | 27 |
| 28 #undef MAP_TYPE | 28 #undef MAP_TYPE |
| 29 | 29 |
| 30 #include "src/base/macros.h" | 30 #include "src/base/macros.h" |
| 31 #include "src/base/platform/platform.h" | 31 #include "src/base/platform/platform.h" |
| 32 | 32 |
| 33 | 33 |
| 34 // It seems there is a bug in some Solaris distributions (experienced in | |
| 35 // SunOS 5.10 Generic_141445-09) which make it difficult or impossible to | |
| 36 // access signbit() despite the availability of other C99 math functions. | |
| 37 #ifndef signbit | |
| 38 namespace std { | |
| 39 // Test sign - usually defined in math.h | |
| 40 int signbit(double x) { | |
| 41 // We need to take care of the special case of both positive and negative | |
| 42 // versions of zero. | |
| 43 if (x == 0) { | |
| 44 return fpclass(x) & FP_NZERO; | |
| 45 } else { | |
| 46 // This won't detect negative NaN but that should be okay since we don't | |
| 47 // assume that behavior. | |
| 48 return x < 0; | |
| 49 } | |
| 50 } | |
| 51 } // namespace std | |
| 52 #endif // signbit | |
| 53 | |
| 54 namespace v8 { | 34 namespace v8 { |
| 55 namespace base { | 35 namespace base { |
| 56 | 36 |
| 57 | 37 |
| 58 const char* OS::LocalTimezone(double time, TimezoneCache* cache) { | 38 const char* OS::LocalTimezone(double time, TimezoneCache* cache) { |
| 59 if (std::isnan(time)) return ""; | 39 if (std::isnan(time)) return ""; |
| 60 time_t tv = static_cast<time_t>(std::floor(time/msPerSecond)); | 40 time_t tv = static_cast<time_t>(std::floor(time/msPerSecond)); |
| 61 struct tm* t = localtime(&tv); | 41 struct tm* t = localtime(&tv); |
| 62 if (NULL == t) return ""; | 42 if (NULL == t) return ""; |
| 63 return tzname[0]; // The location of the timezone string on Solaris. | 43 return tzname[0]; // The location of the timezone string on Solaris. |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 return munmap(base, size) == 0; | 250 return munmap(base, size) == 0; |
| 271 } | 251 } |
| 272 | 252 |
| 273 | 253 |
| 274 bool VirtualMemory::HasLazyCommits() { | 254 bool VirtualMemory::HasLazyCommits() { |
| 275 // TODO(alph): implement for the platform. | 255 // TODO(alph): implement for the platform. |
| 276 return false; | 256 return false; |
| 277 } | 257 } |
| 278 | 258 |
| 279 } } // namespace v8::base | 259 } } // namespace v8::base |
| OLD | NEW |