Changeset 203336 in webkit


Ignore:
Timestamp:
Jul 17, 2016, 3:00:42 PM (9 years ago)
Author:
fpizlo@apple.com
Message:

DFG CSE is broken for MultiGetByOffset
https://bugs.webkit.org/show_bug.cgi?id=159858

Reviewed by Saam Barati.

This disabled CSE for MultiGetByOffset. I opened bug 159859 for the long-term fix, which
would teach CSE (and other passes also) how to decay a removed MultiGetByOffset to a
CheckStructure. Since we currently just decay MultiGetByOffset to Check, we forget the
structure checks. So, if we CSE a MultiGetByOffset that checks for one set of structures with
a heap access on the same property and base that checks for different structures, then we
will forget some structure checks that we had previously. It's unsound to forget checks in
DFG IR.

This bug mostly manifested as a high-volume crash at Unreachable in FTL, because we'd prove
that the code after the MultiGetByOffset was unreachable due to the structure checks and then
CSE would remove everything but the Unreachable.

  • dfg/DFGClobberize.h:

(JSC::DFG::clobberize): Remove the def() for MultiGetByOffset to disable CSE for this node for now.

  • tests/stress/cse-multi-get-by-offset-remove-checks.js: Added. This used to fail with FTL eanbled.

(Cons1):
(Cons2):
(Cons3):
(foo):
(bar):

Location:
trunk/Source/JavaScriptCore
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r203332 r203336  
     12016-07-16  Filip Pizlo  <fpizlo@apple.com>
     2
     3        DFG CSE is broken for MultiGetByOffset
     4        https://bugs.webkit.org/show_bug.cgi?id=159858
     5
     6        Reviewed by Saam Barati.
     7       
     8        This disabled CSE for MultiGetByOffset. I opened bug 159859 for the long-term fix, which
     9        would teach CSE (and other passes also) how to decay a removed MultiGetByOffset to a
     10        CheckStructure. Since we currently just decay MultiGetByOffset to Check, we forget the
     11        structure checks. So, if we CSE a MultiGetByOffset that checks for one set of structures with
     12        a heap access on the same property and base that checks for different structures, then we
     13        will forget some structure checks that we had previously. It's unsound to forget checks in
     14        DFG IR.
     15       
     16        This bug mostly manifested as a high-volume crash at Unreachable in FTL, because we'd prove
     17        that the code after the MultiGetByOffset was unreachable due to the structure checks and then
     18        CSE would remove everything but the Unreachable.
     19
     20        * dfg/DFGClobberize.h:
     21        (JSC::DFG::clobberize): Remove the def() for MultiGetByOffset to disable CSE for this node for now.
     22        * tests/stress/cse-multi-get-by-offset-remove-checks.js: Added. This used to fail with FTL enabled.
     23        (Cons1):
     24        (Cons2):
     25        (Cons3):
     26        (foo):
     27        (bar):
     28
    1292016-07-17  Yusuke Suzuki  <utatane.tea@gmail.com>
    230
  • trunk/Source/JavaScriptCore/dfg/DFGClobberize.h

    r203006 r203336  
    884884        AbstractHeap heap(NamedProperties, node->multiGetByOffsetData().identifierNumber);
    885885        read(heap);
    886         def(HeapLocation(NamedPropertyLoc, heap, node->child1()), LazyNode(node));
     886        // FIXME: We cannot def() for MultiGetByOffset because CSE is not smart enough to decay it
     887        // to a CheckStructure.
     888        // https://bugs.webkit.org/show_bug.cgi?id=159859
    887889        return;
    888890    }
Note: See TracChangeset for help on using the changeset viewer.