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

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

Issue 2250823002: Partially implement DBC profiler. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync Created 4 years, 4 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/profiler.cc ('k') | runtime/vm/simulator_arm.h » ('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 "vm/globals.h" 5 #include "vm/globals.h"
6 #include "vm/instructions.h" 6 #include "vm/instructions.h"
7 #include "vm/simulator.h" 7 #include "vm/simulator.h"
8 #include "vm/signal_handler.h" 8 #include "vm/signal_handler.h"
9 #if defined(TARGET_OS_MACOS) 9 #if defined(TARGET_OS_MACOS)
10 10
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 return static_cast<uintptr_t>(mcontext->__ss.__x[SPREG]); 72 return static_cast<uintptr_t>(mcontext->__ss.__x[SPREG]);
73 #else 73 #else
74 return GetCStackPointer(mcontext); 74 return GetCStackPointer(mcontext);
75 #endif 75 #endif
76 } 76 }
77 77
78 78
79 uintptr_t SignalHandler::GetLinkRegister(const mcontext_t& mcontext) { 79 uintptr_t SignalHandler::GetLinkRegister(const mcontext_t& mcontext) {
80 uintptr_t lr = 0; 80 uintptr_t lr = 0;
81 81
82 #if defined(TARGET_ARCH_IA32) 82 #if defined(HOST_ARCH_IA32)
83 lr = 0; 83 lr = 0;
84 #elif defined(TARGET_ARCH_X64) 84 #elif defined(HOST_ARCH_X64)
85 lr = 0; 85 lr = 0;
86 #elif defined(TARGET_ARCH_MIPS) && defined(USING_SIMULATOR) 86 #elif defined(HOST_ARCH_ARM)
87 lr = 0; 87 lr = static_cast<uintptr_t>(mcontext->__ss.__lr);
88 #elif defined(TARGET_ARCH_ARM) && defined(USING_SIMULATOR) 88 #elif defined(HOST_ARCH_ARM64)
89 lr = 0; 89 lr = static_cast<uintptr_t>(mcontext->__ss.__lr);
90 #elif defined(TARGET_ARCH_ARM64) && defined(USING_SIMULATOR)
91 lr = 0;
92 #elif defined(TARGET_ARCH_ARM)
93 lr = 0;
94 #elif defined(TARGET_ARCH_ARM64)
95 lr = 0;
96 #elif defined(TARGET_ARCH_MIPS)
97 lr = 0;
98 #else 90 #else
99 UNIMPLEMENTED(); 91 #error Unsupported architecture.
100 #endif // TARGET_ARCH_... 92 #endif // HOST_ARCH_...
101 93
102 return lr; 94 return lr;
103 } 95 }
104 96
105 97
106 void SignalHandler::InstallImpl(SignalAction action) { 98 void SignalHandler::InstallImpl(SignalAction action) {
107 struct sigaction act; 99 struct sigaction act;
108 act.sa_handler = NULL; 100 act.sa_handler = NULL;
109 act.sa_sigaction = action; 101 act.sa_sigaction = action;
110 sigemptyset(&act.sa_mask); 102 sigemptyset(&act.sa_mask);
(...skipping 11 matching lines...) Expand all
122 sigemptyset(&act.sa_mask); 114 sigemptyset(&act.sa_mask);
123 act.sa_flags = 0; 115 act.sa_flags = 0;
124 int r = sigaction(SIGPROF, &act, NULL); 116 int r = sigaction(SIGPROF, &act, NULL);
125 ASSERT(r == 0); 117 ASSERT(r == 0);
126 } 118 }
127 119
128 120
129 } // namespace dart 121 } // namespace dart
130 122
131 #endif // defined(TARGET_OS_MACOS) 123 #endif // defined(TARGET_OS_MACOS)
OLDNEW
« no previous file with comments | « runtime/vm/profiler.cc ('k') | runtime/vm/simulator_arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698