OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 // Finally, compute the actual time. Why is this so hard. | 504 // Finally, compute the actual time. Why is this so hard. |
505 DWORD elapsed = ticks_now - init_ticks; | 505 DWORD elapsed = ticks_now - init_ticks; |
506 this->time_.t_ = init_time.t_ + (static_cast<int64_t>(elapsed) * 10000); | 506 this->time_.t_ = init_time.t_ + (static_cast<int64_t>(elapsed) * 10000); |
507 } | 507 } |
508 | 508 |
509 | 509 |
510 // Return the local timezone offset in milliseconds east of UTC. This | 510 // Return the local timezone offset in milliseconds east of UTC. This |
511 // takes into account whether daylight saving is in effect at the time. | 511 // takes into account whether daylight saving is in effect at the time. |
512 // Only times in the 32-bit Unix range may be passed to this function. | 512 // Only times in the 32-bit Unix range may be passed to this function. |
513 // Also, adding the time-zone offset to the input must not overflow. | 513 // Also, adding the time-zone offset to the input must not overflow. |
514 // The function EquivalentTime() in date-delay.js guarantees this. | 514 // The function EquivalentTime() in date.js guarantees this. |
515 int64_t Time::LocalOffset() { | 515 int64_t Time::LocalOffset() { |
516 // Initialize timezone information, if needed. | 516 // Initialize timezone information, if needed. |
517 TzSet(); | 517 TzSet(); |
518 | 518 |
519 Time rounded_to_second(*this); | 519 Time rounded_to_second(*this); |
520 rounded_to_second.t() = rounded_to_second.t() / 1000 / kTimeScaler * | 520 rounded_to_second.t() = rounded_to_second.t() / 1000 / kTimeScaler * |
521 1000 * kTimeScaler; | 521 1000 * kTimeScaler; |
522 // Convert to local time using POSIX localtime function. | 522 // Convert to local time using POSIX localtime function. |
523 // Windows XP Service Pack 3 made SystemTimeToTzSpecificLocalTime() | 523 // Windows XP Service Pack 3 made SystemTimeToTzSpecificLocalTime() |
524 // very slow. Other browsers use localtime(). | 524 // very slow. Other browsers use localtime(). |
(...skipping 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1900 | 1900 |
1901 // Release the thread handles | 1901 // Release the thread handles |
1902 CloseHandle(data_->sampler_thread_); | 1902 CloseHandle(data_->sampler_thread_); |
1903 CloseHandle(data_->profiled_thread_); | 1903 CloseHandle(data_->profiled_thread_); |
1904 } | 1904 } |
1905 | 1905 |
1906 | 1906 |
1907 #endif // ENABLE_LOGGING_AND_PROFILING | 1907 #endif // ENABLE_LOGGING_AND_PROFILING |
1908 | 1908 |
1909 } } // namespace v8::internal | 1909 } } // namespace v8::internal |
OLD | NEW |