Title: [151381] releases/WebKitGTK/webkit-2.0/Source/_javascript_Core
Revision
151381
Author
[email protected]
Date
2013-06-10 04:33:50 -0700 (Mon, 10 Jun 2013)

Log Message

Merge r149114 - REGRESSION(r137994): Random crashes occur with SH4 JSC.
https://bugs.webkit.org/show_bug.cgi?id=115167.

Patch by Julien Brianceau <[email protected]> on 2013-04-25
Reviewed by Oliver Hunt.

Since r137994, uncommited pages could be inside the area of memory in
parameter of the cacheFlush function. That's why we have to flush each
page separately to avoid a fail of the whole flush, if an uncommited page
is in the area.

This patch is very similar to changeset 145194 made for ARMv7 architecture,
see https://bugs.webkit.org/show_bug.cgi?id=111441 for further information.

* assembler/SH4Assembler.h:
(JSC::SH4Assembler::cacheFlush):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.0/Source/_javascript_Core/ChangeLog (151380 => 151381)


--- releases/WebKitGTK/webkit-2.0/Source/_javascript_Core/ChangeLog	2013-06-10 11:25:17 UTC (rev 151380)
+++ releases/WebKitGTK/webkit-2.0/Source/_javascript_Core/ChangeLog	2013-06-10 11:33:50 UTC (rev 151381)
@@ -1,3 +1,21 @@
+2013-04-25  Julien Brianceau  <[email protected]>
+
+        REGRESSION(r137994): Random crashes occur with SH4 JSC.
+        https://bugs.webkit.org/show_bug.cgi?id=115167.
+
+        Reviewed by Oliver Hunt.
+
+        Since r137994, uncommited pages could be inside the area of memory in
+        parameter of the cacheFlush function. That's why we have to flush each
+        page separately to avoid a fail of the whole flush, if an uncommited page
+        is in the area.
+
+        This patch is very similar to changeset 145194 made for ARMv7 architecture,
+        see https://bugs.webkit.org/show_bug.cgi?id=111441 for further information.
+
+        * assembler/SH4Assembler.h:
+        (JSC::SH4Assembler::cacheFlush):
+
 2013-03-08  Gabor Rapcsanyi  <[email protected]>
 
         Cache flush problem on ARMv7 JSC

Modified: releases/WebKitGTK/webkit-2.0/Source/_javascript_Core/assembler/SH4Assembler.h (151380 => 151381)


--- releases/WebKitGTK/webkit-2.0/Source/_javascript_Core/assembler/SH4Assembler.h	2013-06-10 11:25:17 UTC (rev 151380)
+++ releases/WebKitGTK/webkit-2.0/Source/_javascript_Core/assembler/SH4Assembler.h	2013-06-10 11:33:50 UTC (rev 151381)
@@ -1582,13 +1582,21 @@
 
     static void cacheFlush(void* code, size_t size)
     {
-#if !OS(LINUX)
-#error "The cacheFlush support is missing on this platform."
-#elif defined CACHEFLUSH_D_L2
-        syscall(__NR_cacheflush, reinterpret_cast<unsigned>(code), size, CACHEFLUSH_D_WB | CACHEFLUSH_I | CACHEFLUSH_D_L2);
+#if OS(LINUX)
+        // Flush each page separately, otherwise the whole flush will fail if an uncommited page is in the area.
+        unsigned currentPage = reinterpret_cast<unsigned>(code) & ~(pageSize() - 1);
+        unsigned lastPage = (reinterpret_cast<unsigned>(code) + size) & ~(pageSize() - 1);
+        do {
+#if defined CACHEFLUSH_D_L2
+            syscall(__NR_cacheflush, currentPage, pageSize(), CACHEFLUSH_D_WB | CACHEFLUSH_I | CACHEFLUSH_D_L2);
 #else
-        syscall(__NR_cacheflush, reinterpret_cast<unsigned>(code), size, CACHEFLUSH_D_WB | CACHEFLUSH_I);
+            syscall(__NR_cacheflush, currentPage, pageSize(), CACHEFLUSH_D_WB | CACHEFLUSH_I);
 #endif
+            currentPage += pageSize();
+        } while (lastPage >= currentPage);
+#else
+#error "The cacheFlush support is missing on this platform."
+#endif
     }
 
     void prefix(uint16_t pre)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to