Changeset 245652 in webkit


Ignore:
Timestamp:
May 22, 2019 3:19:38 PM (5 years ago)
Author:
Tadeu Zagallo
Message:

JSTests:
llint_slow_path_get_by_id needs to hold the CodeBlock's to update the metadata's mode
https://bugs.webkit.org/show_bug.cgi?id=198120
<rdar://problem/49668795>

Reviewed by Michael Saboff.

  • stress/get-array-length-concurrently-change-mode.js: Added.

(main):

Source/JavaScriptCore:
llint_slow_path_get_by_id needs to hold the CodeBlock's lock to update the metadata's mode
https://bugs.webkit.org/show_bug.cgi?id=198120
<rdar://problem/49668795>

Reviewed by Michael Saboff.

There are two places in llint_slow_path_get_by_id where we change the
metadata's mode without holding the CodeBlock's lock. This is an issue
when switching to and from ArrayLength mode, since other places can
either get a pointer to an array profile that will be overwritten or
an array profile that hasn't yet been initialized.

  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::LLINT_SLOW_PATH_DECL):

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r245648 r245652  
     12019-05-22  Tadeu Zagallo  <tzagallo@apple.com>
     2
     3        llint_slow_path_get_by_id needs to hold the CodeBlock's to update the metadata's mode
     4        https://bugs.webkit.org/show_bug.cgi?id=198120
     5        <rdar://problem/49668795>
     6
     7        Reviewed by Michael Saboff.
     8
     9        * stress/get-array-length-concurrently-change-mode.js: Added.
     10        (main):
     11
    1122019-05-22  Commit Queue  <commit-queue@webkit.org>
    213
  • trunk/Source/JavaScriptCore/ChangeLog

    r245648 r245652  
     12019-05-22  Tadeu Zagallo  <tzagallo@apple.com>
     2
     3        llint_slow_path_get_by_id needs to hold the CodeBlock's lock to update the metadata's mode
     4        https://bugs.webkit.org/show_bug.cgi?id=198120
     5        <rdar://problem/49668795>
     6
     7        Reviewed by Michael Saboff.
     8
     9        There are two places in llint_slow_path_get_by_id where we change the
     10        metadata's mode without holding the CodeBlock's lock. This is an issue
     11        when switching to and from ArrayLength mode, since other places can
     12        either get a pointer to an array profile that will be overwritten or
     13        an array profile that hasn't yet been initialized.
     14
     15        * llint/LLIntSlowPaths.cpp:
     16        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
     17
    1182019-05-22  Commit Queue  <commit-queue@webkit.org>
    219
  • trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp

    r245050 r245652  
    804804        Structure* structure = baseCell->structure(vm);
    805805        if (slot.isValue() && slot.slotBase() == baseValue) {
     806            ConcurrentJSLocker locker(codeBlock->m_lock);
     807
    806808            // Start out by clearing out the old cache.
    807809            metadata.m_mode = GetByIdMode::Default;
     
    815817                && !structure->needImpurePropertyWatchpoint()) {
    816818                vm.heap.writeBarrier(codeBlock);
    817                
    818                 ConcurrentJSLocker locker(codeBlock->m_lock);
    819819
    820820                metadata.m_modeMetadata.defaultMode.structureID = structure->id();
     
    830830        && isJSArray(baseValue)
    831831        && ident == vm.propertyNames->length) {
     832        ConcurrentJSLocker locker(codeBlock->m_lock);
    832833        metadata.m_mode = GetByIdMode::ArrayLength;
    833834        new (&metadata.m_modeMetadata.arrayLengthMode.arrayProfile) ArrayProfile(codeBlock->bytecodeOffset(pc));
Note: See TracChangeset for help on using the changeset viewer.