Author: [email protected]
Date: Thu May 7 02:34:16 2009
New Revision: 1894
Modified:
branches/bleeding_edge/src/log.cc
branches/bleeding_edge/src/platform-linux.cc
branches/bleeding_edge/src/platform-win32.cc
branches/bleeding_edge/src/platform.h
Log:
X64: Changed TickSample to hold pointer-sized values for registers.
Review URL: http://codereview.chromium.org/113094
Modified: branches/bleeding_edge/src/log.cc
==============================================================================
--- branches/bleeding_edge/src/log.cc (original)
+++ branches/bleeding_edge/src/log.cc Thu May 7 02:34:16 2009
@@ -1072,7 +1072,7 @@
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");
Modified: branches/bleeding_edge/src/platform-linux.cc
==============================================================================
--- branches/bleeding_edge/src/platform-linux.cc (original)
+++ branches/bleeding_edge/src/platform-linux.cc Thu May 7 02:34:16 2009
@@ -605,7 +605,6 @@
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];
Modified: branches/bleeding_edge/src/platform-win32.cc
==============================================================================
--- branches/bleeding_edge/src/platform-win32.cc (original)
+++ branches/bleeding_edge/src/platform-win32.cc Thu May 7 02:34:16 2009
@@ -1775,9 +1775,16 @@
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.
Modified: branches/bleeding_edge/src/platform.h
==============================================================================
--- branches/bleeding_edge/src/platform.h (original)
+++ branches/bleeding_edge/src/platform.h Thu May 7 02:34:16 2009
@@ -492,9 +492,9 @@
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.
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---