From 96bf621c197b71221abb3c7d4974f1587a799f45 Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Wed, 13 Jun 2012 13:42:03 +0100 Subject: [PATCH] [V8] Implement OS::SetUp() and OS::TearDown() for QNX This is needed to not have unresolved symbols following a V8 version bump. Change-Id: Ie5888d3256f2c93514f0b78463f6a9fe1b53b2e0 Reviewed-by: Simon Hausmann Reviewed-by: Peter Varga --- src/3rdparty/v8/src/platform-qnx.cc | 65 +++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 28 deletions(-) diff --git a/src/3rdparty/v8/src/platform-qnx.cc b/src/3rdparty/v8/src/platform-qnx.cc index 53e6cf5..9d075e3 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(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(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), -- 2.7.4