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

We should say Int32 when we mean Int32. Saying Integer is just weird.

Rubber stamped by Mark Hahnenberg.

  • dfg/DFGAbstractInterpreterInlines.h:

(JSC::DFG::::executeEffects):

  • dfg/DFGFixupPhase.cpp:

(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::fixupToPrimitive):
(JSC::DFG::FixupPhase::fixIntEdge):
(JSC::DFG::FixupPhase::truncateConstantsIfNecessary):
(JSC::DFG::FixupPhase::attemptToMakeIntegerAdd):

  • dfg/DFGGraph.h:

(JSC::DFG::Graph::addSpeculationMode):
(JSC::DFG::Graph::valueAddSpeculationMode):
(JSC::DFG::Graph::arithAddSpeculationMode):
(JSC::DFG::Graph::addShouldSpeculateInt32):
(JSC::DFG::Graph::mulShouldSpeculateInt32):
(JSC::DFG::Graph::negateShouldSpeculateInt32):
(JSC::DFG::Graph::addImmediateShouldSpeculateInt32):
(JSC::DFG::Graph::mulImmediateShouldSpeculateInt32):

  • dfg/DFGNode.h:

(JSC::DFG::Node::shouldSpeculateInt32):
(JSC::DFG::Node::shouldSpeculateInt32ForArithmetic):
(JSC::DFG::Node::shouldSpeculateInt32ExpectingDefined):
(JSC::DFG::Node::canSpeculateInt32):

  • dfg/DFGNodeFlags.h:

(JSC::DFG::nodeCanSpeculateInt32):

  • dfg/DFGPredictionPropagationPhase.cpp:

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

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::arrayify):
(JSC::DFG::GPRTemporary::GPRTemporary):
(JSC::DFG::SpeculativeJIT::compilePeepHoleIntegerBranch):
(JSC::DFG::SpeculativeJIT::compileValueToInt32):
(JSC::DFG::SpeculativeJIT::compileUInt32ToNumber):
(JSC::DFG::SpeculativeJIT::compileInt32ToDouble):
(JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray):
(JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
(JSC::DFG::SpeculativeJIT::compileAdd):
(JSC::DFG::SpeculativeJIT::compileArithSub):
(JSC::DFG::SpeculativeJIT::compileArithNegate):
(JSC::DFG::SpeculativeJIT::compileArithIMul):
(JSC::DFG::SpeculativeJIT::compileArithMul):
(JSC::DFG::SpeculativeJIT::compileArithDiv):
(JSC::DFG::SpeculativeJIT::compileArithMod):
(JSC::DFG::SpeculativeJIT::compileNewTypedArray):
(JSC::DFG::SpeculativeJIT::speculateInt32):
(JSC::DFG::SpeculativeJIT::emitSwitchImm):

  • dfg/DFGSpeculativeJIT.h:

(JSC::DFG::SpeculateInt32Operand::SpeculateInt32Operand):
(JSC::DFG::SpeculateInt32Operand::~SpeculateInt32Operand):

  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::compileIntegerCompare):
(JSC::DFG::SpeculativeJIT::compileLogicalNot):
(JSC::DFG::SpeculativeJIT::emitBranch):
(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::compileIntegerCompare):
(JSC::DFG::SpeculativeJIT::compileLogicalNot):
(JSC::DFG::SpeculativeJIT::emitBranch):
(JSC::DFG::SpeculativeJIT::compile):

  • ftl/FTLLowerDFGToLLVM.cpp:

(JSC::FTL::LowerDFGToLLVM::compileUInt32ToNumber):
(JSC::FTL::LowerDFGToLLVM::compileGetByVal):

File:
1 edited

