Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1031)

Unified Diff: src/platform-linux.cc

Issue 109025: Have the profiler load the correct registers on x64. (Closed)
Patch Set: Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform-linux.cc
diff --git a/src/platform-linux.cc b/src/platform-linux.cc
index c735cebfcf593acce35b2427008063241be0fd1b..d9f8c9c24efe1e65d654d144cd07b1d9b56f903a 100644
--- a/src/platform-linux.cc
+++ b/src/platform-linux.cc
@@ -600,14 +600,18 @@ static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
// Extracting the sample from the context is extremely machine dependent.
ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context);
mcontext_t& mcontext = ucontext->uc_mcontext;
-#if defined(__arm__) || defined(__thumb__)
- sample.pc = mcontext.gregs[R15];
- sample.sp = mcontext.gregs[R13];
- sample.fp = mcontext.gregs[R11];
-#else
+#if V8_HOST_ARCH_X86
sample.pc = mcontext.gregs[REG_EIP];
sample.sp = mcontext.gregs[REG_ESP];
sample.fp = mcontext.gregs[REG_EBP];
+#elif V8_HOST_ARCH_X64
+ sample.pc = mcontext.gregs[REG_RIP];
Lasse Reichstein 2009/05/06 11:05:27 Does the assignment compile, and throw away the up
Dean McNamee 2009/05/06 11:07:15 It does compile, but I'll just do UNIMPLEMENTED :\
+ sample.sp = mcontext.gregs[REG_RSP];
+ sample.fp = mcontext.gregs[REG_RBP];
+#elif V8_HOST_ARCH_ARM
+ sample.pc = mcontext.gregs[R15];
+ sample.sp = mcontext.gregs[R13];
+ sample.fp = mcontext.gregs[R11];
#endif
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698