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

Unified Diff: runtime/vm/globals.h

Issue 2829913002: Use __builtin_frame_address instead of inline assembly on non-Windows platforms. (Closed)
Patch Set: . Created 3 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: runtime/vm/globals.h
diff --git a/runtime/vm/globals.h b/runtime/vm/globals.h
index 7f72f41f5b7dfc26c0fdbffbc923b73bc759259b..f07576fcdb66579924737f92f5272f12dfc5718a 100644
--- a/runtime/vm/globals.h
+++ b/runtime/vm/globals.h
@@ -116,24 +116,9 @@ static const uword kZapUninitializedWord = 0xabababababababab;
#else // !defined(HOST_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)
-#if defined(HOST_OS_MAC)
-#define COPY_FP_REGISTER(fp) asm volatile("mov %0, r7" : "=r"(fp));
-#else
-#define COPY_FP_REGISTER(fp) asm volatile("mov %0, r11" : "=r"(fp));
-#endif
-#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, $fp" : "=r"(fp));
-#else
-#error Unknown host architecture.
-#endif
+// Assume GCC-compatible builtins.
+#define COPY_FP_REGISTER(fp) \
+ fp = reinterpret_cast<uintptr_t>(__builtin_frame_address(0));
#endif // !defined(HOST_OS_WINDOWS))
« 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