- Revision
- 145194
- Author
- rga...@webkit.org
- Date
- 2013-03-08 01:27:38 -0800 (Fri, 08 Mar 2013)
Log Message
Cache flush problem on ARMv7 JSC
https://bugs.webkit.org/show_bug.cgi?id=111441
Reviewed by Zoltan Herczeg.
Not proper cache flush causing random crashes on ARMv7 Linux with V8 tests.
The problem is similar to https://bugs.webkit.org/show_bug.cgi?id=77712.
Change the cache fulsh mechanism similar to ARM traditinal and revert the
temporary fix.
Source/_javascript_Core:
* assembler/ARMv7Assembler.h:
(JSC::ARMv7Assembler::cacheFlush):
Source/WTF:
* wtf/OSAllocatorPosix.cpp:
(WTF::OSAllocator::reserveUncommitted):
(WTF::OSAllocator::decommit):
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (145193 => 145194)
--- trunk/Source/_javascript_Core/ChangeLog 2013-03-08 09:21:24 UTC (rev 145193)
+++ trunk/Source/_javascript_Core/ChangeLog 2013-03-08 09:27:38 UTC (rev 145194)
@@ -1,3 +1,18 @@
+2013-03-08 Gabor Rapcsanyi <rga...@webkit.org>
+
+ Cache flush problem on ARMv7 JSC
+ https://bugs.webkit.org/show_bug.cgi?id=111441
+
+ Reviewed by Zoltan Herczeg.
+
+ Not proper cache flush causing random crashes on ARMv7 Linux with V8 tests.
+ The problem is similar to https://bugs.webkit.org/show_bug.cgi?id=77712.
+ Change the cache fulsh mechanism similar to ARM traditinal and revert the
+ temporary fix.
+
+ * assembler/ARMv7Assembler.h:
+ (JSC::ARMv7Assembler::cacheFlush):
+
2013-03-07 Geoffrey Garen <gga...@apple.com>
REGRESSION (r143759): 40% JSBench regression, 20% Octane/closure regression, 40% Octane/jquery regression, 2% Octane regression
Modified: trunk/Source/_javascript_Core/assembler/ARMv7Assembler.h (145193 => 145194)
--- trunk/Source/_javascript_Core/assembler/ARMv7Assembler.h 2013-03-08 09:21:24 UTC (rev 145193)
+++ trunk/Source/_javascript_Core/assembler/ARMv7Assembler.h 2013-03-08 09:27:38 UTC (rev 145194)
@@ -2218,18 +2218,23 @@
#if OS(IOS)
sys_cache_control(kCacheFunctionPrepareForExecution, code, size);
#elif OS(LINUX)
- asm volatile(
- "push {r7}\n"
- "mov r0, %0\n"
- "mov r1, %1\n"
- "movw r7, #0x2\n"
- "movt r7, #0xf\n"
- "movs r2, #0x0\n"
- "svc 0x0\n"
- "pop {r7}\n"
- :
- : "r" (code), "r" (reinterpret_cast<char*>(code) + size)
- : "r0", "r1", "r2");
+ uintptr_t currentPage = reinterpret_cast<uintptr_t>(code) & ~(pageSize() - 1);
+ uintptr_t lastPage = (reinterpret_cast<uintptr_t>(code) + size) & ~(pageSize() - 1);
+ do {
+ asm volatile(
+ "push {r7}\n"
+ "mov r0, %0\n"
+ "mov r1, %1\n"
+ "movw r7, #0x2\n"
+ "movt r7, #0xf\n"
+ "movs r2, #0x0\n"
+ "svc 0x0\n"
+ "pop {r7}\n"
+ :
+ : "r" (currentPage), "r" (currentPage + pageSize())
+ : "r0", "r1", "r2");
+ currentPage += pageSize();
+ } while (lastPage >= currentPage);
#elif OS(WINCE)
CacheRangeFlush(code, size, CACHE_SYNC_ALL);
#elif OS(QNX)
Modified: trunk/Source/WTF/ChangeLog (145193 => 145194)
--- trunk/Source/WTF/ChangeLog 2013-03-08 09:21:24 UTC (rev 145193)
+++ trunk/Source/WTF/ChangeLog 2013-03-08 09:27:38 UTC (rev 145194)
@@ -1,3 +1,19 @@
+2013-03-08 Gabor Rapcsanyi <rga...@webkit.org>
+
+ Cache flush problem on ARMv7 JSC
+ https://bugs.webkit.org/show_bug.cgi?id=111441
+
+ Reviewed by Zoltan Herczeg.
+
+ Not proper cache flush causing random crashes on ARMv7 Linux with V8 tests.
+ The problem is similar to https://bugs.webkit.org/show_bug.cgi?id=77712.
+ Change the cache fulsh mechanism similar to ARM traditinal and revert the
+ temporary fix.
+
+ * wtf/OSAllocatorPosix.cpp:
+ (WTF::OSAllocator::reserveUncommitted):
+ (WTF::OSAllocator::decommit):
+
2013-03-07 Andrew Bortz <and...@abortz.net>
Replace Mersenne Twister random number generator with a simpler one.
Modified: trunk/Source/WTF/wtf/OSAllocatorPosix.cpp (145193 => 145194)
--- trunk/Source/WTF/wtf/OSAllocatorPosix.cpp 2013-03-08 09:21:24 UTC (rev 145193)
+++ trunk/Source/WTF/wtf/OSAllocatorPosix.cpp 2013-03-08 09:27:38 UTC (rev 145194)
@@ -43,7 +43,7 @@
void* result = mmap(0, bytes, PROT_NONE, MAP_LAZY | MAP_PRIVATE | MAP_ANON, -1, 0);
if (result == MAP_FAILED)
CRASH();
-#elif OS(LINUX) && !CPU(ARM)
+#elif OS(LINUX)
UNUSED_PARAM(usage);
UNUSED_PARAM(writable);
UNUSED_PARAM(executable);
@@ -165,7 +165,7 @@
#if OS(QNX)
// Use PROT_NONE and MAP_LAZY to decommit the pages.
mmap(address, bytes, PROT_NONE, MAP_FIXED | MAP_LAZY | MAP_PRIVATE | MAP_ANON, -1, 0);
-#elif OS(LINUX) && !CPU(ARM)
+#elif OS(LINUX)
madvise(address, bytes, MADV_DONTNEED);
if (mprotect(address, bytes, PROT_NONE))
CRASH();