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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 } | 79 } |
80 | 80 |
81 | 81 |
82 void OS::ReleaseStore(volatile AtomicWord* ptr, AtomicWord value) { | 82 void OS::ReleaseStore(volatile AtomicWord* ptr, AtomicWord value) { |
83 __asm__ __volatile__("" : : : "memory"); | 83 __asm__ __volatile__("" : : : "memory"); |
84 // An x86 store acts as a release barrier. | 84 // An x86 store acts as a release barrier. |
85 *ptr = value; | 85 *ptr = value; |
86 } | 86 } |
87 | 87 |
88 const char* OS::LocalTimezone(double time) { | 88 const char* OS::LocalTimezone(double time) { |
89 if (isnan(time)) return ""; | 89 if (std::isnan(time)) return ""; |
90 time_t tv = static_cast<time_t>(floor(time/msPerSecond)); | 90 time_t tv = static_cast<time_t>(floor(time/msPerSecond)); |
91 struct tm* t = localtime(&tv); | 91 struct tm* t = localtime(&tv); |
92 if (NULL == t) return ""; | 92 if (NULL == t) return ""; |
93 return tzname[0]; // The location of the timezone string on Cygwin. | 93 return tzname[0]; // The location of the timezone string on Cygwin. |
94 } | 94 } |
95 | 95 |
96 | 96 |
97 double OS::LocalTimeOffset() { | 97 double OS::LocalTimeOffset() { |
98 // On Cygwin, struct tm does not contain a tm_gmtoff field. | 98 // On Cygwin, struct tm does not contain a tm_gmtoff field. |
99 time_t utc = time(NULL); | 99 time_t utc = time(NULL); |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 limit_mutex = CreateMutex(); | 706 limit_mutex = CreateMutex(); |
707 } | 707 } |
708 | 708 |
709 | 709 |
710 void OS::TearDown() { | 710 void OS::TearDown() { |
711 delete limit_mutex; | 711 delete limit_mutex; |
712 } | 712 } |
713 | 713 |
714 | 714 |
715 } } // namespace v8::internal | 715 } } // namespace v8::internal |
OLD | NEW |