⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 235515 in webkit


Ignore:
Timestamp:
Aug 30, 2018, 12:27:56 PM (8 years ago)
Author:
sbarati@apple.com
Message:

CSE DataViewGet* DFG nodes
https://bugs.webkit.org/show_bug.cgi?id=188768

Reviewed by Yusuke Suzuki.

JSTests:

  • microbenchmarks/dataview-cse.js: Added.

(assert):
(test):

  • stress/dataview-get-cse.js: Added.

(assert):
(test1.foo):
(test1):
(test2.foo):
(test2):
(test3.foo):
(test3):
(test4.foo):
(test4):
(test5.foo):
(test5):
(test6.foo):
(test6):

Source/JavaScriptCore:

This patch makes it so that we CSE DataViewGet* accesses. To do this,
I needed to add a third descriptor to HeapLocation to represent the
isLittleEndian child. This patch is neutral on compile time benchmarks,
and is a 50% speedup on a trivial CSE microbenchmark that I added.

  • dfg/DFGClobberize.h:

(JSC::DFG::clobberize):

  • dfg/DFGFixupPhase.cpp:

(JSC::DFG::FixupPhase::fixupNode):

  • dfg/DFGHeapLocation.cpp:

(WTF::printInternal):

  • dfg/DFGHeapLocation.h:

