⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 259602 in webkit


Ignore:
Timestamp:
Apr 6, 2020, 4:05:18 PM (6 years ago)
Author:
Alan Coon
Message:

Cherry-pick r259424. rdar://problem/61352472

[JSC] RecordedStatuses's assignment should be guarded by CodeBlock's lock
https://bugs.webkit.org/show_bug.cgi?id=209935
<rdar://problem/59443383>

Reviewed by Mark Lam.

Previously RecordedStatuses are not touched by GC. But now, GC visits RecordedStatuses.
This means that modifying RecordedStatuses should be guarded by CodeBlock's lock if
it is reachable from CodeBlock.
In DFG::Plan::reallyAdd, we already installed DFG::JITCode into the CodeBlock so that
RecordedStatuses is reachable from CodeBlock. We should lock CodeBlock's lock while
performing WTFMove(RecordedStatuses).

We do not need to emit write-barrier here because (1) DFG::Plan::reallyAdd is executed
while GC is deferred and (2) we emit write-barrier to CodeBlock before deferred GC is executed.

  • dfg/DFGPlan.cpp: (JSC::DFG::Plan::reallyAdd):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259424 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-609-branch/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-609-branch/Source/JavaScriptCore/ChangeLog

    r259600 r259602  
     12020-04-06  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r259424. rdar://problem/61352472
     4
     5    [JSC] RecordedStatuses's assignment should be guarded by CodeBlock's lock
     6    https://bugs.webkit.org/show_bug.cgi?id=209935
     7    <rdar://problem/59443383>
     8   
     9    Reviewed by Mark Lam.
     10   
     11    Previously RecordedStatuses are not touched by GC. But now, GC visits RecordedStatuses.
     12    This means that modifying RecordedStatuses should be guarded by CodeBlock's lock if
     13    it is reachable from CodeBlock.
     14    In DFG::Plan::reallyAdd, we already installed DFG::JITCode into the CodeBlock so that
     15    RecordedStatuses is reachable from CodeBlock. We should lock CodeBlock's lock while
     16    performing `WTFMove(RecordedStatuses)`.
     17   
     18    We do not need to emit write-barrier here because (1) DFG::Plan::reallyAdd is executed
     19    while GC is deferred and (2) we emit write-barrier to CodeBlock before deferred GC is executed.
     20   
     21    * dfg/DFGPlan.cpp:
     22    (JSC::DFG::Plan::reallyAdd):
     23   
     24    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259424 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     25
     26    2020-04-02  Yusuke Suzuki  <ysuzuki@apple.com>
     27
     28            [JSC] RecordedStatuses's assignment should be guarded by CodeBlock's lock
     29            https://bugs.webkit.org/show_bug.cgi?id=209935
     30            <rdar://problem/59443383>
     31
     32            Reviewed by Mark Lam.
     33
     34            Previously RecordedStatuses are not touched by GC. But now, GC visits RecordedStatuses.
     35            This means that modifying RecordedStatuses should be guarded by CodeBlock's lock if
     36            it is reachable from CodeBlock.
     37            In DFG::Plan::reallyAdd, we already installed DFG::JITCode into the CodeBlock so that
     38            RecordedStatuses is reachable from CodeBlock. We should lock CodeBlock's lock while
     39            performing `WTFMove(RecordedStatuses)`.
     40
     41            We do not need to emit write-barrier here because (1) DFG::Plan::reallyAdd is executed
     42            while GC is deferred and (2) we emit write-barrier to CodeBlock before deferred GC is executed.
     43
     44            * dfg/DFGPlan.cpp:
     45            (JSC::DFG::Plan::reallyAdd):
     46
    1472020-04-06  Alan Coon  <alancoon@apple.com>
    248
  • branches/safari-609-branch/Source/JavaScriptCore/dfg/DFGPlan.cpp

    r258156 r259602  
    559559void Plan::reallyAdd(CommonData* commonData)
    560560{
     561    ASSERT(m_vm->heap.isDeferred());
    561562    m_watchpoints.reallyAdd(m_codeBlock, *commonData);
    562563    m_identifiers.reallyAdd(*m_vm, commonData);
     
    564565    m_transitions.reallyAdd(*m_vm, commonData);
    565566    m_globalProperties.reallyAdd(m_codeBlock, m_identifiers, *commonData);
    566     commonData->recordedStatuses = WTFMove(m_recordedStatuses);
     567    {
     568        ConcurrentJSLocker locker(m_codeBlock->m_lock);
     569        commonData->recordedStatuses = WTFMove(m_recordedStatuses);
     570    }
    567571}
    568572
Note: See TracChangeset for help on using the changeset viewer.