Changeset 244506 in webkit


Ignore:
Timestamp:
Apr 22, 2019 11:35:04 AM (5 years ago)
Author:
ysuzuki@apple.com
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):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r244505 r244506  
     12019-04-22  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] Use volatile load to populate backing page in MarkedBlock::Footer instead of using holdLock
     4        https://bugs.webkit.org/show_bug.cgi?id=197152
     5
     6        Reviewed by Saam Barati.
     7
     8        Emit volatile load instead of using holdLock to populate backing page in MarkedBlock::Footer.
     9
     10        * heap/BlockDirectory.cpp:
     11        (JSC::BlockDirectory::isPagedOut):
     12        * heap/MarkedBlock.h:
     13        (JSC::MarkedBlock::populatePage const):
     14
    1152019-04-22  Yusuke Suzuki  <ysuzuki@apple.com>
    216
  • trunk/Source/JavaScriptCore/heap/BlockDirectory.cpp

    r244352 r244506  
    6262    unsigned itersSinceLastTimeCheck = 0;
    6363    for (auto* block : m_blocks) {
    64         if (block) {
    65             // We take and drop the lock as a way of touching that page of memory.
    66             // FIXME: should we instead do a cheaper thing like a volatile load in the page?
    67             (void) holdLock(block->block().lock());
    68         }
     64        if (block)
     65            block->block().populatePage();
    6966        ++itersSinceLastTimeCheck;
    7067        if (itersSinceLastTimeCheck >= Heap::s_timeCheckResolution) {
  • trunk/Source/JavaScriptCore/heap/MarkedBlock.h

    r243667 r244506  
    375375   
    376376    Subspace* subspace() const { return footer().m_subspace; }
     377
     378    void populatePage() const
     379    {
     380        *bitwise_cast<volatile uint8_t*>(&footer());
     381    }
    377382   
    378383    static constexpr size_t offsetOfFooter = endAtom * atomSize;
Note: See TracChangeset for help on using the changeset viewer.