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

Unified Diff: src/arm/cpu-arm.cc

Issue 986643004: Use a different variant of CpuFeatures::FlushICache asm with clang. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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/arm/cpu-arm.cc
diff --git a/src/arm/cpu-arm.cc b/src/arm/cpu-arm.cc
index 4a340708f9334faa7a59d127e9518067beca85e4..4bbfd375a8bd2465d1433c89e7163d45086e6489 100644
--- a/src/arm/cpu-arm.cc
+++ b/src/arm/cpu-arm.cc
@@ -45,6 +45,18 @@ void CpuFeatures::FlushICache(void* start, size_t size) {
register uint32_t end asm("r1") = beg + size;
register uint32_t flg asm("r2") = 0;
+#ifdef __clang__
+ // This variant of the asm avoids a constant pool entry, which can be
+ // problematic when LTO'ing. It is also slightly shorter.
+ register uint32_t scno asm("r7") = __ARM_NR_cacheflush;
bnoordhuis 2015/03/07 18:34:49 I don't think it's safe to assume that the compile
pcc1 2015/03/07 21:26:39 Please see https://gcc.gnu.org/onlinedocs/gcc/Loca
+
+ asm volatile("svc 0\n"
+ :
+ : "r"(beg), "r"(end), "r"(flg), "r"(scno)
+ : "memory");
+#else
+ // Use a different variant of the asm with GCC because some versions doesn't
+ // support r7 as an asm input.
asm volatile(
// This assembly works for both ARM and Thumb targets.
@@ -62,6 +74,7 @@ void CpuFeatures::FlushICache(void* start, size_t size) {
: "r" (beg), "r" (end), "r" (flg), [scno] "i" (__ARM_NR_cacheflush)
: "memory");
#endif
+#endif
}
} } // namespace v8::internal
« 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