Changeset 92736 in webkit


Ignore:
Timestamp:
Aug 9, 2011 6:12:28 PM (13 years ago)
Author:
fpizlo@apple.com
Message:

DFG JIT does not speculative integers as aggressively as it should
https://bugs.webkit.org/show_bug.cgi?id=65949

Reviewed by Gavin Barraclough.

Added a tree walk to propagate integer predictions through arithmetic
expressions.

This is a 71% speed-up on Kraken's imaging-gaussian-blur, which
translates to a 19% speed-up on Kraken overall. It's neutral on
other benchmarks.

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::predictInt32):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r92734 r92736  
     12011-08-09  Filip Pizlo  <fpizlo@apple.com>
     2
     3        DFG JIT does not speculative integers as aggressively as it should
     4        https://bugs.webkit.org/show_bug.cgi?id=65949
     5
     6        Reviewed by Gavin Barraclough.
     7       
     8        Added a tree walk to propagate integer predictions through arithmetic
     9        expressions.
     10       
     11        This is a 71% speed-up on Kraken's imaging-gaussian-blur, which
     12        translates to a 19% speed-up on Kraken overall.  It's neutral on
     13        other benchmarks.
     14
     15        * dfg/DFGByteCodeParser.cpp:
     16        (JSC::DFG::ByteCodeParser::predictInt32):
     17
    1182011-08-09  Filip Pizlo  <fpizlo@apple.com>
    219
  • trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

    r92734 r92736  
    436436    void predictInt32(NodeIndex nodeIndex)
    437437    {
    438         Node* nodePtr = &m_graph[nodeIndex];
    439 
    440         if (nodePtr->op == ValueToNumber)
    441             nodePtr = &m_graph[nodePtr->child1()];
    442 
    443         if (nodePtr->op == ValueToInt32)
    444             nodePtr = &m_graph[nodePtr->child1()];
     438        ASSERT(m_reusableNodeStack.isEmpty());
     439        m_reusableNodeStack.append(&m_graph[nodeIndex]);
    445440       
    446         m_graph.predict(*nodePtr, PredictInt32);
     441        do {
     442            Node* nodePtr = m_reusableNodeStack.last();
     443            m_reusableNodeStack.removeLast();
     444           
     445            if (nodePtr->op == ValueToNumber)
     446                nodePtr = &m_graph[nodePtr->child1()];
     447           
     448            if (nodePtr->op == ValueToInt32)
     449                nodePtr = &m_graph[nodePtr->child1()];
     450           
     451            switch (nodePtr->op) {
     452            case ArithAdd:
     453            case ArithSub:
     454            case ArithMul:
     455            case ValueAdd:
     456                m_reusableNodeStack.append(&m_graph[nodePtr->child1()]);
     457                m_reusableNodeStack.append(&m_graph[nodePtr->child2()]);
     458                break;
     459            default:
     460                m_graph.predict(*nodePtr, PredictInt32);
     461                break;
     462            }
     463        } while (!m_reusableNodeStack.isEmpty());
    447464    }
    448465
     
    517534    Vector<PhiStackEntry, 16> m_argumentPhiStack;
    518535    Vector<PhiStackEntry, 16> m_localPhiStack;
     536   
     537    Vector<Node*, 16> m_reusableNodeStack;
    519538};
    520539
Note: See TracChangeset for help on using the changeset viewer.