Changeset 261603 in webkit


Ignore:
Timestamp:
May 13, 2020 12:24:13 AM (4 years ago)
Author:
sbarati@apple.com
Message:

MovHint can see an arguments object be MovHinted to a Tmp
https://bugs.webkit.org/show_bug.cgi?id=211820
<rdar://problem/62882158>

Reviewed by Keith Miller.

JSTests:

  • stress/varargs-forwarding-can-see-arguments-mov-hint-to-for-of-tmp.js: Added.

(let.iter.Symbol.iterator.return.next):
(let.iter.Symbol.iterator):

Source/JavaScriptCore:

We had an assert that it wasn't possible to have a MovHint from an arguments
object to a Tmp. However, this is possible with for-of. There is nothing
about the current algorithm that is specific to only VirtualRegisters. The
algorithm also works over Tmps. So I've generalized the algorithm to just work
over Operand.

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

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r261601 r261603  
     12020-05-13  Saam Barati  <sbarati@apple.com>
     2
     3        MovHint can see an arguments object be MovHinted to a Tmp
     4        https://bugs.webkit.org/show_bug.cgi?id=211820
     5        <rdar://problem/62882158>
     6
     7        Reviewed by Keith Miller.
     8
     9        * stress/varargs-forwarding-can-see-arguments-mov-hint-to-for-of-tmp.js: Added.
     10        (let.iter.Symbol.iterator.return.next):
     11        (let.iter.Symbol.iterator):
     12
    1132020-05-13  Alexey Shvayka  <shvaikalesh@gmail.com>
    214
  • trunk/Source/JavaScriptCore/ChangeLog

    r261601 r261603  
     12020-05-13  Saam Barati  <sbarati@apple.com>
     2
     3        MovHint can see an arguments object be MovHinted to a Tmp
     4        https://bugs.webkit.org/show_bug.cgi?id=211820
     5        <rdar://problem/62882158>
     6
     7        Reviewed by Keith Miller.
     8
     9        We had an assert that it wasn't possible to have a MovHint from an arguments
     10        object to a Tmp. However, this is possible with for-of. There is nothing
     11        about the current algorithm that is specific to only VirtualRegisters. The
     12        algorithm also works over Tmps. So I've generalized the algorithm to just work
     13        over Operand.
     14
     15        * dfg/DFGVarargsForwardingPhase.cpp:
     16
    1172020-05-13  Alexey Shvayka  <shvaikalesh@gmail.com>
    218
  • trunk/Source/JavaScriptCore/dfg/DFGVarargsForwardingPhase.cpp

    r261595 r261603  
    9898        // sites.
    9999        unsigned lastUserIndex = candidateNodeIndex;
    100         Vector<VirtualRegister, 2> relevantLocals; // This is a set. We expect it to be a small set.
     100        Vector<Operand, 2> relevantLocals; // This is a set. We expect it to be a small set.
    101101        for (unsigned nodeIndex = candidateNodeIndex + 1; nodeIndex < block->size(); ++nodeIndex) {
    102102            Node* node = block->at(nodeIndex);
     
    116116                if (node->child1() != candidate)
    117117                    break;
    118                 ASSERT_WITH_MESSAGE(!node->unlinkedOperand().isTmp(), "We don't currently support a tmp referring to an arguments object.");
    119118                lastUserIndex = nodeIndex;
    120                 if (!relevantLocals.contains(node->unlinkedOperand().virtualRegister()))
    121                     relevantLocals.append(node->unlinkedOperand().virtualRegister());
     119                if (!relevantLocals.contains(node->unlinkedOperand()))
     120                    relevantLocals.append(node->unlinkedOperand());
    122121                break;
    123122               
     
    246245                            relevantLocals.removeLast();
    247246                            lastUserIndex = nodeIndex;
     247                            ASSERT(!relevantLocals.contains(operand));
     248                            break;
    248249                        }
    249250                    }
Note: See TracChangeset for help on using the changeset viewer.