diff options
author | Sean Harmer <sean.harmer.qnx@kdab.com> | 2012-06-13 13:42:03 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-09 13:07:06 +0100 |
commit | e9aef8a2a33233f0eefb6b1e9455c932248c6d4b (patch) | |
tree | 420823ebab587967d57deb6d1bb976b9e91e5066 | |
parent | 04ddd397d805d7717ed532de5da5bd2ae756b571 (diff) | |
download | qtjsbackend-e9aef8a2a33233f0eefb6b1e9455c932248c6d4b.tar.gz |
[V8] Implement OS::SetUp() and OS::TearDown() for QNX
This is needed to not have unresolved symbols following a V8 version
bump.
Change-Id: I6f98573c08cdb803f691678d3986a2ed87038cdb
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
-rw-r--r-- | src/3rdparty/v8/src/platform-qnx.cc | 65 |
1 files changed, 37 insertions, 28 deletions
diff --git a/src/3rdparty/v8/src/platform-qnx.cc b/src/3rdparty/v8/src/platform-qnx.cc index 92e4d6c..cb06510 100644 --- a/src/3rdparty/v8/src/platform-qnx.cc +++ b/src/3rdparty/v8/src/platform-qnx.cc @@ -78,33 +78,6 @@ double ceiling(double x) { static Mutex* limit_mutex = NULL; -void OS::SetUp() { - // Seed the random number generator. We preserve microsecond resolution. - uint64_t seed = Ticks() ^ (getpid() << 16); - srandom(static_cast<unsigned int>(seed)); - limit_mutex = CreateMutex(); - -#ifdef __arm__ - // When running on ARM hardware check that the EABI used by V8 and - // by the C code is the same. - bool hard_float = OS::ArmUsingHardFloat(); - if (hard_float) { -#if !USE_EABI_HARDFLOAT - PrintF("ERROR: Binary compiled with -mfloat-abi=hard but without " - "-DUSE_EABI_HARDFLOAT\n"); - exit(1); -#endif - } else { -#if USE_EABI_HARDFLOAT - PrintF("ERROR: Binary not compiled with -mfloat-abi=hard but with " - "-DUSE_EABI_HARDFLOAT\n"); - exit(1); -#endif - } -#endif -} - - void OS::PostSetUp() { POSIXPostSetUp(); } @@ -906,6 +879,9 @@ class SignalSender : public Thread { vm_tgid_(getpid()), interval_(interval) {} + static void SetUp() { if (!mutex_) mutex_ = OS::CreateMutex(); } + static void TearDown() { delete mutex_; } + static void InstallSignalHandler() { struct sigaction sa; sa.sa_sigaction = ProfilerSignalHandler; @@ -1039,12 +1015,45 @@ class SignalSender : public Thread { }; -Mutex* SignalSender::mutex_ = OS::CreateMutex(); +Mutex* SignalSender::mutex_ = NULL; SignalSender* SignalSender::instance_ = NULL; struct sigaction SignalSender::old_signal_handler_; bool SignalSender::signal_handler_installed_ = false; +void OS::SetUp() { + // Seed the random number generator. We preserve microsecond resolution. + uint64_t seed = Ticks() ^ (getpid() << 16); + srandom(static_cast<unsigned int>(seed)); + limit_mutex = CreateMutex(); + +#ifdef __arm__ + // When running on ARM hardware check that the EABI used by V8 and + // by the C code is the same. + bool hard_float = OS::ArmUsingHardFloat(); + if (hard_float) { +#if !USE_EABI_HARDFLOAT + PrintF("ERROR: Binary compiled with -mfloat-abi=hard but without " + "-DUSE_EABI_HARDFLOAT\n"); + exit(1); +#endif + } else { +#if USE_EABI_HARDFLOAT + PrintF("ERROR: Binary not compiled with -mfloat-abi=hard but with " + "-DUSE_EABI_HARDFLOAT\n"); + exit(1); +#endif + } +#endif +} + + +void OS::TearDown() { + SignalSender::TearDown(); + delete limit_mutex; +} + + Sampler::Sampler(Isolate* isolate, int interval) : isolate_(isolate), interval_(interval), |