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

Unified Diff: runtime/vm/profiler.cc

Issue 2513173002: Attempt to fix win64 test failures. (Closed)
Patch Set: Created 4 years, 1 month 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: runtime/vm/profiler.cc
diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc
index 2b0a7247c5a08038d2a7bdc80b98aa87e06d74a0..8cca1f131f5cce773a45a3547dea6df4426dad59 100644
--- a/runtime/vm/profiler.cc
+++ b/runtime/vm/profiler.cc
@@ -931,6 +931,27 @@ static uintptr_t __attribute__((noinline)) GetProgramCounter() {
#endif
+#if defined(TARGET_OS_WINDOWS)
+static uintptr_t GetFramePointer() {
+#if defined(HOST_ARCH_IA32)
+ uintptr_t fp = 0;
+ COPY_FP_REGISTER(fp);
+ return fp;
+#else
+ // We don't have the asm equivalent to get at the frame pointer on
+ // windows x64, return the stack pointer instead.
+ return Thread::GetCurrentStackPointer();
+#endif // defined(HOST_ARCH_IA32).
+}
+#else
+static uintptr_t GetFramePointer() {
+ uintptr_t fp = 0;
+ COPY_FP_REGISTER(fp);
+ return fp;
+}
+#endif // defined(TARGET_OS_WINDOWS).
+
+
void Profiler::DumpStackTrace() {
// Allow only one stack trace to prevent recursively printing stack traces if
// we hit an assert while printing the stack.
@@ -955,11 +976,8 @@ void Profiler::DumpStackTrace() {
OSThread::ThreadIdToIntPtr(os_thread->trace_id()));
uintptr_t sp = Thread::GetCurrentStackPointer();
- uintptr_t fp = 0;
+ uintptr_t fp = GetFramePointer();
uintptr_t pc = GetProgramCounter();
-
- COPY_FP_REGISTER(fp);
-
uword stack_lower = 0;
uword stack_upper = 0;
@@ -1000,11 +1018,8 @@ void Profiler::SampleAllocation(Thread* thread, intptr_t cid) {
}
uintptr_t sp = Thread::GetCurrentStackPointer();
- uintptr_t fp = 0;
+ uintptr_t fp = GetFramePointer();
uintptr_t pc = GetProgramCounter();
-
- COPY_FP_REGISTER(fp);
-
uword stack_lower = 0;
uword stack_upper = 0;
« 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