Changeset 251812 in webkit


Ignore:
Timestamp:
Oct 30, 2019 3:19:33 PM (5 years ago)
Author:
Tadeu Zagallo
Message:

tryCachePutToScopeGlobal should hold the lock to update metadata.m_getPutInfo
https://bugs.webkit.org/show_bug.cgi?id=203628
<rdar://problem/56705353>

Reviewed by Yusuke Suzuki.

JSTests:

  • stress/property-move-from-global-object-to-global-lexical-environment.js: Added.

(foo):

Source/JavaScriptCore:

We hold the lock to update m_watchpointSet and m_operand, but at that point we have already
updated m_getPutInfo. This can lead to inconsistent state observable from the compiler thread
where the getPutInfo does not match the watchpointSet.

  • runtime/CommonSlowPaths.h:

(JSC::CommonSlowPaths::tryCachePutToScopeGlobal):

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r251736 r251812  
     12019-10-30  Tadeu Zagallo  <tzagallo@apple.com>
     2
     3        tryCachePutToScopeGlobal should hold the lock to update metadata.m_getPutInfo
     4        https://bugs.webkit.org/show_bug.cgi?id=203628
     5        <rdar://problem/56705353>
     6
     7        Reviewed by Yusuke Suzuki.
     8
     9        * stress/property-move-from-global-object-to-global-lexical-environment.js: Added.
     10        (foo):
     11
    1122019-10-29  Yusuke Suzuki  <ysuzuki@apple.com>
    213
  • trunk/Source/JavaScriptCore/ChangeLog

    r251737 r251812  
     12019-10-30  Tadeu Zagallo  <tzagallo@apple.com>
     2
     3        tryCachePutToScopeGlobal should hold the lock to update metadata.m_getPutInfo
     4        https://bugs.webkit.org/show_bug.cgi?id=203628
     5        <rdar://problem/56705353>
     6
     7        Reviewed by Yusuke Suzuki.
     8
     9        We hold the lock to update m_watchpointSet and m_operand, but at that point we have already
     10        updated m_getPutInfo. This can lead to inconsistent state observable from the compiler thread
     11        where the getPutInfo does not match the watchpointSet.
     12
     13        * runtime/CommonSlowPaths.h:
     14        (JSC::CommonSlowPaths::tryCachePutToScopeGlobal):
     15
    1162019-10-07  Jer Noble  <jer.noble@apple.com>
    217
  • trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h

    r251425 r251812  
    144144            JSGlobalLexicalEnvironment* globalLexicalEnvironment = jsCast<JSGlobalLexicalEnvironment*>(scope);
    145145            ResolveType newResolveType = needsVarInjectionChecks(resolveType) ? GlobalLexicalVarWithVarInjectionChecks : GlobalLexicalVar;
    146             metadata.m_getPutInfo = GetPutInfo(metadata.m_getPutInfo.resolveMode(), newResolveType, metadata.m_getPutInfo.initializationMode());
    147146            SymbolTableEntry entry = globalLexicalEnvironment->symbolTable()->get(ident.impl());
    148147            ASSERT(!entry.isNull());
    149148            ConcurrentJSLocker locker(codeBlock->m_lock);
     149            metadata.m_getPutInfo = GetPutInfo(metadata.m_getPutInfo.resolveMode(), newResolveType, metadata.m_getPutInfo.initializationMode());
    150150            metadata.m_watchpointSet = entry.watchpointSet();
    151151            metadata.m_operand = reinterpret_cast<uintptr_t>(globalLexicalEnvironment->variableAt(entry.scopeOffset()).slot());
Note: See TracChangeset for help on using the changeset viewer.