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


Ignore:
Timestamp:
Jun 11, 2017, 5:47:18 PM (8 years ago)
Author:
Yusuke Suzuki
Message:

[WTF] Make ThreadMessage portable
https://bugs.webkit.org/show_bug.cgi?id=172073

Reviewed by Keith Miller.

Source/JavaScriptCore:

  • runtime/MachineContext.h:

(JSC::MachineContext::stackPointer):

  • tools/CodeProfiling.cpp:

(JSC::profilingTimer):

Source/WTF:

Recently, we change ThreadMessage semantics: message handler
can be executed in the sender thread.
This allows ThreadMessage to be implemented in a portable way.

This patch implements ThreadMessage for all the platforms.
We use platform-independent Thread APIs, suspend(), resume(),
and getRegisters().

  • wtf/PlatformRegisters.h:

(WTF::registersFromUContext):

  • wtf/ThreadMessage.cpp:

(WTF::sendMessageScoped):
(WTF::ThreadMessageData::ThreadMessageData): Deleted.
(): Deleted.
(WTF::initializeThreadMessages): Deleted.
(WTF::sendMessageUsingSignal): Deleted.
(WTF::sendMessageUsingMach): Deleted.
(WTF::deliverMessagesUsingMach): Deleted.

  • wtf/ThreadMessage.h:
  • wtf/Threading.cpp:

(WTF::initializeThreading):

  • wtf/Threading.h:

(WTF::Thread::threadMessages): Deleted.

  • wtf/ThreadingPthreads.cpp:

(WTF::Thread::signalHandlerSuspendResume):
(WTF::threadStateMetadata):
(WTF::Thread::getRegisters):

  • wtf/threads/Signals.cpp:

(WTF::handleSignalsWithMach):

File:
1 edited

Legend:

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

    r215318 r218080  
    7171static void profilingTimer(int, siginfo_t*, void* uap)
    7272{
    73     mcontext_t context = static_cast<ucontext_t*>(uap)->uc_mcontext;
     73    PlatformRegisters& platformRegisters = WTF::registersFromUContext(static_cast<ucontext_t*>(uap));
    7474    CodeProfiling::sample(
    75         MachineContext::instructionPointer(context),
    76         reinterpret_cast<void**>(MachineContext::framePointer(context)));
     75        MachineContext::instructionPointer(platformRegisters),
     76        reinterpret_cast<void**>(MachineContext::framePointer(platformRegisters)));
    7777}
    7878#endif
Note: See TracChangeset for help on using the changeset viewer.