| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 #include "v8threads.h" | 54 #include "v8threads.h" |
| 55 | 55 |
| 56 #include "platform.h" | 56 #include "platform.h" |
| 57 #include "vm-state-inl.h" | 57 #include "vm-state-inl.h" |
| 58 | 58 |
| 59 | 59 |
| 60 namespace v8 { | 60 namespace v8 { |
| 61 namespace internal { | 61 namespace internal { |
| 62 | 62 |
| 63 | 63 |
| 64 const char* OS::LocalTimezone(double time) { | 64 const char* OS::LocalTimezone(double time, TimezoneCache* cache) { |
| 65 if (std::isnan(time)) return ""; | 65 if (std::isnan(time)) return ""; |
| 66 time_t tv = static_cast<time_t>(std::floor(time/msPerSecond)); | 66 time_t tv = static_cast<time_t>(std::floor(time/msPerSecond)); |
| 67 struct tm* t = localtime(&tv); | 67 struct tm* t = localtime(&tv); |
| 68 if (NULL == t) return ""; | 68 if (NULL == t) return ""; |
| 69 return t->tm_zone; | 69 return t->tm_zone; |
| 70 } | 70 } |
| 71 | 71 |
| 72 | 72 |
| 73 double OS::LocalTimeOffset() { | 73 double OS::LocalTimeOffset(TimezoneCache* cache) { |
| 74 time_t tv = time(NULL); | 74 time_t tv = time(NULL); |
| 75 struct tm* t = localtime(&tv); | 75 struct tm* t = localtime(&tv); |
| 76 // tm_gmtoff includes any daylight savings offset, so subtract it. | 76 // tm_gmtoff includes any daylight savings offset, so subtract it. |
| 77 return static_cast<double>(t->tm_gmtoff * msPerSecond - | 77 return static_cast<double>(t->tm_gmtoff * msPerSecond - |
| 78 (t->tm_isdst > 0 ? 3600 * msPerSecond : 0)); | 78 (t->tm_isdst > 0 ? 3600 * msPerSecond : 0)); |
| 79 } | 79 } |
| 80 | 80 |
| 81 | 81 |
| 82 void* OS::Allocate(const size_t requested, | 82 void* OS::Allocate(const size_t requested, |
| 83 size_t* allocated, | 83 size_t* allocated, |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 return munmap(base, size) == 0; | 323 return munmap(base, size) == 0; |
| 324 } | 324 } |
| 325 | 325 |
| 326 | 326 |
| 327 bool VirtualMemory::HasLazyCommits() { | 327 bool VirtualMemory::HasLazyCommits() { |
| 328 // TODO(alph): implement for the platform. | 328 // TODO(alph): implement for the platform. |
| 329 return false; | 329 return false; |
| 330 } | 330 } |
| 331 | 331 |
| 332 } } // namespace v8::internal | 332 } } // namespace v8::internal |
| OLD | NEW |