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

Changeset 258381 in webkit


Ignore:
Timestamp:
Mar 12, 2020, 9:16:36 PM (6 years ago)
Author:
keith_miller@apple.com
Message:

DFG nodes that take a TypedArray's storage need to keepAlive the TypedArray
https://bugs.webkit.org/show_bug.cgi?id=209035

Reviewed by Saam Barati.

It might be possible to produce a graph where the last reference to a TypedArray
is via a GetByVal or PutByVal. Since those nodes don't create any reference to the
TypedArray in B3 we may end up not keeping the TypedArray alive until after the
storage access.

  • ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::compileAtomicsReadModifyWrite):
(JSC::FTL::DFG::LowerDFGToB3::compileGetByVal):
(JSC::FTL::DFG::LowerDFGToB3::compilePutByVal):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r258344 r258381  
     12020-03-12  Keith Miller  <keith_miller@apple.com>
     2
     3        DFG nodes that take a TypedArray's storage need to keepAlive the TypedArray
     4        https://bugs.webkit.org/show_bug.cgi?id=209035
     5
     6        Reviewed by Saam Barati.
     7
     8        It might be possible to produce a graph where the last reference to a TypedArray
     9        is via a GetByVal or PutByVal. Since those nodes don't create any reference to the
     10        TypedArray in B3 we may end up not keeping the TypedArray alive until after the
     11        storage access.
     12
     13        * ftl/FTLLowerDFGToB3.cpp:
     14        (JSC::FTL::DFG::LowerDFGToB3::compileAtomicsReadModifyWrite):
     15        (JSC::FTL::DFG::LowerDFGToB3::compileGetByVal):
     16        (JSC::FTL::DFG::LowerDFGToB3::compilePutByVal):
     17
    1182020-03-12  Yusuke Suzuki  <ysuzuki@apple.com>
    219
  • trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp

    r258078 r258381  
    38393839        // array buffer storage.
    38403840        m_heaps.decorateFencedAccess(&m_heaps.typedArrayProperties, atomicValue);
    3841        
     3841
     3842        // We have to keep base alive since that keeps storage alive.
     3843        keepAlive(lowCell(baseEdge));
    38423844        setIntTypedArrayLoadResult(result, type);
    38433845    }
     
    46944696        case Array::Float32Array:
    46954697        case Array::Float64Array: {
     4698            LValue base = lowCell(m_graph.varArgChild(m_node, 0));
    46964699            LValue index = lowInt32(m_graph.varArgChild(m_node, 1));
    46974700            LValue storage = lowStorage(m_graph.varArgChild(m_node, 2));
     
    47234726                }
    47244727               
     4728                // We have to keep base alive since that keeps storage alive.
     4729                keepAlive(base);
    47254730                setDouble(result);
    47264731                return;
     
    50895094                }
    50905095               
     5096                // We have to keep base alive since that keeps storage alive.
     5097                keepAlive(base);
    50915098                return;
    50925099            }
Note: See TracChangeset for help on using the changeset viewer.