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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // Seed the random number generator. | 77 // Seed the random number generator. |
78 // Convert the current time to a 64-bit integer first, before converting it | 78 // Convert the current time to a 64-bit integer first, before converting it |
79 // to an unsigned. Going directly can cause an overflow and the seed to be | 79 // to an unsigned. Going directly can cause an overflow and the seed to be |
80 // set to all ones. The seed will be identical for different instances that | 80 // set to all ones. The seed will be identical for different instances that |
81 // call this setup code within the same millisecond. | 81 // call this setup code within the same millisecond. |
82 uint64_t seed = static_cast<uint64_t>(TimeCurrentMillis()); | 82 uint64_t seed = static_cast<uint64_t>(TimeCurrentMillis()); |
83 srandom(static_cast<unsigned int>(seed)); | 83 srandom(static_cast<unsigned int>(seed)); |
84 } | 84 } |
85 | 85 |
86 | 86 |
| 87 void OS::ReleaseStore(volatile AtomicWord* ptr, AtomicWord value) { |
| 88 __asm__ __volatile__("" : : : "memory"); |
| 89 *ptr = value; |
| 90 } |
| 91 |
| 92 |
87 uint64_t OS::CpuFeaturesImpliedByPlatform() { | 93 uint64_t OS::CpuFeaturesImpliedByPlatform() { |
88 return 0; // FreeBSD runs on anything. | 94 return 0; // FreeBSD runs on anything. |
89 } | 95 } |
90 | 96 |
91 | 97 |
92 int OS::ActivationFrameAlignment() { | 98 int OS::ActivationFrameAlignment() { |
93 // 16 byte alignment on FreeBSD | 99 // 16 byte alignment on FreeBSD |
94 return 16; | 100 return 16; |
95 } | 101 } |
96 | 102 |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 } | 658 } |
653 | 659 |
654 // This sampler is no longer the active sampler. | 660 // This sampler is no longer the active sampler. |
655 active_sampler_ = NULL; | 661 active_sampler_ = NULL; |
656 active_ = false; | 662 active_ = false; |
657 } | 663 } |
658 | 664 |
659 #endif // ENABLE_LOGGING_AND_PROFILING | 665 #endif // ENABLE_LOGGING_AND_PROFILING |
660 | 666 |
661 } } // namespace v8::internal | 667 } } // namespace v8::internal |
OLD | NEW |