Ignore:
Timestamp:
Apr 25, 2017, 12:04:47 PM (8 years ago)
Author:
[email protected]
Message:

Local CSE wrongly CSEs array accesses with different result types.
https://bugs.webkit.org/show_bug.cgi?id=170990
<rdar://problem/31705945>

Reviewed by Saam Barati.

JSTests:

  • stress/regress-170990.js: Added.

Source/JavaScriptCore:

The fix is to use different LocationKind enums for the different type of array
result types. This makes the HeapLocation values different based on the result
types, and allows CSE to discern between them.

  • dfg/DFGCSEPhase.cpp:
  • dfg/DFGClobberize.h:

(JSC::DFG::clobberize):

  • dfg/DFGHeapLocation.cpp:

(WTF::printInternal):

  • dfg/DFGHeapLocation.h:

(JSC::DFG::indexedPropertyLocForResultType):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp

    r204466 r215748  
    461461                        Node* base = m_graph.varArgChild(m_node, 0).node();
    462462                        Node* index = m_graph.varArgChild(m_node, 1).node();
     463                        LocationKind indexedPropertyLoc = indexedPropertyLocForResultType(m_node->result());
    463464                       
    464465                        ArrayMode mode = m_node->arrayMode();
     
    468469                                break;
    469470                            heap = HeapLocation(
    470                                 IndexedPropertyLoc, IndexedInt32Properties, base, index);
     471                                indexedPropertyLoc, IndexedInt32Properties, base, index);
    471472                            break;
    472473                           
     
    475476                                break;
    476477                            heap = HeapLocation(
    477                                 IndexedPropertyLoc, IndexedDoubleProperties, base, index);
     478                                indexedPropertyLoc, IndexedDoubleProperties, base, index);
    478479                            break;
    479480                           
     
    482483                                break;
    483484                            heap = HeapLocation(
    484                                 IndexedPropertyLoc, IndexedContiguousProperties, base, index);
     485                                indexedPropertyLoc, IndexedContiguousProperties, base, index);
    485486                            break;
    486487                           
     
    497498                                break;
    498499                            heap = HeapLocation(
    499                                 IndexedPropertyLoc, TypedArrayProperties, base, index);
     500                                indexedPropertyLoc, TypedArrayProperties, base, index);
    500501                            break;
    501502                           
Note: See TracChangeset for help on using the changeset viewer.