Changeset 247724 in webkit


Ignore:
Timestamp:
Jul 23, 2019 10:24:13 AM (5 years ago)
Author:
Justin Michaud
Message:

Sometimes we miss removable CheckInBounds
https://bugs.webkit.org/show_bug.cgi?id=200018

Reviewed by Saam Barati.

JSTests:

  • microbenchmarks/typed-array-sum.js: Added.

(doTest):

Source/JavaScriptCore:

We failed to remove the CheckInBounds bounds because we did not see that the index was nonnegative. This is because we do not see the relationship between the two
separate zero constants that appear in the IR for the given test case. This patch re-adds the hack to de-duplicate m_zero that was removed in
<https://trac.webkit.org/changeset/241228/webkit>.

  • dfg/DFGIntegerRangeOptimizationPhase.cpp:
Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r247532 r247724  
     12019-07-23  Justin Michaud  <justin_michaud@apple.com>
     2
     3        Sometimes we miss removable CheckInBounds
     4        https://bugs.webkit.org/show_bug.cgi?id=200018
     5
     6        Reviewed by Saam Barati.
     7
     8        * microbenchmarks/typed-array-sum.js: Added.
     9        (doTest):
     10
    1112019-07-16  Mark Lam  <mark.lam@apple.com>
    212
  • trunk/Source/JavaScriptCore/ChangeLog

    r247714 r247724  
     12019-07-23  Justin Michaud  <justin_michaud@apple.com>
     2
     3        Sometimes we miss removable CheckInBounds
     4        https://bugs.webkit.org/show_bug.cgi?id=200018
     5
     6        Reviewed by Saam Barati.
     7
     8        We failed to remove the CheckInBounds bounds because we did not see that the index was nonnegative. This is because we do not see the relationship between the two
     9        separate zero constants that appear in the IR for the given test case. This patch re-adds the hack to de-duplicate m_zero that was removed in
     10        <https://trac.webkit.org/changeset/241228/webkit>.
     11
     12        * dfg/DFGIntegerRangeOptimizationPhase.cpp:
     13
    1142019-07-22  Yusuke Suzuki  <ysuzuki@apple.com>
    215
  • trunk/Source/JavaScriptCore/dfg/DFGIntegerRangeOptimizationPhase.cpp

    r241228 r247724  
    10111011       
    10121012        // Before we do anything, make sure that we have a zero constant at the top.
    1013         m_zero = m_insertionSet.insertConstant(0, m_graph.block(0)->at(0)->origin, jsNumber(0));
    1014         m_insertionSet.execute(m_graph.block(0));
     1013        for (Node* node : *m_graph.block(0)) {
     1014            if (node->isInt32Constant() && !node->asInt32()) {
     1015                m_zero = node;
     1016                break;
     1017            }
     1018        }
     1019        if (!m_zero) {
     1020            m_zero = m_insertionSet.insertConstant(0, m_graph.block(0)->at(0)->origin, jsNumber(0));
     1021            m_insertionSet.execute(m_graph.block(0));
     1022        }
    10151023       
    10161024        if (DFGIntegerRangeOptimizationPhaseInternal::verbose) {
     
    13221330                    if (nonNegative && lessThanLength) {
    13231331                        executeNode(block->at(nodeIndex));
    1324                         node->convertToIdentityOn(m_zero);
     1332                        // We just need to make sure we are a value-producing node.
     1333                        node->convertToIdentityOn(node->child1().node());
    13251334                        changed = true;
    13261335                    }
Note: See TracChangeset for help on using the changeset viewer.