Skip to content

Commit

Permalink
[V8] Implement OS::SetUp() and OS::TearDown() for QNX
Browse files Browse the repository at this point in the history
This is needed to not have unresolved symbols following a V8 version
bump.

Change-Id: Ie5888d3256f2c93514f0b78463f6a9fe1b53b2e0
Reviewed-by: Simon Hausmann <[email protected]>
Reviewed-by: Peter Varga <[email protected]>
  • Loading branch information
Sean Harmer authored and Qt by Nokia committed Jun 13, 2012
1 parent 32de497 commit 96bf621
Showing 1 changed file with 37 additions and 28 deletions.
65 changes: 37 additions & 28 deletions src/3rdparty/v8/src/platform-qnx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 96bf621

Please sign in to comment.