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

Side by Side Diff: runtime/vm/thread_interrupter_linux.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_fuchsia.cc ('k') | runtime/vm/thread_interrupter_macos.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_LINUX) 6 #if defined(HOST_OS_LINUX)
7 7
8 #include <errno.h> // NOLINT 8 #include <errno.h> // NOLINT
9 9
10 #include "vm/flags.h" 10 #include "vm/flags.h"
(...skipping 27 matching lines...) Expand all
38 InterruptedThreadState its; 38 InterruptedThreadState its;
39 its.pc = SignalHandler::GetProgramCounter(mcontext); 39 its.pc = SignalHandler::GetProgramCounter(mcontext);
40 its.fp = SignalHandler::GetFramePointer(mcontext); 40 its.fp = SignalHandler::GetFramePointer(mcontext);
41 its.csp = SignalHandler::GetCStackPointer(mcontext); 41 its.csp = SignalHandler::GetCStackPointer(mcontext);
42 its.dsp = SignalHandler::GetDartStackPointer(mcontext); 42 its.dsp = SignalHandler::GetDartStackPointer(mcontext);
43 its.lr = SignalHandler::GetLinkRegister(mcontext); 43 its.lr = SignalHandler::GetLinkRegister(mcontext);
44 Profiler::SampleThread(thread, its); 44 Profiler::SampleThread(thread, its);
45 } 45 }
46 }; 46 };
47 47
48
49 bool ThreadInterrupter::IsDebuggerAttached() { 48 bool ThreadInterrupter::IsDebuggerAttached() {
50 return false; 49 return false;
51 } 50 }
52 51
53
54 void ThreadInterrupter::InterruptThread(OSThread* thread) { 52 void ThreadInterrupter::InterruptThread(OSThread* thread) {
55 if (FLAG_trace_thread_interrupter) { 53 if (FLAG_trace_thread_interrupter) {
56 OS::PrintErr("ThreadInterrupter interrupting %p\n", 54 OS::PrintErr("ThreadInterrupter interrupting %p\n",
57 reinterpret_cast<void*>(thread->id())); 55 reinterpret_cast<void*>(thread->id()));
58 } 56 }
59 int result = pthread_kill(thread->id(), SIGPROF); 57 int result = pthread_kill(thread->id(), SIGPROF);
60 ASSERT((result == 0) || (result == ESRCH)); 58 ASSERT((result == 0) || (result == ESRCH));
61 } 59 }
62 60
63
64 void ThreadInterrupter::InstallSignalHandler() { 61 void ThreadInterrupter::InstallSignalHandler() {
65 SignalHandler::Install< 62 SignalHandler::Install<
66 ThreadInterrupterLinux::ThreadInterruptSignalHandler>(); 63 ThreadInterrupterLinux::ThreadInterruptSignalHandler>();
67 } 64 }
68 65
69
70 void ThreadInterrupter::RemoveSignalHandler() { 66 void ThreadInterrupter::RemoveSignalHandler() {
71 SignalHandler::Remove(); 67 SignalHandler::Remove();
72 } 68 }
73 69
74 #endif // !PRODUCT 70 #endif // !PRODUCT
75 71
76 } // namespace dart 72 } // namespace dart
77 73
78 #endif // defined(HOST_OS_LINUX) 74 #endif // defined(HOST_OS_LINUX)
OLDNEW
« no previous file with comments | « runtime/vm/thread_interrupter_fuchsia.cc ('k') | runtime/vm/thread_interrupter_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698