| 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 23 matching lines...) Expand all Loading... |
| 34 #include <stdarg.h> | 34 #include <stdarg.h> |
| 35 #include <strings.h> // index | 35 #include <strings.h> // index |
| 36 #include <sys/time.h> | 36 #include <sys/time.h> |
| 37 #include <sys/mman.h> // mmap & munmap | 37 #include <sys/mman.h> // mmap & munmap |
| 38 #include <unistd.h> // sysconf | 38 #include <unistd.h> // sysconf |
| 39 | 39 |
| 40 #undef MAP_TYPE | 40 #undef MAP_TYPE |
| 41 | 41 |
| 42 #include "v8.h" | 42 #include "v8.h" |
| 43 | 43 |
| 44 #include "platform-posix.h" |
| 44 #include "platform.h" | 45 #include "platform.h" |
| 45 #include "v8threads.h" | 46 #include "v8threads.h" |
| 46 #include "vm-state-inl.h" | 47 #include "vm-state-inl.h" |
| 47 #include "win32-headers.h" | 48 #include "win32-headers.h" |
| 48 | 49 |
| 49 namespace v8 { | 50 namespace v8 { |
| 50 namespace internal { | 51 namespace internal { |
| 51 | 52 |
| 52 // 0 is never a valid thread id | 53 // 0 is never a valid thread id |
| 53 static const pthread_t kNoThread = (pthread_t) 0; | 54 static const pthread_t kNoThread = (pthread_t) 0; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 66 // Convert the current time to a 64-bit integer first, before converting it | 67 // Convert the current time to a 64-bit integer first, before converting it |
| 67 // to an unsigned. Going directly can cause an overflow and the seed to be | 68 // to an unsigned. Going directly can cause an overflow and the seed to be |
| 68 // set to all ones. The seed will be identical for different instances that | 69 // set to all ones. The seed will be identical for different instances that |
| 69 // call this setup code within the same millisecond. | 70 // call this setup code within the same millisecond. |
| 70 uint64_t seed = static_cast<uint64_t>(TimeCurrentMillis()); | 71 uint64_t seed = static_cast<uint64_t>(TimeCurrentMillis()); |
| 71 srandom(static_cast<unsigned int>(seed)); | 72 srandom(static_cast<unsigned int>(seed)); |
| 72 limit_mutex = CreateMutex(); | 73 limit_mutex = CreateMutex(); |
| 73 } | 74 } |
| 74 | 75 |
| 75 | 76 |
| 77 void OS::PostSetUp() { |
| 78 // Math functions depend on CPU features therefore they are initialized after |
| 79 // CPU. |
| 80 MathSetup(); |
| 81 } |
| 82 |
| 76 uint64_t OS::CpuFeaturesImpliedByPlatform() { | 83 uint64_t OS::CpuFeaturesImpliedByPlatform() { |
| 77 return 0; // Nothing special about Cygwin. | 84 return 0; // Nothing special about Cygwin. |
| 78 } | 85 } |
| 79 | 86 |
| 80 | 87 |
| 81 int OS::ActivationFrameAlignment() { | 88 int OS::ActivationFrameAlignment() { |
| 82 // With gcc 4.4 the tree vectorization optimizer can generate code | 89 // With gcc 4.4 the tree vectorization optimizer can generate code |
| 83 // that requires 16 byte alignment such as movdqa on x86. | 90 // that requires 16 byte alignment such as movdqa on x86. |
| 84 return 16; | 91 return 16; |
| 85 } | 92 } |
| (...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 | 768 |
| 762 | 769 |
| 763 void Sampler::Stop() { | 770 void Sampler::Stop() { |
| 764 ASSERT(IsActive()); | 771 ASSERT(IsActive()); |
| 765 SamplerThread::RemoveActiveSampler(this); | 772 SamplerThread::RemoveActiveSampler(this); |
| 766 SetActive(false); | 773 SetActive(false); |
| 767 } | 774 } |
| 768 | 775 |
| 769 | 776 |
| 770 } } // namespace v8::internal | 777 } } // namespace v8::internal |
| OLD | NEW |