X64: Changed TickSample to hold pointer-sized values for registers.
authorlrn@chromium.org <lrn@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 7 May 2009 09:34:16 +0000 (09:34 +0000)
committerlrn@chromium.org <lrn@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 7 May 2009 09:34:16 +0000 (09:34 +0000)
Review URL: http://codereview.chromium.org/113094

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1894 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/log.cc
src/platform-linux.cc
src/platform-win32.cc
src/platform.h

index b5ea33c..6047a58 100644 (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");
index 026d251..c02eebc 100644 (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];
index 597a217..6c4e67a 100644 (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.
index a346615..e23abfc 100644 (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.