void Logger::TickEvent(TickSample* sample, bool overflow) {
if (!Log::is_enabled() || !FLAG_prof) return;
LogMessageBuilder msg;
- msg.Append("tick,0x%x,0x%x,%d", sample->pc, sample->sp,
+ msg.Append("tick,0x%"V8PRIp",0x%"V8PRIp",%d", sample->pc, sample->sp,
static_cast<int>(sample->state));
if (overflow) {
msg.Append(",overflow");
sample.sp = mcontext.gregs[REG_ESP];
sample.fp = mcontext.gregs[REG_EBP];
#elif V8_HOST_ARCH_X64
- UNIMPLEMENTED();
sample.pc = mcontext.gregs[REG_RIP];
sample.sp = mcontext.gregs[REG_RSP];
sample.fp = mcontext.gregs[REG_RBP];
context.ContextFlags = CONTEXT_FULL;
GetThreadContext(profiled_thread_, &context);
// Invoke tick handler with program counter and stack pointer.
+#if V8_HOST_ARCH_X64
+ UNIMPLEMENTED();
+ sample.pc = context.Rip;
+ sample.sp = context.Rsp;
+ sample.fp = context.Rbp;
+#else
sample.pc = context.Eip;
sample.sp = context.Esp;
sample.fp = context.Ebp;
+#endif
}
// We always sample the VM state.
class TickSample {
public:
TickSample() : pc(0), sp(0), fp(0), state(OTHER) {}
- unsigned int pc; // Instruction pointer.
- unsigned int sp; // Stack pointer.
- unsigned int fp; // Frame pointer.
+ uintptr_t pc; // Instruction pointer.
+ uintptr_t sp; // Stack pointer.
+ uintptr_t fp; // Frame pointer.
StateTag state; // The state of the VM.
static const int kMaxFramesCount = 100;
EmbeddedVector<Address, kMaxFramesCount> stack; // Call stack.