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

Side by Side Diff: runtime/vm/signal_handler_linux.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_android.cc ('k') | runtime/vm/signal_handler_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 "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_LINUX) 9 #if defined(TARGET_OS_LINUX)
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 sp = static_cast<uintptr_t>(mcontext.gregs[29]); 66 sp = static_cast<uintptr_t>(mcontext.gregs[29]);
66 #else 67 #else
67 #error Unsupported architecture. 68 #error Unsupported architecture.
68 #endif // HOST_ARCH_... 69 #endif // HOST_ARCH_...
69 return sp; 70 return sp;
70 } 71 }
71 72
72 73
73 uintptr_t SignalHandler::GetDartStackPointer(const mcontext_t& mcontext) { 74 uintptr_t SignalHandler::GetDartStackPointer(const mcontext_t& mcontext) {
74 #if defined(TARGET_ARCH_ARM64) && !defined(USING_SIMULATOR) 75 #if defined(TARGET_ARCH_ARM64) && !defined(USING_SIMULATOR)
75 return static_cast<uintptr_t>(mcontext.regs[19]); 76 return static_cast<uintptr_t>(mcontext.regs[SPREG]);
76 #else 77 #else
77 return GetCStackPointer(mcontext); 78 return GetCStackPointer(mcontext);
78 #endif 79 #endif
79 } 80 }
80 81
81 82
82 uintptr_t SignalHandler::GetLinkRegister(const mcontext_t& mcontext) { 83 uintptr_t SignalHandler::GetLinkRegister(const mcontext_t& mcontext) {
83 uintptr_t lr = 0; 84 uintptr_t lr = 0;
84 85
85 #if defined(HOST_ARCH_IA32) 86 #if defined(HOST_ARCH_IA32)
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 sigemptyset(&act.sa_mask); 119 sigemptyset(&act.sa_mask);
119 act.sa_flags = 0; 120 act.sa_flags = 0;
120 int r = sigaction(SIGPROF, &act, NULL); 121 int r = sigaction(SIGPROF, &act, NULL);
121 ASSERT(r == 0); 122 ASSERT(r == 0);
122 } 123 }
123 124
124 125
125 } // namespace dart 126 } // namespace dart
126 127
127 #endif // defined(TARGET_OS_LINUX) 128 #endif // defined(TARGET_OS_LINUX)
OLDNEW
« no previous file with comments | « runtime/vm/signal_handler_android.cc ('k') | runtime/vm/signal_handler_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698