Changeset 247183 in webkit


Ignore:
Timestamp:
Jul 5, 2019 4:05:56 PM (5 years ago)
Author:
mark.lam@apple.com
Message:

ArgumentsEliminationPhase::eliminateCandidatesThatInterfere() should not decrement nodeIndex pass zero.
https://bugs.webkit.org/show_bug.cgi?id=199533
<rdar://problem/52669111>

Reviewed by Filip Pizlo.

JSTests:

  • stress/ArgumentsEliminationPhase-eliminateCandidatesThatEscape-should-not-decrement-nodeIndex-pass-zero.js: Added.

Source/JavaScriptCore:

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

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r247173 r247183  
     12019-07-05  Mark Lam  <mark.lam@apple.com>
     2
     3        ArgumentsEliminationPhase::eliminateCandidatesThatInterfere() should not decrement nodeIndex pass zero.
     4        https://bugs.webkit.org/show_bug.cgi?id=199533
     5        <rdar://problem/52669111>
     6
     7        Reviewed by Filip Pizlo.
     8
     9        * stress/ArgumentsEliminationPhase-eliminateCandidatesThatEscape-should-not-decrement-nodeIndex-pass-zero.js: Added.
     10
    1112019-07-05  Alexey Shvayka  <shvaikalesh@gmail.com>
    212
  • trunk/Source/JavaScriptCore/ChangeLog

    r247175 r247183  
     12019-07-05  Mark Lam  <mark.lam@apple.com>
     2
     3        ArgumentsEliminationPhase::eliminateCandidatesThatInterfere() should not decrement nodeIndex pass zero.
     4        https://bugs.webkit.org/show_bug.cgi?id=199533
     5        <rdar://problem/52669111>
     6
     7        Reviewed by Filip Pizlo.
     8
     9        * dfg/DFGArgumentsEliminationPhase.cpp:
     10
    1112019-07-05  Yusuke Suzuki  <ysuzuki@apple.com>
    212
  • trunk/Source/JavaScriptCore/dfg/DFGArgumentsEliminationPhase.cpp

    r246075 r247183  
    605605
    606606                        // This loop considers all nodes up to the nodeIndex, excluding the nodeIndex.
    607                         while (nodeIndex--) {
     607                        //
     608                        // Note: nodeIndex here has a double meaning. Before entering this
     609                        // while loop, it refers to the remaining number of nodes that have
     610                        // yet to be processed. Inside the look, it refers to the index
     611                        // of the current node to process (after we decrement it).
     612                        //
     613                        // If the remaining number of nodes is 0, we should not decrement nodeIndex.
     614                        // Hence, we must only decrement nodeIndex inside the while loop instead of
     615                        // in its condition statement. Note that this while loop is embedded in an
     616                        // outer for loop. If we decrement nodeIndex in the condition statement, a
     617                        // nodeIndex of 0 will become UINT_MAX, and the outer loop will wrongly
     618                        // treat this as there being UINT_MAX remaining nodes to process.
     619                        while (nodeIndex) {
     620                            --nodeIndex;
    608621                            Node* node = block->at(nodeIndex);
    609622                            if (node == candidate)
Note: See TracChangeset for help on using the changeset viewer.