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

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

Issue 583683002: Fixes for the profiler on arm64. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/signal_handler.h ('k') | runtime/vm/signal_handler_linux.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/simulator.h" 6 #include "vm/simulator.h"
7 #include "vm/signal_handler.h" 7 #include "vm/signal_handler.h"
8 #if defined(TARGET_OS_ANDROID) 8 #if defined(TARGET_OS_ANDROID)
9 9
10 namespace dart { 10 namespace dart {
(...skipping 20 matching lines...) Expand all
31 #elif defined(TARGET_ARCH_ARM64) 31 #elif defined(TARGET_ARCH_ARM64)
32 fp = static_cast<uintptr_t>(mcontext.regs[29]); 32 fp = static_cast<uintptr_t>(mcontext.regs[29]);
33 #else 33 #else
34 UNIMPLEMENTED(); 34 UNIMPLEMENTED();
35 #endif // TARGET_ARCH_... 35 #endif // TARGET_ARCH_...
36 36
37 return fp; 37 return fp;
38 } 38 }
39 39
40 40
41 uintptr_t SignalHandler::GetStackPointer(const mcontext_t& mcontext) { 41 uintptr_t SignalHandler::GetCStackPointer(const mcontext_t& mcontext) {
42 uintptr_t sp = 0; 42 uintptr_t sp = 0;
43 43
44 #if defined(TARGET_ARCH_ARM) 44 #if defined(TARGET_ARCH_ARM)
45 sp = static_cast<uintptr_t>(mcontext.arm_sp); 45 sp = static_cast<uintptr_t>(mcontext.arm_sp);
46 #elif defined(TARGET_ARCH_ARM64) 46 #elif defined(TARGET_ARCH_ARM64)
47 sp = static_cast<uintptr_t>(mcontext.sp); 47 sp = static_cast<uintptr_t>(mcontext.sp);
48 #else 48 #else
49 UNIMPLEMENTED(); 49 UNIMPLEMENTED();
50 #endif // TARGET_ARCH_... 50 #endif // TARGET_ARCH_...
51 return sp; 51 return sp;
52 } 52 }
53 53
54 54
55 uintptr_t SignalHandler::GetDartStackPointer(const mcontext_t& mcontext) {
56 uintptr_t sp = 0;
57
58 #if defined(TARGET_ARCH_ARM)
59 sp = static_cast<uintptr_t>(mcontext.arm_sp);
60 #elif defined(TARGET_ARCH_ARM64)
61 sp = static_cast<uintptr_t>(mcontext.regs[18]);
62 #else
63 UNIMPLEMENTED();
64 #endif // TARGET_ARCH_...
65 return sp;
66 }
67
68
55 void SignalHandler::Install(SignalAction action) { 69 void SignalHandler::Install(SignalAction action) {
56 struct sigaction act; 70 struct sigaction act;
57 memset(&act, 0, sizeof(act)); 71 memset(&act, 0, sizeof(act));
58 act.sa_sigaction = action; 72 act.sa_sigaction = action;
59 act.sa_flags = SA_RESTART | SA_SIGINFO; 73 act.sa_flags = SA_RESTART | SA_SIGINFO;
60 sigemptyset(&act.sa_mask); 74 sigemptyset(&act.sa_mask);
61 // TODO(johnmccutchan): Do we care about restoring the signal handler? 75 // TODO(johnmccutchan): Do we care about restoring the signal handler?
62 struct sigaction old_act; 76 struct sigaction old_act;
63 int r = sigaction(SIGPROF, &act, &old_act); 77 int r = sigaction(SIGPROF, &act, &old_act);
64 ASSERT(r == 0); 78 ASSERT(r == 0);
65 } 79 }
66 80
67 81
68 } // namespace dart 82 } // namespace dart
69 83
70 #endif // defined(TARGET_OS_ANDROID) 84 #endif // defined(TARGET_OS_ANDROID)
OLDNEW
« no previous file with comments | « runtime/vm/signal_handler.h ('k') | runtime/vm/signal_handler_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698