| 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 // at the time. | 244 // at the time. |
| 245 int64_t LocalOffset(); | 245 int64_t LocalOffset(); |
| 246 | 246 |
| 247 // Returns the daylight savings time offset for the time in milliseconds. | 247 // Returns the daylight savings time offset for the time in milliseconds. |
| 248 int64_t DaylightSavingsOffset(); | 248 int64_t DaylightSavingsOffset(); |
| 249 | 249 |
| 250 // Returns a string identifying the current timezone for the | 250 // Returns a string identifying the current timezone for the |
| 251 // timestamp taking into account daylight saving. | 251 // timestamp taking into account daylight saving. |
| 252 char* LocalTimezone(); | 252 char* LocalTimezone(); |
| 253 | 253 |
| 254 static void TimeZoneChanged() { tz_initialized_ = false; } |
| 255 |
| 254 private: | 256 private: |
| 255 // Constants for time conversion. | 257 // Constants for time conversion. |
| 256 static const int64_t kTimeEpoc = 116444736000000000LL; | 258 static const int64_t kTimeEpoc = 116444736000000000LL; |
| 257 static const int64_t kTimeScaler = 10000; | 259 static const int64_t kTimeScaler = 10000; |
| 258 static const int64_t kMsPerMinute = 60000; | 260 static const int64_t kMsPerMinute = 60000; |
| 259 | 261 |
| 260 // Constants for timezone information. | 262 // Constants for timezone information. |
| 261 static const int kTzNameSize = 128; | 263 static const int kTzNameSize = 128; |
| 262 static const bool kShortTzNames = false; | 264 static const bool kShortTzNames = false; |
| 263 | 265 |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 | 606 |
| 605 | 607 |
| 606 // Returns the daylight savings offset in milliseconds for the given | 608 // Returns the daylight savings offset in milliseconds for the given |
| 607 // time. | 609 // time. |
| 608 double OS::DaylightSavingsOffset(double time) { | 610 double OS::DaylightSavingsOffset(double time) { |
| 609 int64_t offset = Win32Time(time).DaylightSavingsOffset(); | 611 int64_t offset = Win32Time(time).DaylightSavingsOffset(); |
| 610 return static_cast<double>(offset); | 612 return static_cast<double>(offset); |
| 611 } | 613 } |
| 612 | 614 |
| 613 | 615 |
| 616 void OS::TimeZoneChanged() { |
| 617 Win32Time::TimeZoneChanged(); |
| 618 } |
| 619 |
| 620 |
| 614 int OS::GetLastError() { | 621 int OS::GetLastError() { |
| 615 return ::GetLastError(); | 622 return ::GetLastError(); |
| 616 } | 623 } |
| 617 | 624 |
| 618 | 625 |
| 619 int OS::GetCurrentProcessId() { | 626 int OS::GetCurrentProcessId() { |
| 620 return static_cast<int>(::GetCurrentProcessId()); | 627 return static_cast<int>(::GetCurrentProcessId()); |
| 621 } | 628 } |
| 622 | 629 |
| 623 | 630 |
| (...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1504 ASSERT(result); | 1511 ASSERT(result); |
| 1505 } | 1512 } |
| 1506 | 1513 |
| 1507 | 1514 |
| 1508 | 1515 |
| 1509 void Thread::YieldCPU() { | 1516 void Thread::YieldCPU() { |
| 1510 Sleep(0); | 1517 Sleep(0); |
| 1511 } | 1518 } |
| 1512 | 1519 |
| 1513 } } // namespace v8::internal | 1520 } } // namespace v8::internal |
| OLD | NEW |