(JSC::DFG::HeapLocation::HeapLocation):
(JSC::DFG::HeapLocation::hash const):
(JSC::DFG::HeapLocation::operator== const):
(JSC::DFG::indexedPropertyLocForResultType):

Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r235514 r235515  
     12018-08-30  Saam barati  <sbarati@apple.com>
     2
     3        CSE DataViewGet* DFG nodes
     4        https://bugs.webkit.org/show_bug.cgi?id=188768
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        * microbenchmarks/dataview-cse.js: Added.
     9        (assert):
     10        (test):
     11        * stress/dataview-get-cse.js: Added.
     12        (assert):
     13        (test1.foo):
     14        (test1):
     15        (test2.foo):
     16        (test2):
     17        (test3.foo):
     18        (test3):
     19        (test4.foo):
     20        (test4):
     21        (test5.foo):
     22        (test5):
     23        (test6.foo):
     24        (test6):
     25
    1262018-08-30  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
    227
  • trunk/Source/JavaScriptCore/ChangeLog

    r235514 r235515  
     12018-08-30  Saam barati  <sbarati@apple.com>
     2
     3        CSE DataViewGet* DFG nodes
     4        https://bugs.webkit.org/show_bug.cgi?id=188768
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        This patch makes it so that we CSE DataViewGet* accesses. To do this,
     9        I needed to add a third descriptor to HeapLocation to represent the
     10        isLittleEndian child. This patch is neutral on compile time benchmarks,
     11        and is a 50% speedup on a trivial CSE microbenchmark that I added.
     12
     13        * dfg/DFGClobberize.h:
     14        (JSC::DFG::clobberize):
     15        * dfg/DFGFixupPhase.cpp:
     16        (JSC::DFG::FixupPhase::fixupNode):
     17        * dfg/DFGHeapLocation.cpp:
     18        (WTF::printInternal):
     19        * dfg/DFGHeapLocation.h:
     20        (JSC::DFG::HeapLocation::HeapLocation):
     21        (JSC::DFG::HeapLocation::hash const):
     22        (JSC::DFG::HeapLocation::operator== const):
     23        (JSC::DFG::indexedPropertyLocForResultType):
     24
    1252018-08-30  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
    226
  • trunk/Source/JavaScriptCore/dfg/DFGClobberize.h

    r235106 r235515  
    17641764        read(MiscFields);
    17651765        read(TypedArrayProperties);
     1766        LocationKind indexedPropertyLoc = indexedPropertyLocForResultType(node->result());
     1767        def(HeapLocation(indexedPropertyLoc, AbstractHeap(TypedArrayProperties, node->dataViewData().asQuadWord),
     1768            node->child1(), node->child2(), node->child3()), LazyNode(node));
    17661769        return;
    17671770    }
  • trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp

    r235106 r235515  
    21202120                    break;
    21212121                case 4:
    2122                     if (data.isSigned) 
     2122                    if (data.isSigned)
    21232123                        node->setResult(NodeResultInt32);
    21242124                    else
  • trunk/Source/JavaScriptCore/dfg/DFGHeapLocation.cpp

    r231871 r235515  
    133133        return;
    134134
     135    case IndexedPropertyInt32Loc:
     136        out.print("IndexedPropertyInt32Loc");
     137        return;
     138
    135139    case IndexedPropertyInt52Loc:
    136140        out.print("IndexedPropertyInt52Loc");
  • trunk/Source/JavaScriptCore/dfg/DFGHeapLocation.h

    r231871 r235515  
    5050    IndexedPropertyDoubleLoc,
    5151    IndexedPropertyDoubleSaneChainLoc,
     52    IndexedPropertyInt32Loc,
    5253    IndexedPropertyInt52Loc,
    5354    IndexedPropertyJSLoc,
     
    7879        LocationKind kind = InvalidLocationKind,
    7980        AbstractHeap heap = AbstractHeap(),
    80         Node* base = nullptr, LazyNode index = LazyNode())
     81        Node* base = nullptr, LazyNode index = LazyNode(), Node* descriptor = nullptr)
    8182        : m_kind(kind)
    8283        , m_heap(heap)
    8384        , m_base(base)
    8485        , m_index(index)
     86        , m_descriptor(descriptor)
    8587    {
    8688        ASSERT((kind == InvalidLocationKind) == !heap);
    8789        ASSERT(!!m_heap || !m_base);
    88         ASSERT(m_base || !m_index);
     90        ASSERT(m_base || (!m_index && !m_descriptor));
    8991    }
    9092
    91     HeapLocation(LocationKind kind, AbstractHeap heap, Node* base, Node* index)
    92         : HeapLocation(kind, heap, base, LazyNode(index))
     93    HeapLocation(LocationKind kind, AbstractHeap heap, Node* base, Node* index, Node* descriptor = nullptr)
     94        : HeapLocation(kind, heap, base, LazyNode(index), descriptor)
    9395    {
    9496    }
    9597   
    96     HeapLocation(LocationKind kind, AbstractHeap heap, Edge base, Edge index = Edge())
    97         : HeapLocation(kind, heap, base.node(), index.node())
     98    HeapLocation(LocationKind kind, AbstractHeap heap, Edge base, Edge index = Edge(), Edge descriptor = Edge())
     99        : HeapLocation(kind, heap, base.node(), index.node(), descriptor.node())
    98100    {
    99101    }
     
    104106        , m_base(nullptr)
    105107        , m_index(nullptr)
     108        , m_descriptor(nullptr)
    106109    {
    107110    }
     
    116119    unsigned hash() const
    117120    {
    118         return m_kind + m_heap.hash() + m_index.hash() + m_kind;
     121        return m_kind + m_heap.hash() + m_index.hash() + static_cast<unsigned>(bitwise_cast<uintptr_t>(m_base)) + static_cast<unsigned>(bitwise_cast<uintptr_t>(m_descriptor));
    119122    }
    120123   
     
    124127            && m_heap == other.m_heap
    125128            && m_base == other.m_base
    126             && m_index == other.m_index;
     129            && m_index == other.m_index
     130            && m_descriptor == other.m_descriptor;
    127131    }
    128132   
     
    139143    Node* m_base;
    140144    LazyNode m_index;
     145    Node* m_descriptor;
    141146};
    142147
     
    160165    case NodeResultInt52:
    161166        return IndexedPropertyInt52Loc;
     167    case NodeResultInt32:
     168        return IndexedPropertyInt32Loc;
    162169    case NodeResultJS:
    163170        return IndexedPropertyJSLoc;
Note: See TracChangeset for help on using the changeset viewer.