Changeset 215318 in webkit for trunk/Source/JavaScriptCore/tools


Ignore:
Timestamp:
Apr 13, 2017, 7:17:00 AM (8 years ago)
Author:
Yusuke Suzuki
Message:

[JSC] Use proper ifdef guard for code using MachineContext
https://bugs.webkit.org/show_bug.cgi?id=170800

Reviewed by Carlos Alberto Lopez Perez.

Source/JavaScriptCore:

This patch drops MachineContext use if it is not available.
This situation can be considered like, building WebKit with musl.
In that case, we simply disable features that rely on MachineContext.
Examples are wasm fast memory, sampling profiler, and code profiling.

  • runtime/Options.cpp:

(JSC::overrideDefaults):

  • tools/CodeProfiling.cpp:

(JSC::CodeProfiling::begin):
(JSC::CodeProfiling::end):
Previously, PLATFORM(GTK) is excluded. But it is not obvious why it is excluded.
This patch just includes such platforms.

  • wasm/WasmFaultSignalHandler.cpp:

(JSC::Wasm::enableFastMemory):

Source/WTF:

SamplingProfiler and FastMemory rely on MachineContext feature.

  • wtf/Platform.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/tools/CodeProfiling.cpp

    r213886 r215318  
    3535#endif
    3636
    37 #if OS(LINUX) || OS(DARWIN)
     37#if HAVE(MACHINE_CONTEXT)
    3838#include <sys/time.h>
    3939#endif
     
    5050#endif
    5151
    52 #if (OS(DARWIN) && !PLATFORM(GTK) && CPU(X86_64)) || (OS(LINUX) && CPU(X86))
     52#if HAVE(MACHINE_CONTEXT)
    5353// Helper function to start & stop the timer.
    5454// Presently we're using the wall-clock timer, since this seems to give the best results.
     
    6868#endif
    6969
    70 #if (OS(DARWIN) && !PLATFORM(GTK) && CPU(X86_64)) || (OS(LINUX) && CPU(X86))
     70#if HAVE(MACHINE_CONTEXT)
    7171static void profilingTimer(int, siginfo_t*, void* uap)
    7272{
     
    137137        return;
    138138
    139 #if (OS(DARWIN) && !PLATFORM(GTK) && CPU(X86_64)) || (OS(LINUX) && CPU(X86))
     139#if HAVE(MACHINE_CONTEXT)
    140140    // Regsiter a signal handler & itimer.
    141141    struct sigaction action;
     
    161161        return;
    162162
    163 #if (OS(DARWIN) && !PLATFORM(GTK) && CPU(X86_64)) || (OS(LINUX) && CPU(X86))
     163#if HAVE(MACHINE_CONTEXT)
    164164    // Stop profiling
    165165    setProfileTimer(0);
Note: See TracChangeset for help on using the changeset viewer.