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

Unified Diff: runtime/vm/globals.h

Issue 1274663004: Enable native stack walking for allocation profiling (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 | « runtime/bin/bin.gypi ('k') | runtime/vm/profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/globals.h
diff --git a/runtime/vm/globals.h b/runtime/vm/globals.h
index 597756d82488e91a128a025571e954ec32fa0875..49d710d611cdf2529c31ce86d4831dd94bd59774 100644
--- a/runtime/vm/globals.h
+++ b/runtime/vm/globals.h
@@ -90,6 +90,37 @@ static const uword kZapUninitializedWord = 0xabababababababab;
#endif
+// Macros to get the contents of the fp register.
+#if defined(TARGET_OS_WINDOWS)
+
+#if defined(HOST_ARCH_IA32)
+#define COPY_FP_REGISTER(fp) __asm { movl fp, ebp }; // NOLINT
+#elif defined(HOST_ARCH_X64)
+#define COPY_FP_REGISTER(fp) __asm { movq fp, rbp }; // NOLINT
+#else
+#error Unknown host architecture.
+#endif
+
+#else // !defined(TARGET_OS_WINDOWS))
+
+// Assume GCC-like inline syntax is valid.
+#if defined(HOST_ARCH_IA32)
+#define COPY_FP_REGISTER(fp) asm volatile ("movl %%ebp, %0" : "=r" (fp) );
+#elif defined(HOST_ARCH_X64)
+#define COPY_FP_REGISTER(fp) asm volatile ("movq %%rbp, %0" : "=r" (fp) );
+#elif defined(HOST_ARCH_ARM)
+#define COPY_FP_REGISTER(fp) asm volatile ("mov %0, %%r11" : "=r" (fp) );
+#elif defined(HOST_ARCH_ARM64)
+#define COPY_FP_REGISTER(fp) asm volatile ("mov %0, %%x29" : "=r" (fp) );
+#elif defined(HOST_ARCH_MIPS)
+#define COPY_FP_REGISTER(fp) asm volatile ("move %0, %%r30" : "=r" (fp) );
+#else
+#error Unknown host architecture.
+#endif
+
+
+#endif // !defined(TARGET_OS_WINDOWS))
+
} // namespace dart
#endif // VM_GLOBALS_H_
« no previous file with comments | « runtime/bin/bin.gypi ('k') | runtime/vm/profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698