OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/sampler.h" | 5 #include "src/sampler.h" |
6 | 6 |
7 #if V8_OS_POSIX && !V8_OS_CYGWIN | 7 #if V8_OS_POSIX && !V8_OS_CYGWIN |
8 | 8 |
9 #define USE_SIGNALS | 9 #define USE_SIGNALS |
10 | 10 |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 } | 249 } |
250 state->pc = reinterpret_cast<Address>(simulator_->pc()); | 250 state->pc = reinterpret_cast<Address>(simulator_->pc()); |
251 state->sp = reinterpret_cast<Address>(simulator_->sp()); | 251 state->sp = reinterpret_cast<Address>(simulator_->sp()); |
252 state->fp = reinterpret_cast<Address>(simulator_->fp()); | 252 state->fp = reinterpret_cast<Address>(simulator_->fp()); |
253 #elif V8_TARGET_ARCH_MIPS | 253 #elif V8_TARGET_ARCH_MIPS |
254 state->pc = reinterpret_cast<Address>(simulator_->get_pc()); | 254 state->pc = reinterpret_cast<Address>(simulator_->get_pc()); |
255 state->sp = reinterpret_cast<Address>(simulator_->get_register( | 255 state->sp = reinterpret_cast<Address>(simulator_->get_register( |
256 Simulator::sp)); | 256 Simulator::sp)); |
257 state->fp = reinterpret_cast<Address>(simulator_->get_register( | 257 state->fp = reinterpret_cast<Address>(simulator_->get_register( |
258 Simulator::fp)); | 258 Simulator::fp)); |
| 259 #elif V8_TARGET_ARCH_MIPS64 |
| 260 state->pc = reinterpret_cast<Address>(simulator_->get_pc()); |
| 261 state->sp = reinterpret_cast<Address>(simulator_->get_register( |
| 262 Simulator::sp)); |
| 263 state->fp = reinterpret_cast<Address>(simulator_->get_register( |
| 264 Simulator::fp)); |
259 #endif | 265 #endif |
260 } | 266 } |
261 | 267 |
262 private: | 268 private: |
263 Simulator* simulator_; | 269 Simulator* simulator_; |
264 }; | 270 }; |
265 #endif // USE_SIMULATOR | 271 #endif // USE_SIMULATOR |
266 | 272 |
267 | 273 |
268 #if defined(USE_SIGNALS) | 274 #if defined(USE_SIGNALS) |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 // (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3)) | 392 // (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3)) |
387 #elif V8_HOST_ARCH_ARM64 | 393 #elif V8_HOST_ARCH_ARM64 |
388 state.pc = reinterpret_cast<Address>(mcontext.pc); | 394 state.pc = reinterpret_cast<Address>(mcontext.pc); |
389 state.sp = reinterpret_cast<Address>(mcontext.sp); | 395 state.sp = reinterpret_cast<Address>(mcontext.sp); |
390 // FP is an alias for x29. | 396 // FP is an alias for x29. |
391 state.fp = reinterpret_cast<Address>(mcontext.regs[29]); | 397 state.fp = reinterpret_cast<Address>(mcontext.regs[29]); |
392 #elif V8_HOST_ARCH_MIPS | 398 #elif V8_HOST_ARCH_MIPS |
393 state.pc = reinterpret_cast<Address>(mcontext.pc); | 399 state.pc = reinterpret_cast<Address>(mcontext.pc); |
394 state.sp = reinterpret_cast<Address>(mcontext.gregs[29]); | 400 state.sp = reinterpret_cast<Address>(mcontext.gregs[29]); |
395 state.fp = reinterpret_cast<Address>(mcontext.gregs[30]); | 401 state.fp = reinterpret_cast<Address>(mcontext.gregs[30]); |
| 402 #elif V8_HOST_ARCH_MIPS64 |
| 403 state.pc = reinterpret_cast<Address>(mcontext.pc); |
| 404 state.sp = reinterpret_cast<Address>(mcontext.gregs[29]); |
| 405 state.fp = reinterpret_cast<Address>(mcontext.gregs[30]); |
396 #endif // V8_HOST_ARCH_* | 406 #endif // V8_HOST_ARCH_* |
397 #elif V8_OS_MACOSX | 407 #elif V8_OS_MACOSX |
398 #if V8_HOST_ARCH_X64 | 408 #if V8_HOST_ARCH_X64 |
399 #if __DARWIN_UNIX03 | 409 #if __DARWIN_UNIX03 |
400 state.pc = reinterpret_cast<Address>(mcontext->__ss.__rip); | 410 state.pc = reinterpret_cast<Address>(mcontext->__ss.__rip); |
401 state.sp = reinterpret_cast<Address>(mcontext->__ss.__rsp); | 411 state.sp = reinterpret_cast<Address>(mcontext->__ss.__rsp); |
402 state.fp = reinterpret_cast<Address>(mcontext->__ss.__rbp); | 412 state.fp = reinterpret_cast<Address>(mcontext->__ss.__rbp); |
403 #else // !__DARWIN_UNIX03 | 413 #else // !__DARWIN_UNIX03 |
404 state.pc = reinterpret_cast<Address>(mcontext->ss.rip); | 414 state.pc = reinterpret_cast<Address>(mcontext->ss.rip); |
405 state.sp = reinterpret_cast<Address>(mcontext->ss.rsp); | 415 state.sp = reinterpret_cast<Address>(mcontext->ss.rsp); |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 #endif // USE_SIMULATOR | 738 #endif // USE_SIMULATOR |
729 SampleStack(state); | 739 SampleStack(state); |
730 } | 740 } |
731 ResumeThread(profiled_thread); | 741 ResumeThread(profiled_thread); |
732 } | 742 } |
733 | 743 |
734 #endif // USE_SIGNALS | 744 #endif // USE_SIGNALS |
735 | 745 |
736 | 746 |
737 } } // namespace v8::internal | 747 } } // namespace v8::internal |
OLD | NEW |