Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Side by Side Diff: runtime/vm/thread_interrupter_macos.cc

Issue 2974233002: VM: Re-format to use at most one newline between functions (Closed)
Patch Set: Rebase and merge Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/thread_interrupter_linux.cc ('k') | runtime/vm/thread_interrupter_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(HOST_OS_MACOS) 6 #if defined(HOST_OS_MACOS)
7 7
8 #include <errno.h> // NOLINT
9 #include <assert.h> // NOLINT 8 #include <assert.h> // NOLINT
9 #include <errno.h> // NOLINT
10 #include <stdbool.h> // NOLINT 10 #include <stdbool.h> // NOLINT
11 #include <sys/sysctl.h> // NOLINT
11 #include <sys/types.h> // NOLINT 12 #include <sys/types.h> // NOLINT
12 #include <unistd.h> // NOLINT 13 #include <unistd.h> // NOLINT
13 #include <sys/sysctl.h> // NOLINT
14 14
15 #include "vm/flags.h" 15 #include "vm/flags.h"
16 #include "vm/os.h" 16 #include "vm/os.h"
17 #include "vm/profiler.h" 17 #include "vm/profiler.h"
18 #include "vm/signal_handler.h" 18 #include "vm/signal_handler.h"
19 #include "vm/thread_interrupter.h" 19 #include "vm/thread_interrupter.h"
20 20
21 namespace dart { 21 namespace dart {
22 22
23 #ifndef PRODUCT 23 #ifndef PRODUCT
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 InterruptedThreadState its; 64 InterruptedThreadState its;
65 its.pc = SignalHandler::GetProgramCounter(mcontext); 65 its.pc = SignalHandler::GetProgramCounter(mcontext);
66 its.fp = SignalHandler::GetFramePointer(mcontext); 66 its.fp = SignalHandler::GetFramePointer(mcontext);
67 its.csp = SignalHandler::GetCStackPointer(mcontext); 67 its.csp = SignalHandler::GetCStackPointer(mcontext);
68 its.dsp = SignalHandler::GetDartStackPointer(mcontext); 68 its.dsp = SignalHandler::GetDartStackPointer(mcontext);
69 its.lr = SignalHandler::GetLinkRegister(mcontext); 69 its.lr = SignalHandler::GetLinkRegister(mcontext);
70 Profiler::SampleThread(thread, its); 70 Profiler::SampleThread(thread, its);
71 } 71 }
72 }; 72 };
73 73
74
75 void ThreadInterrupter::InterruptThread(OSThread* thread) { 74 void ThreadInterrupter::InterruptThread(OSThread* thread) {
76 if (FLAG_trace_thread_interrupter) { 75 if (FLAG_trace_thread_interrupter) {
77 OS::PrintErr("ThreadInterrupter interrupting %p\n", thread->id()); 76 OS::PrintErr("ThreadInterrupter interrupting %p\n", thread->id());
78 } 77 }
79 int result = pthread_kill(thread->id(), SIGPROF); 78 int result = pthread_kill(thread->id(), SIGPROF);
80 ASSERT((result == 0) || (result == ESRCH)); 79 ASSERT((result == 0) || (result == ESRCH));
81 } 80 }
82 81
83
84 void ThreadInterrupter::InstallSignalHandler() { 82 void ThreadInterrupter::InstallSignalHandler() {
85 SignalHandler::Install< 83 SignalHandler::Install<
86 ThreadInterrupterMacOS::ThreadInterruptSignalHandler>(); 84 ThreadInterrupterMacOS::ThreadInterruptSignalHandler>();
87 } 85 }
88 86
89
90 void ThreadInterrupter::RemoveSignalHandler() { 87 void ThreadInterrupter::RemoveSignalHandler() {
91 SignalHandler::Remove(); 88 SignalHandler::Remove();
92 } 89 }
93 90
94 #endif // !PRODUCT 91 #endif // !PRODUCT
95 92
96 } // namespace dart 93 } // namespace dart
97 94
98 #endif // defined(HOST_OS_MACOS) 95 #endif // defined(HOST_OS_MACOS)
OLDNEW
« no previous file with comments | « runtime/vm/thread_interrupter_linux.cc ('k') | runtime/vm/thread_interrupter_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698