OLD | NEW |
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 #if defined(DARTINO_TARGET_OS_POSIX) | 5 #if defined(DARTINO_TARGET_OS_POSIX) |
6 | 6 |
7 #include "src/vm/tick_sampler.h" | 7 #include "src/vm/tick_sampler.h" |
8 | 8 |
9 #include <errno.h> | 9 #include <errno.h> |
10 #include <stdio.h> | 10 #include <stdio.h> |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 #elif defined(DARTINO_TARGET_X64) | 49 #elif defined(DARTINO_TARGET_X64) |
50 sample->pc = bit_cast<word>(mcontext.gregs[REG_RIP]); | 50 sample->pc = bit_cast<word>(mcontext.gregs[REG_RIP]); |
51 sample->sp = bit_cast<word>(mcontext.gregs[REG_RSP]); | 51 sample->sp = bit_cast<word>(mcontext.gregs[REG_RSP]); |
52 sample->fp = bit_cast<word>(mcontext.gregs[REG_RBP]); | 52 sample->fp = bit_cast<word>(mcontext.gregs[REG_RBP]); |
53 ip = bit_cast<word>(mcontext.gregs[REG_RSI]); | 53 ip = bit_cast<word>(mcontext.gregs[REG_RSI]); |
54 #elif defined(DARTINO_TARGET_ARM) | 54 #elif defined(DARTINO_TARGET_ARM) |
55 sample->pc = bit_cast<word>(mcontext.arm_pc); | 55 sample->pc = bit_cast<word>(mcontext.arm_pc); |
56 sample->sp = bit_cast<word>(mcontext.arm_sp); | 56 sample->sp = bit_cast<word>(mcontext.arm_sp); |
57 sample->fp = bit_cast<word>(mcontext.arm_fp); | 57 sample->fp = bit_cast<word>(mcontext.arm_fp); |
58 ip = bit_cast<word>(mcontext.arm_r5); | 58 ip = bit_cast<word>(mcontext.arm_r5); |
| 59 #elif defined(DARTINO_TARGET_MIPS) |
| 60 sample->pc = (word)mcontext.pc; |
| 61 sample->sp = (word)mcontext.gregs[29]; |
| 62 sample->fp = (word)mcontext.gregs[30]; |
| 63 ip = (word)mcontext.gregs[17]; |
59 #else | 64 #else |
60 FATAL("HandleSignal not support on this platform"); | 65 FATAL("HandleSignal not support on this platform"); |
61 #endif | 66 #endif |
62 #endif | 67 #endif |
63 #if defined(DARTINO_TARGET_OS_MACOS) | 68 #if defined(DARTINO_TARGET_OS_MACOS) |
64 #if defined(DARTINO_TARGET_IA32) | 69 #if defined(DARTINO_TARGET_IA32) |
65 sample->pc = bit_cast<word>(mcontext->__ss.__eip); | 70 sample->pc = bit_cast<word>(mcontext->__ss.__eip); |
66 sample->sp = bit_cast<word>(mcontext->__ss.__esp); | 71 sample->sp = bit_cast<word>(mcontext->__ss.__esp); |
67 sample->fp = bit_cast<word>(mcontext->__ss.__ebp); | 72 sample->fp = bit_cast<word>(mcontext->__ss.__ebp); |
68 ip = bit_cast<word>(mcontext->__ss.__esi); | 73 ip = bit_cast<word>(mcontext->__ss.__esi); |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 } | 231 } |
227 | 232 |
228 processor->Join(); | 233 processor->Join(); |
229 delete queue; | 234 delete queue; |
230 delete processor; | 235 delete processor; |
231 } | 236 } |
232 | 237 |
233 } // namespace dartino | 238 } // namespace dartino |
234 | 239 |
235 #endif // DARTINO_TARGET_OS_POSIX | 240 #endif // DARTINO_TARGET_OS_POSIX |
OLD | NEW |