#include <signal.h>
#endif
-#if OS(LINUX)
+#if OS(LINUX) || OS(DARWIN)
#include <sys/time.h>
#endif
#pragma clang diagnostic ignored "-Wmissing-noreturn"
#endif
-#if (PLATFORM(MAC) && CPU(X86_64)) || (OS(LINUX) && CPU(X86))
+#if (OS(DARWIN) && !PLATFORM(EFL) && !PLATFORM(GTK) && CPU(X86_64)) || (OS(LINUX) && CPU(X86))
// Helper function to start & stop the timer.
// Presently we're using the wall-clock timer, since this seems to give the best results.
static void setProfileTimer(unsigned usec)
#pragma clang diagnostic pop
#endif
-#if PLATFORM(MAC) && CPU(X86_64)
+#if OS(DARWIN) && !PLATFORM(EFL) && !PLATFORM(GTK) && CPU(X86_64)
static void profilingTimer(int, siginfo_t*, void* uap)
{
mcontext_t context = static_cast<ucontext_t*>(uap)->uc_mcontext;
void CodeProfiling::notifyAllocator(WTF::MetaAllocator* allocator)
{
-#if !OS(WINCE)
// Check for JSC_CODE_PROFILING.
const char* codeProfilingMode = getenv("JSC_CODE_PROFILING");
if (!codeProfilingMode)
ASSERT(!s_tracker);
s_tracker = new WTF::MetaAllocatorTracker();
allocator->trackAllocations(s_tracker);
-#endif
}
void* CodeProfiling::getOwnerUIDForPC(void* address)
if (alreadyProfiling)
return;
-#if (PLATFORM(MAC) && CPU(X86_64)) || (OS(LINUX) && CPU(X86))
+#if (OS(DARWIN) && !PLATFORM(EFL) && !PLATFORM(GTK) && CPU(X86_64)) || (OS(LINUX) && CPU(X86))
// Regsiter a signal handler & itimer.
struct sigaction action;
action.sa_sigaction = reinterpret_cast<void (*)(int, siginfo_t *, void *)>(profilingTimer);
if (s_profileStack)
return;
-#if (PLATFORM(MAC) && CPU(X86_64)) || (OS(LINUX) && CPU(X86))
+#if (OS(DARWIN) && !PLATFORM(EFL) && !PLATFORM(GTK) && CPU(X86_64)) || (OS(LINUX) && CPU(X86))
// Stop profiling
setProfileTimer(0);
#endif