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/profiler/sampler.h" | 5 #include "src/profiler/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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 | 327 |
328 private: | 328 private: |
329 HANDLE profiled_thread_; | 329 HANDLE profiled_thread_; |
330 }; | 330 }; |
331 #endif | 331 #endif |
332 | 332 |
333 | 333 |
334 #if defined(USE_SIMULATOR) | 334 #if defined(USE_SIMULATOR) |
335 bool SimulatorHelper::FillRegisters(Isolate* isolate, | 335 bool SimulatorHelper::FillRegisters(Isolate* isolate, |
336 v8::RegisterState* state) { | 336 v8::RegisterState* state) { |
337 Simulator *simulator = isolate->thread_local_top()->simulator_; | 337 Simulator* simulator = isolate->thread_local_top()->simulator_; |
338 // Check if there is active simulator. | 338 // Check if there is active simulator. |
339 if (simulator == NULL) return false; | 339 if (simulator == NULL) return false; |
340 #if V8_TARGET_ARCH_ARM | 340 #if V8_TARGET_ARCH_ARM |
341 if (!simulator->has_bad_pc()) { | 341 if (!simulator->has_bad_pc()) { |
342 state->pc = reinterpret_cast<Address>(simulator->get_pc()); | 342 state->pc = reinterpret_cast<Address>(simulator->get_pc()); |
343 } | 343 } |
344 state->sp = reinterpret_cast<Address>(simulator->get_register(Simulator::sp)); | 344 state->sp = reinterpret_cast<Address>(simulator->get_register(Simulator::sp)); |
345 state->fp = reinterpret_cast<Address>(simulator->get_register( | 345 state->fp = |
346 Simulator::r11)); | 346 reinterpret_cast<Address>(simulator->get_register(Simulator::r11)); |
347 #elif V8_TARGET_ARCH_ARM64 | 347 #elif V8_TARGET_ARCH_ARM64 |
348 state->pc = reinterpret_cast<Address>(simulator->pc()); | 348 state->pc = reinterpret_cast<Address>(simulator->pc()); |
349 state->sp = reinterpret_cast<Address>(simulator->sp()); | 349 state->sp = reinterpret_cast<Address>(simulator->sp()); |
350 state->fp = reinterpret_cast<Address>(simulator->fp()); | 350 state->fp = reinterpret_cast<Address>(simulator->fp()); |
351 #elif V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 | 351 #elif V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 |
352 if (!simulator->has_bad_pc()) { | 352 if (!simulator->has_bad_pc()) { |
353 state->pc = reinterpret_cast<Address>(simulator->get_pc()); | 353 state->pc = reinterpret_cast<Address>(simulator->get_pc()); |
354 } | 354 } |
355 state->sp = reinterpret_cast<Address>(simulator->get_register(Simulator::sp)); | 355 state->sp = reinterpret_cast<Address>(simulator->get_register(Simulator::sp)); |
356 state->fp = reinterpret_cast<Address>(simulator->get_register(Simulator::fp)); | 356 state->fp = reinterpret_cast<Address>(simulator->get_register(Simulator::fp)); |
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 SampleStack(state); | 1030 SampleStack(state); |
1031 } | 1031 } |
1032 ResumeThread(profiled_thread); | 1032 ResumeThread(profiled_thread); |
1033 } | 1033 } |
1034 | 1034 |
1035 #endif // USE_SIGNALS | 1035 #endif // USE_SIGNALS |
1036 | 1036 |
1037 | 1037 |
1038 } // namespace internal | 1038 } // namespace internal |
1039 } // namespace v8 | 1039 } // namespace v8 |
OLD | NEW |