Legend:

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

    r155023 r155482  
    6262
    6363enum AddSpeculationMode {
    64     DontSpeculateInteger,
    65     SpeculateIntegerAndTruncateConstants,
    66     SpeculateInteger
     64    DontSpeculateInt32,
     65    SpeculateInt32AndTruncateConstants,
     66    SpeculateInt32
    6767};
    6868
     
    191191    }
    192192   
    193     AddSpeculationMode addSpeculationMode(Node* add, bool leftShouldSpeculateInteger, bool rightShouldSpeculateInteger)
     193    AddSpeculationMode addSpeculationMode(Node* add, bool leftShouldSpeculateInt32, bool rightShouldSpeculateInt32)
    194194    {
    195195        ASSERT(add->op() == ValueAdd || add->op() == ArithAdd || add->op() == ArithSub);
     
    199199       
    200200        if (left->hasConstant())
    201             return addImmediateShouldSpeculateInteger(add, rightShouldSpeculateInteger, left);
     201            return addImmediateShouldSpeculateInt32(add, rightShouldSpeculateInt32, left);
    202202        if (right->hasConstant())
    203             return addImmediateShouldSpeculateInteger(add, leftShouldSpeculateInteger, right);
    204        
    205         return (leftShouldSpeculateInteger && rightShouldSpeculateInteger && add->canSpeculateInteger()) ? SpeculateInteger : DontSpeculateInteger;
     203            return addImmediateShouldSpeculateInt32(add, leftShouldSpeculateInt32, right);
     204       
     205        return (leftShouldSpeculateInt32 && rightShouldSpeculateInt32 && add->canSpeculateInt32()) ? SpeculateInt32 : DontSpeculateInt32;
    206206    }
    207207   
    208208    AddSpeculationMode valueAddSpeculationMode(Node* add)
    209209    {
    210         return addSpeculationMode(add, add->child1()->shouldSpeculateIntegerExpectingDefined(), add->child2()->shouldSpeculateIntegerExpectingDefined());
     210        return addSpeculationMode(add, add->child1()->shouldSpeculateInt32ExpectingDefined(), add->child2()->shouldSpeculateInt32ExpectingDefined());
    211211    }
    212212   
    213213    AddSpeculationMode arithAddSpeculationMode(Node* add)
    214214    {
    215         return addSpeculationMode(add, add->child1()->shouldSpeculateIntegerForArithmetic(), add->child2()->shouldSpeculateIntegerForArithmetic());
     215        return addSpeculationMode(add, add->child1()->shouldSpeculateInt32ForArithmetic(), add->child2()->shouldSpeculateInt32ForArithmetic());
    216216    }
    217217   
     
    224224    }
    225225   
    226     bool addShouldSpeculateInteger(Node* add)
    227     {
    228         return addSpeculationMode(add) != DontSpeculateInteger;
    229     }
    230    
    231     bool mulShouldSpeculateInteger(Node* mul)
     226    bool addShouldSpeculateInt32(Node* add)
     227    {
     228        return addSpeculationMode(add) != DontSpeculateInt32;
     229    }
     230   
     231    bool mulShouldSpeculateInt32(Node* mul)
    232232    {
    233233        ASSERT(mul->op() == ArithMul);
     
    236236        Node* right = mul->child2().node();
    237237       
    238         return Node::shouldSpeculateIntegerForArithmetic(left, right) && mul->canSpeculateInteger();
    239     }
    240    
    241     bool negateShouldSpeculateInteger(Node* negate)
     238        return Node::shouldSpeculateInt32ForArithmetic(left, right) && mul->canSpeculateInt32();
     239    }
     240   
     241    bool negateShouldSpeculateInt32(Node* negate)
    242242    {
    243243        ASSERT(negate->op() == ArithNegate);
    244         return negate->child1()->shouldSpeculateIntegerForArithmetic() && negate->canSpeculateInteger();
     244        return negate->child1()->shouldSpeculateInt32ForArithmetic() && negate->canSpeculateInt32();
    245245    }
    246246   
     
    718718    void addForDepthFirstSort(Vector<BasicBlock*>& result, Vector<BasicBlock*, 16>& worklist, HashSet<BasicBlock*>& seen, BasicBlock*);
    719719   
    720     AddSpeculationMode addImmediateShouldSpeculateInteger(Node* add, bool variableShouldSpeculateInteger, Node* immediate)
     720    AddSpeculationMode addImmediateShouldSpeculateInt32(Node* add, bool variableShouldSpeculateInt32, Node* immediate)
    721721    {
    722722        ASSERT(immediate->hasConstant());
     
    724724        JSValue immediateValue = immediate->valueOfJSConstant(m_codeBlock);
    725725        if (!immediateValue.isNumber())
    726             return DontSpeculateInteger;
    727        
    728         if (!variableShouldSpeculateInteger)
    729             return DontSpeculateInteger;
     726            return DontSpeculateInt32;
     727       
     728        if (!variableShouldSpeculateInt32)
     729            return DontSpeculateInt32;
    730730       
    731731        if (immediateValue.isInt32())
    732             return add->canSpeculateInteger() ? SpeculateInteger : DontSpeculateInteger;
     732            return add->canSpeculateInt32() ? SpeculateInt32 : DontSpeculateInt32;
    733733       
    734734        double doubleImmediate = immediateValue.asDouble();
    735735        const double twoToThe48 = 281474976710656.0;
    736736        if (doubleImmediate < -twoToThe48 || doubleImmediate > twoToThe48)
    737             return DontSpeculateInteger;
    738        
    739         return nodeCanTruncateInteger(add->arithNodeFlags()) ? SpeculateIntegerAndTruncateConstants : DontSpeculateInteger;
    740     }
    741    
    742     bool mulImmediateShouldSpeculateInteger(Node* mul, Node* variable, Node* immediate)
     737            return DontSpeculateInt32;
     738       
     739        return nodeCanTruncateInteger(add->arithNodeFlags()) ? SpeculateInt32AndTruncateConstants : DontSpeculateInt32;
     740    }
     741   
     742    bool mulImmediateShouldSpeculateInt32(Node* mul, Node* variable, Node* immediate)
    743743    {
    744744        ASSERT(immediate->hasConstant());
     
    748748            return false;
    749749       
    750         if (!variable->shouldSpeculateIntegerForArithmetic())
     750        if (!variable->shouldSpeculateInt32ForArithmetic())
    751751            return false;
    752752       
     
    756756        // rounding in a double multiplication - hence it will be equivalent to an integer
    757757        // multiplication, if we are doing int32 truncation afterwards (which is what
    758         // canSpeculateInteger() implies).
     758        // canSpeculateInt32() implies).
    759759        const int32_t twoToThe22 = 1 << 22;
    760760        if (intImmediate <= -twoToThe22 || intImmediate >= twoToThe22)
    761             return mul->canSpeculateInteger() && !nodeMayOverflow(mul->arithNodeFlags());
    762 
    763         return mul->canSpeculateInteger();
     761            return mul->canSpeculateInt32() && !nodeMayOverflow(mul->arithNodeFlags());
     762
     763        return mul->canSpeculateInt32();
    764764    }
    765765};
Note: See TracChangeset for help on using the changeset viewer.