Title: [244506] trunk/Source/_javascript_Core
Revision
244506
Author
ysuz...@apple.com
Date
2019-04-22 11:35:04 -0700 (Mon, 22 Apr 2019)

Log Message

[JSC] Use volatile load to populate backing page in MarkedBlock::Footer instead of using holdLock
https://bugs.webkit.org/show_bug.cgi?id=197152

Reviewed by Saam Barati.

Emit volatile load instead of using holdLock to populate backing page in MarkedBlock::Footer.

* heap/BlockDirectory.cpp:
(JSC::BlockDirectory::isPagedOut):
* heap/MarkedBlock.h:
(JSC::MarkedBlock::populatePage const):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (244505 => 244506)


--- trunk/Source/_javascript_Core/ChangeLog	2019-04-22 18:30:16 UTC (rev 244505)
+++ trunk/Source/_javascript_Core/ChangeLog	2019-04-22 18:35:04 UTC (rev 244506)
@@ -1,5 +1,19 @@
 2019-04-22  Yusuke Suzuki  <ysuz...@apple.com>
 
+        [JSC] Use volatile load to populate backing page in MarkedBlock::Footer instead of using holdLock
+        https://bugs.webkit.org/show_bug.cgi?id=197152
+
+        Reviewed by Saam Barati.
+
+        Emit volatile load instead of using holdLock to populate backing page in MarkedBlock::Footer.
+
+        * heap/BlockDirectory.cpp:
+        (JSC::BlockDirectory::isPagedOut):
+        * heap/MarkedBlock.h:
+        (JSC::MarkedBlock::populatePage const):
+
+2019-04-22  Yusuke Suzuki  <ysuz...@apple.com>
+
         [JSC] useJIT should subsume useRegExpJIT
         https://bugs.webkit.org/show_bug.cgi?id=197153
 

Modified: trunk/Source/_javascript_Core/heap/BlockDirectory.cpp (244505 => 244506)


--- trunk/Source/_javascript_Core/heap/BlockDirectory.cpp	2019-04-22 18:30:16 UTC (rev 244505)
+++ trunk/Source/_javascript_Core/heap/BlockDirectory.cpp	2019-04-22 18:35:04 UTC (rev 244506)
@@ -61,11 +61,8 @@
 {
     unsigned itersSinceLastTimeCheck = 0;
     for (auto* block : m_blocks) {
-        if (block) {
-            // We take and drop the lock as a way of touching that page of memory.
-            // FIXME: should we instead do a cheaper thing like a volatile load in the page?
-            (void) holdLock(block->block().lock());
-        }
+        if (block)
+            block->block().populatePage();
         ++itersSinceLastTimeCheck;
         if (itersSinceLastTimeCheck >= Heap::s_timeCheckResolution) {
             MonotonicTime currentTime = MonotonicTime::now();

Modified: trunk/Source/_javascript_Core/heap/MarkedBlock.h (244505 => 244506)


--- trunk/Source/_javascript_Core/heap/MarkedBlock.h	2019-04-22 18:30:16 UTC (rev 244505)
+++ trunk/Source/_javascript_Core/heap/MarkedBlock.h	2019-04-22 18:35:04 UTC (rev 244506)
@@ -374,6 +374,11 @@
     CountingLock& lock() { return footer().m_lock; }
     
     Subspace* subspace() const { return footer().m_subspace; }
+
+    void populatePage() const
+    {
+        *bitwise_cast<volatile uint8_t*>(&footer());
+    }
     
     static constexpr size_t offsetOfFooter = endAtom * atomSize;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to