OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 | 521 |
522 // Returns a string identifying the current timezone for the | 522 // Returns a string identifying the current timezone for the |
523 // timestamp taking into account daylight saving. | 523 // timestamp taking into account daylight saving. |
524 char* Time::LocalTimezone() { | 524 char* Time::LocalTimezone() { |
525 // Return the standard or DST time zone name based on whether daylight | 525 // Return the standard or DST time zone name based on whether daylight |
526 // saving is in effect at the given time. | 526 // saving is in effect at the given time. |
527 return InDST() ? dst_tz_name_ : std_tz_name_; | 527 return InDST() ? dst_tz_name_ : std_tz_name_; |
528 } | 528 } |
529 | 529 |
530 | 530 |
531 void OS::Setup() { | 531 void OS::SetUp() { |
532 // Seed the random number generator. | 532 // Seed the random number generator. |
533 // Convert the current time to a 64-bit integer first, before converting it | 533 // Convert the current time to a 64-bit integer first, before converting it |
534 // to an unsigned. Going directly can cause an overflow and the seed to be | 534 // to an unsigned. Going directly can cause an overflow and the seed to be |
535 // set to all ones. The seed will be identical for different instances that | 535 // set to all ones. The seed will be identical for different instances that |
536 // call this setup code within the same millisecond. | 536 // call this setup code within the same millisecond. |
537 uint64_t seed = static_cast<uint64_t>(TimeCurrentMillis()); | 537 uint64_t seed = static_cast<uint64_t>(TimeCurrentMillis()); |
538 srand(static_cast<unsigned int>(seed)); | 538 srand(static_cast<unsigned int>(seed)); |
539 limit_mutex = CreateMutex(); | 539 limit_mutex = CreateMutex(); |
540 } | 540 } |
541 | 541 |
(...skipping 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1818 | 1818 |
1819 | 1819 |
1820 bool Win32Socket::SetReuseAddress(bool reuse_address) { | 1820 bool Win32Socket::SetReuseAddress(bool reuse_address) { |
1821 BOOL on = reuse_address ? true : false; | 1821 BOOL on = reuse_address ? true : false; |
1822 int status = setsockopt(socket_, SOL_SOCKET, SO_REUSEADDR, | 1822 int status = setsockopt(socket_, SOL_SOCKET, SO_REUSEADDR, |
1823 reinterpret_cast<char*>(&on), sizeof(on)); | 1823 reinterpret_cast<char*>(&on), sizeof(on)); |
1824 return status == SOCKET_ERROR; | 1824 return status == SOCKET_ERROR; |
1825 } | 1825 } |
1826 | 1826 |
1827 | 1827 |
1828 bool Socket::Setup() { | 1828 bool Socket::SetUp() { |
1829 // Initialize Winsock32 | 1829 // Initialize Winsock32 |
1830 int err; | 1830 int err; |
1831 WSADATA winsock_data; | 1831 WSADATA winsock_data; |
1832 WORD version_requested = MAKEWORD(1, 0); | 1832 WORD version_requested = MAKEWORD(1, 0); |
1833 err = WSAStartup(version_requested, &winsock_data); | 1833 err = WSAStartup(version_requested, &winsock_data); |
1834 if (err != 0) { | 1834 if (err != 0) { |
1835 PrintF("Unable to initialize Winsock, err = %d\n", Socket::LastError()); | 1835 PrintF("Unable to initialize Winsock, err = %d\n", Socket::LastError()); |
1836 } | 1836 } |
1837 | 1837 |
1838 return err == 0; | 1838 return err == 0; |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2038 | 2038 |
2039 | 2039 |
2040 void Sampler::Stop() { | 2040 void Sampler::Stop() { |
2041 ASSERT(IsActive()); | 2041 ASSERT(IsActive()); |
2042 SamplerThread::RemoveActiveSampler(this); | 2042 SamplerThread::RemoveActiveSampler(this); |
2043 SetActive(false); | 2043 SetActive(false); |
2044 } | 2044 } |
2045 | 2045 |
2046 | 2046 |
2047 } } // namespace v8::internal | 2047 } } // namespace v8::internal |
OLD | NEW |