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

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

Issue 2184903002: Fix profiler access to the Dart stack pointer on ARM64. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/dart-lang/sdk.git@master
Patch Set: SPREG 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/signal_handler_linux.cc ('k') | no next file » | 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/simulator.h" 7 #include "vm/simulator.h"
7 #include "vm/signal_handler.h" 8 #include "vm/signal_handler.h"
8 #if defined(TARGET_OS_MACOS) 9 #if defined(TARGET_OS_MACOS)
9 10
10 namespace dart { 11 namespace dart {
11 12
12 uintptr_t SignalHandler::GetProgramCounter(const mcontext_t& mcontext) { 13 uintptr_t SignalHandler::GetProgramCounter(const mcontext_t& mcontext) {
13 uintptr_t pc = 0; 14 uintptr_t pc = 0;
14 15
15 #if defined(HOST_ARCH_IA32) 16 #if defined(HOST_ARCH_IA32)
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 #else 62 #else
62 UNIMPLEMENTED(); 63 UNIMPLEMENTED();
63 #endif // HOST_ARCH_... 64 #endif // HOST_ARCH_...
64 65
65 return sp; 66 return sp;
66 } 67 }
67 68
68 69
69 uintptr_t SignalHandler::GetDartStackPointer(const mcontext_t& mcontext) { 70 uintptr_t SignalHandler::GetDartStackPointer(const mcontext_t& mcontext) {
70 #if defined(TARGET_ARCH_ARM64) && !defined(USING_SIMULATOR) 71 #if defined(TARGET_ARCH_ARM64) && !defined(USING_SIMULATOR)
71 return static_cast<uintptr_t>(mcontext->__ss.__x[19]); 72 return static_cast<uintptr_t>(mcontext->__ss.__x[SPREG]);
72 #else 73 #else
73 return GetCStackPointer(mcontext); 74 return GetCStackPointer(mcontext);
74 #endif 75 #endif
75 } 76 }
76 77
77 78
78 uintptr_t SignalHandler::GetLinkRegister(const mcontext_t& mcontext) { 79 uintptr_t SignalHandler::GetLinkRegister(const mcontext_t& mcontext) {
79 uintptr_t lr = 0; 80 uintptr_t lr = 0;
80 81
81 #if defined(TARGET_ARCH_IA32) 82 #if defined(TARGET_ARCH_IA32)
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 sigemptyset(&act.sa_mask); 122 sigemptyset(&act.sa_mask);
122 act.sa_flags = 0; 123 act.sa_flags = 0;
123 int r = sigaction(SIGPROF, &act, NULL); 124 int r = sigaction(SIGPROF, &act, NULL);
124 ASSERT(r == 0); 125 ASSERT(r == 0);
125 } 126 }
126 127
127 128
128 } // namespace dart 129 } // namespace dart
129 130
130 #endif // defined(TARGET_OS_MACOS) 131 #endif // defined(TARGET_OS_MACOS)
OLDNEW
« no previous file with comments | « runtime/vm/signal_handler_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698