X64: Changed TickSample to hold pointer-sized values for registers.

Review URL: http://codereview.chromium.org/113094


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1894 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
lrn@chromium.org 2009-05-07 09:34:16 +00:00
parent 8d57bc5ac4
commit 883b2826b9
4 changed files with 11 additions and 5 deletions

View File

@ -1072,7 +1072,7 @@ void Logger::DebugEvent(const char* event_type, Vector<uint16_t> parameter) {
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");

View File

@ -605,7 +605,6 @@ static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
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];

View File

@ -1775,9 +1775,16 @@ class Sampler::PlatformData : public Malloced {
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.

View File

@ -492,9 +492,9 @@ class Socket {
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.