| Index: runtime/vm/thread_interrupter_linux.cc
|
| diff --git a/runtime/vm/thread_interrupter_linux.cc b/runtime/vm/thread_interrupter_linux.cc
|
| index 28ec681fa555813ee343a7c5bbb95be5cd05925a..16d4d8fa4190a86e7652b6129846bf7dd1763d25 100644
|
| --- a/runtime/vm/thread_interrupter_linux.cc
|
| +++ b/runtime/vm/thread_interrupter_linux.cc
|
| @@ -18,29 +18,27 @@ namespace dart {
|
| DECLARE_FLAG(bool, thread_interrupter);
|
| DECLARE_FLAG(bool, trace_thread_interrupter);
|
|
|
| -class ThreadInterrupterLinux : public AllStatic {
|
| - public:
|
| - static void ThreadInterruptSignalHandler(int signal, siginfo_t* info,
|
| - void* context_) {
|
| - if (signal != SIGPROF) {
|
| - return;
|
| - }
|
| - Thread* thread = Thread::Current();
|
| - if (thread == NULL) {
|
| - return;
|
| - }
|
| - // Extract thread state.
|
| - ucontext_t* context = reinterpret_cast<ucontext_t*>(context_);
|
| - mcontext_t mcontext = context->uc_mcontext;
|
| - InterruptedThreadState its;
|
| - its.pc = SignalHandler::GetProgramCounter(mcontext);
|
| - its.fp = SignalHandler::GetFramePointer(mcontext);
|
| - its.csp = SignalHandler::GetCStackPointer(mcontext);
|
| - its.dsp = SignalHandler::GetDartStackPointer(mcontext);
|
| - its.lr = SignalHandler::GetLinkRegister(mcontext);
|
| - Profiler::SampleThread(thread, its);
|
| +
|
| +static void ThreadInterruptSignalHandler(int signal, siginfo_t* info,
|
| + void* context_) {
|
| + if (signal != SIGPROF) {
|
| + return;
|
| + }
|
| + Thread* thread = Thread::Current();
|
| + if (thread == NULL) {
|
| + return;
|
| }
|
| -};
|
| + // Extract thread state.
|
| + ucontext_t* context = reinterpret_cast<ucontext_t*>(context_);
|
| + mcontext_t mcontext = context->uc_mcontext;
|
| + InterruptedThreadState its;
|
| + its.pc = SignalHandler::GetProgramCounter(mcontext);
|
| + its.fp = SignalHandler::GetFramePointer(mcontext);
|
| + its.csp = SignalHandler::GetCStackPointer(mcontext);
|
| + its.dsp = SignalHandler::GetDartStackPointer(mcontext);
|
| + its.lr = SignalHandler::GetLinkRegister(mcontext);
|
| + Profiler::SampleThread(thread, its);
|
| +}
|
|
|
|
|
| void ThreadInterrupter::InterruptThread(OSThread* thread) {
|
| @@ -54,7 +52,7 @@ void ThreadInterrupter::InterruptThread(OSThread* thread) {
|
|
|
|
|
| void ThreadInterrupter::InstallSignalHandler() {
|
| - SignalHandler::Install(ThreadInterrupterLinux::ThreadInterruptSignalHandler);
|
| + SignalHandler::Install(ThreadInterruptSignalHandler);
|
| }
|
|
|
|
|
|
|