Changeset 140203 in webkit


Ignore:
Timestamp:
Jan 18, 2013 1:45:06 PM (11 years ago)
Author:
msaboff@apple.com
Message:

Harden ArithDiv of integers fix-up by inserting Int32ToDouble node directly
https://bugs.webkit.org/show_bug.cgi?id=107321

Reviewed by Filip Pizlo.

Split out the Int32ToDouble node insertion from fixDoubleEdge() and used it directly when we're fixing up
an ArithDiv node with integer inputs and output for platforms that don't have integer division.
Since we are checking that our inputs should be ints, we can just insert the Int32ToDouble node
without any further checks.

  • dfg/DFGFixupPhase.cpp:

(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::fixDoubleEdge):
(FixupPhase):
(JSC::DFG::FixupPhase::injectInt32ToDoubleNode):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r140201 r140203  
     12013-01-18  Michael Saboff  <msaboff@apple.com>
     2
     3        Harden ArithDiv of integers fix-up by inserting Int32ToDouble node directly
     4        https://bugs.webkit.org/show_bug.cgi?id=107321
     5
     6        Reviewed by  Filip Pizlo.
     7
     8        Split out the Int32ToDouble node insertion from fixDoubleEdge() and used it directly when we're fixing up
     9        an ArithDiv node with integer inputs and output for platforms that don't have integer division.
     10        Since we are checking that our inputs should be ints, we can just insert the Int32ToDouble node
     11        without any further checks.
     12
     13        * dfg/DFGFixupPhase.cpp:
     14        (JSC::DFG::FixupPhase::fixupNode):
     15        (JSC::DFG::FixupPhase::fixDoubleEdge):
     16        (FixupPhase):
     17        (JSC::DFG::FixupPhase::injectInt32ToDoubleNode):
     18
    1192013-01-18  Michael Saboff  <msaboff@apple.com>
    220
  • trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp

    r140201 r140203  
    321321                if (isX86())
    322322                    break;
    323                 fixDoubleEdge(0);
    324                 fixDoubleEdge(1);
     323                injectInt32ToDoubleNode(0);
     324                injectInt32ToDoubleNode(1);
    325325               
    326326                Node& oldDivision = m_graph[m_compileIndex];
     
    559559        }
    560560       
     561        injectInt32ToDoubleNode(childIndex);
     562    }
     563
     564    void injectInt32ToDoubleNode(unsigned childIndex)
     565    {
     566        Node& source = m_graph[m_compileIndex];
     567        Edge& edge = m_graph.child(source, childIndex);
     568       
    561569        NodeIndex resultIndex = (NodeIndex)m_graph.size();
    562570       
Note: See TracChangeset for help on using the changeset viewer.