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

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..6903437dc707fe45cccfed490747c5ce974c2390 100644
--- a/runtime/vm/globals.h
+++ b/runtime/vm/globals.h
@@ -90,6 +90,44 @@ static const uword kZapUninitializedWord = 0xabababababababab;
#endif
+// Macros to get the contents of sp and fp registers.
+#if defined(TARGET_OS_WINDOWS)
+
+#if defined(TARGET_ARCH_IA32)
+#define COPY_SP_REGISTER(sp) UNIMPLEMENTED();
+#define COPY_FP_REGISTER(fp) UNIMPLEMENTED();
+#elif defined(TARGET_ARCH_X64)
+#define COPY_SP_REGISTER(sp) UNIMPLEMENTED();
+#define COPY_FP_REGISTER(fp) UNIMPLEMENTED();
+#else
+#error Unknown target architecture.
+#endif
+
+#else // !defined(TARGET_OS_WINDOWS))
+
+// Assume GCC-like inline syntax is valid.
+#if defined(TARGET_ARCH_IA32)
+#define COPY_SP_REGISTER(sp) asm volatile ("movl %%esp, %0" : "=r" (sp) );
+#define COPY_FP_REGISTER(fp) asm volatile ("movl %%ebp, %0" : "=r" (fp) );
+#elif defined(TARGET_ARCH_X64)
+#define COPY_SP_REGISTER(sp) asm volatile ("movq %%rsp, %0" : "=r" (sp) );
+#define COPY_FP_REGISTER(fp) asm volatile ("movq %%rbp, %0" : "=r" (fp) );
+#elif defined(TARGET_ARCH_ARM)
+#define COPY_SP_REGISTER(sp) UNIMPLEMENTED();
+#define COPY_FP_REGISTER(fp) UNIMPLEMENTED();
regis 2015/08/05 19:37:14 Not tested, but you can try: #define COPY_SP_REGIS
+#elif defined(TARGET_ARCH_ARM64)
+#define COPY_SP_REGISTER(sp) UNIMPLEMENTED();
+#define COPY_FP_REGISTER(fp) UNIMPLEMENTED();
regis 2015/08/05 19:37:14 Not tested, but you can try: #define COPY_SP_REGIS
+#elif defined(TARGET_ARCH_MIPS)
+#define COPY_SP_REGISTER(sp) UNIMPLEMENTED();
+#define COPY_FP_REGISTER(fp) UNIMPLEMENTED();
regis 2015/08/05 19:37:14 Not tested, but you can try: #define COPY_SP_REGIS
+#else
+#error Unknown target 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