Ignore:
Timestamp:
Sep 10, 2013, 9:35:16 PM (12 years ago)
Author:
[email protected]
Message:

Propagate the Int48 stuff into the prediction propagator.
https://bugs.webkit.org/show_bug.cgi?id=121132

Reviewed by Mark Hahnenberg.

This still has no effect on codegen since Int48 still looks like a Double right now.

  • bytecode/ExitKind.cpp:

(JSC::exitKindToString):

  • bytecode/ExitKind.h:
  • bytecode/SpeculatedType.cpp:

(JSC::speculationFromValue):

  • bytecode/SpeculatedType.h:

(JSC::isMachineIntSpeculation):
(JSC::isMachineIntSpeculationExpectingDefined):
(JSC::isMachineIntSpeculationForArithmetic):

  • dfg/DFGGraph.cpp:

(JSC::DFG::Graph::dump):

  • dfg/DFGGraph.h:

(JSC::DFG::Graph::addShouldSpeculateMachineInt):
(JSC::DFG::Graph::mulShouldSpeculateInt32):
(JSC::DFG::Graph::mulShouldSpeculateMachineInt):
(JSC::DFG::Graph::negateShouldSpeculateMachineInt):
(JSC::DFG::Graph::hasExitSite):

  • dfg/DFGNode.h:

(JSC::DFG::Node::shouldSpeculateMachineInt):
(JSC::DFG::Node::shouldSpeculateMachineIntForArithmetic):
(JSC::DFG::Node::shouldSpeculateMachineIntExpectingDefined):
(JSC::DFG::Node::canSpeculateInt48):

  • dfg/DFGNodeFlags.h:

(JSC::DFG::nodeCanSpeculateInt48):

  • dfg/DFGPredictionPropagationPhase.cpp:

(JSC::DFG::PredictionPropagationPhase::propagate):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGGraph.h

    r155497 r155499  
    229229    }
    230230   
     231    bool addShouldSpeculateMachineInt(Node* add)
     232    {
     233        Node* left = add->child1().node();
     234        Node* right = add->child2().node();
     235
     236        bool speculation;
     237        if (add->op() == ValueAdd)
     238            speculation = Node::shouldSpeculateMachineIntExpectingDefined(left, right);
     239        else
     240            speculation = Node::shouldSpeculateMachineIntForArithmetic(left, right);
     241
     242        return speculation && !hasExitSite(add, Int48Overflow);
     243    }
     244   
    231245    bool mulShouldSpeculateInt32(Node* mul)
    232246    {
     
    236250        Node* right = mul->child2().node();
    237251       
    238         return Node::shouldSpeculateInt32ForArithmetic(left, right) && mul->canSpeculateInt32();
     252        return Node::shouldSpeculateInt32ForArithmetic(left, right)
     253            && mul->canSpeculateInt32();
     254    }
     255   
     256    bool mulShouldSpeculateMachineInt(Node* mul)
     257    {
     258        ASSERT(mul->op() == ArithMul);
     259       
     260        Node* left = mul->child1().node();
     261        Node* right = mul->child2().node();
     262
     263        return Node::shouldSpeculateMachineIntForArithmetic(left, right)
     264            && mul->canSpeculateInt48()
     265            && !hasExitSite(mul, Int48Overflow);
    239266    }
    240267   
     
    243270        ASSERT(negate->op() == ArithNegate);
    244271        return negate->child1()->shouldSpeculateInt32ForArithmetic() && negate->canSpeculateInt32();
     272    }
     273   
     274    bool negateShouldSpeculateMachineInt(Node* negate)
     275    {
     276        ASSERT(negate->op() == ArithNegate);
     277        return negate->child1()->shouldSpeculateMachineIntForArithmetic()
     278            && !hasExitSite(negate, Int48Overflow)
     279            && negate->canSpeculateInt48();
    245280    }
    246281   
     
    379414    {
    380415        return baselineCodeBlockFor(codeOrigin)->hasExitSite(FrequentExitSite(codeOrigin.bytecodeIndex, exitKind));
     416    }
     417   
     418    bool hasExitSite(Node* node, ExitKind exitKind)
     419    {
     420        return hasExitSite(node->codeOrigin, exitKind);
    381421    }
    382422   
Note: See TracChangeset for help on using the changeset viewer.