| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 // Seed the random number generator. | 76 // Seed the random number generator. |
| 77 // Convert the current time to a 64-bit integer first, before converting it | 77 // Convert the current time to a 64-bit integer first, before converting it |
| 78 // to an unsigned. Going directly can cause an overflow and the seed to be | 78 // to an unsigned. Going directly can cause an overflow and the seed to be |
| 79 // set to all ones. The seed will be identical for different instances that | 79 // set to all ones. The seed will be identical for different instances that |
| 80 // call this setup code within the same millisecond. | 80 // call this setup code within the same millisecond. |
| 81 uint64_t seed = static_cast<uint64_t>(TimeCurrentMillis()); | 81 uint64_t seed = static_cast<uint64_t>(TimeCurrentMillis()); |
| 82 srandom(static_cast<unsigned int>(seed)); | 82 srandom(static_cast<unsigned int>(seed)); |
| 83 } | 83 } |
| 84 | 84 |
| 85 | 85 |
| 86 void OS::ReleaseStore(volatile AtomicWord* ptr, AtomicWord value) { |
| 87 __asm__ __volatile__("" : : : "memory"); |
| 88 *ptr = value; |
| 89 } |
| 90 |
| 91 |
| 86 uint64_t OS::CpuFeaturesImpliedByPlatform() { | 92 uint64_t OS::CpuFeaturesImpliedByPlatform() { |
| 87 return 0; // OpenBSD runs on anything. | 93 return 0; // OpenBSD runs on anything. |
| 88 } | 94 } |
| 89 | 95 |
| 90 | 96 |
| 91 int OS::ActivationFrameAlignment() { | 97 int OS::ActivationFrameAlignment() { |
| 92 // 16 byte alignment on OpenBSD | 98 // 16 byte alignment on OpenBSD |
| 93 return 16; | 99 return 16; |
| 94 } | 100 } |
| 95 | 101 |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 } | 613 } |
| 608 | 614 |
| 609 // This sampler is no longer the active sampler. | 615 // This sampler is no longer the active sampler. |
| 610 active_sampler_ = NULL; | 616 active_sampler_ = NULL; |
| 611 active_ = false; | 617 active_ = false; |
| 612 } | 618 } |
| 613 | 619 |
| 614 #endif // ENABLE_LOGGING_AND_PROFILING | 620 #endif // ENABLE_LOGGING_AND_PROFILING |
| 615 | 621 |
| 616 } } // namespace v8::internal | 622 } } // namespace v8::internal |
| OLD | NEW |