Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 | 59 |
| 60 | 60 |
| 61 uintptr_t SignalHandler::GetDartStackPointer(const mcontext_t& mcontext) { | 61 uintptr_t SignalHandler::GetDartStackPointer(const mcontext_t& mcontext) { |
| 62 uintptr_t sp = 0; | 62 uintptr_t sp = 0; |
| 63 | 63 |
| 64 #if defined(HOST_ARCH_IA32) | 64 #if defined(HOST_ARCH_IA32) |
| 65 sp = static_cast<uintptr_t>(mcontext.gregs[REG_ESP]); | 65 sp = static_cast<uintptr_t>(mcontext.gregs[REG_ESP]); |
| 66 #elif defined(HOST_ARCH_ARM) | 66 #elif defined(HOST_ARCH_ARM) |
| 67 sp = static_cast<uintptr_t>(mcontext.arm_sp); | 67 sp = static_cast<uintptr_t>(mcontext.arm_sp); |
| 68 #elif defined(HOST_ARCH_ARM64) | 68 #elif defined(HOST_ARCH_ARM64) |
| 69 sp = static_cast<uintptr_t>(mcontext.regs[18]); | 69 sp = static_cast<uintptr_t>(mcontext.regs[19]); |
|
Cutch
2015/10/30 02:29:57
Could we add #define for the register in constants
rmacnak
2015/10/30 16:17:41
constants_??.h is included for the target architec
| |
| 70 #else | 70 #else |
| 71 #error Unsupported architecture. | 71 #error Unsupported architecture. |
| 72 #endif // HOST_ARCH_... | 72 #endif // HOST_ARCH_... |
| 73 return sp; | 73 return sp; |
| 74 } | 74 } |
| 75 | 75 |
| 76 | 76 |
| 77 uintptr_t SignalHandler::GetLinkRegister(const mcontext_t& mcontext) { | 77 uintptr_t SignalHandler::GetLinkRegister(const mcontext_t& mcontext) { |
| 78 uintptr_t lr = 0; | 78 uintptr_t lr = 0; |
| 79 | 79 |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 109 act.sa_handler = SIG_IGN; | 109 act.sa_handler = SIG_IGN; |
| 110 sigemptyset(&act.sa_mask); | 110 sigemptyset(&act.sa_mask); |
| 111 int r = sigaction(SIGPROF, &act, NULL); | 111 int r = sigaction(SIGPROF, &act, NULL); |
| 112 ASSERT(r == 0); | 112 ASSERT(r == 0); |
| 113 } | 113 } |
| 114 | 114 |
| 115 | 115 |
| 116 } // namespace dart | 116 } // namespace dart |
| 117 | 117 |
| 118 #endif // defined(TARGET_OS_ANDROID) | 118 #endif // defined(TARGET_OS_ANDROID) |
| OLD | NEW |