| Index: src/platform-solaris.cc
|
| diff --git a/src/platform-solaris.cc b/src/platform-solaris.cc
|
| index 6e02a25bcfd1133ccc88ba8ac7748a33f4f9afba..d1d9b2450f24cb18ac26350464e8613b716da68e 100644
|
| --- a/src/platform-solaris.cc
|
| +++ b/src/platform-solaris.cc
|
| @@ -54,6 +54,7 @@
|
|
|
| #include "platform-posix.h"
|
| #include "platform.h"
|
| +#include "simulator.h"
|
| #include "v8threads.h"
|
| #include "vm-state-inl.h"
|
|
|
| @@ -686,14 +687,37 @@ static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
|
| TickSample* sample = isolate->cpu_profiler()->TickSampleEvent();
|
| if (sample == NULL) sample = &sample_obj;
|
|
|
| +#if defined(USE_SIMULATOR)
|
| +#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS
|
| + Isolate::PerIsolateThreadData* per_thread_data =
|
| + isolate->FindPerThreadDataForThisThread();
|
| + if (!per_thread_data) return;
|
| + Simulator* sim = per_thread_data->simulator();
|
| + // Check if there is active simulator before allocating TickSample.
|
| + if (!sim) return;
|
| +#endif
|
| +#endif // USE_SIMULATOR
|
| +
|
| // Extracting the sample from the context is extremely machine dependent.
|
| ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context);
|
| mcontext_t& mcontext = ucontext->uc_mcontext;
|
| sample->state = isolate->current_vm_state();
|
|
|
| +#if defined(USE_SIMULATOR)
|
| +#if V8_TARGET_ARCH_ARM
|
| + sample->pc = reinterpret_cast<Address>(sim->get_register(Simulator::pc));
|
| + sample->sp = reinterpret_cast<Address>(sim->get_register(Simulator::sp));
|
| + sample->fp = reinterpret_cast<Address>(sim->get_register(Simulator::r11));
|
| +#elif V8_TARGET_ARCH_MIPS
|
| + sample->pc = reinterpret_cast<Address>(sim->get_register(Simulator::pc));
|
| + sample->sp = reinterpret_cast<Address>(sim->get_register(Simulator::sp));
|
| + sample->fp = reinterpret_cast<Address>(sim->get_register(Simulator::fp));
|
| +#endif
|
| +#else
|
| sample->pc = reinterpret_cast<Address>(mcontext.gregs[REG_PC]);
|
| sample->sp = reinterpret_cast<Address>(mcontext.gregs[REG_SP]);
|
| sample->fp = reinterpret_cast<Address>(mcontext.gregs[REG_FP]);
|
| +#endif // USE_SIMULATOR
|
|
|
| sampler->SampleStack(sample);
|
| sampler->Tick(sample);
|
|
|