Ignore:
Timestamp:
Mar 22, 2012, 4:24:40 PM (13 years ago)
Author:
[email protected]
Message:

DFG NodeFlags has some duplicate code and naming issues
https://bugs.webkit.org/show_bug.cgi?id=81975

Reviewed by Gavin Barraclough.

Removed most references to "ArithNodeFlags" since those are now just part
of the node flags. Fixed some renaming goofs (EdgedAsNum is once again
NodeUsedAsNum). Got rid of setArithNodeFlags() and mergeArithNodeFlags()
because the former was never called and the latter did the same things as
mergeFlags().

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::makeSafe):
(JSC::DFG::ByteCodeParser::makeDivSafe):
(JSC::DFG::ByteCodeParser::handleIntrinsic):

  • dfg/DFGGraph.cpp:

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

  • dfg/DFGNode.h:

(JSC::DFG::Node::arithNodeFlags):
(Node):

  • dfg/DFGNodeFlags.cpp:

(JSC::DFG::nodeFlagsAsString):

  • dfg/DFGNodeFlags.h:

(DFG):
(JSC::DFG::nodeUsedAsNumber):

  • dfg/DFGPredictionPropagationPhase.cpp:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGNodeFlags.cpp

    r111254 r111781  
    3333namespace JSC { namespace DFG {
    3434
    35 const char* arithNodeFlagsAsString(NodeFlags flags)
     35const char* nodeFlagsAsString(NodeFlags flags)
    3636{
    37     flags &= NodeArithMask;
    38    
    3937    if (!flags)
    4038        return "<empty>";
    4139
    42     static const int size = 64;
     40    static const int size = 128;
    4341    static char description[size];
    4442    BoundsCheckedPointer<char> ptr(description, size);
     
    4644    bool hasPrinted = false;
    4745   
    48     if (flags & EdgedAsNumber) {
     46    if (flags & NodeResultMask) {
     47        switch (flags & NodeResultMask) {
     48        case NodeResultJS:
     49            ptr.strcat("ResultJS");
     50            break;
     51        case NodeResultNumber:
     52            ptr.strcat("ResultNumber");
     53            break;
     54        case NodeResultInt32:
     55            ptr.strcat("ResultInt32");
     56            break;
     57        case NodeResultBoolean:
     58            ptr.strcat("ResultBoolean");
     59            break;
     60        case NodeResultStorage:
     61            ptr.strcat("ResultStorage");
     62            break;
     63        default:
     64            ASSERT_NOT_REACHED();
     65            break;
     66        }
     67        hasPrinted = true;
     68    }
     69   
     70    if (flags & NodeMustGenerate) {
     71        if (hasPrinted)
     72            ptr.strcat("|");
     73        ptr.strcat("MustGenerate");
     74        hasPrinted = true;
     75    }
     76   
     77    if (flags & NodeHasVarArgs) {
     78        if (hasPrinted)
     79            ptr.strcat("|");
     80        ptr.strcat("HasVarArgs");
     81        hasPrinted = true;
     82    }
     83   
     84    if (flags & NodeClobbersWorld) {
     85        if (hasPrinted)
     86            ptr.strcat("|");
     87        ptr.strcat("ClobbersWorld");
     88        hasPrinted = true;
     89    }
     90   
     91    if (flags & NodeMightClobber) {
     92        if (hasPrinted)
     93            ptr.strcat("|");
     94        ptr.strcat("MightClobber");
     95        hasPrinted = true;
     96    }
     97   
     98    if (flags & NodeUsedAsNumber) {
     99        if (hasPrinted)
     100            ptr.strcat("|");
    49101        ptr.strcat("UsedAsNum");
    50102        hasPrinted = true;
Note: See TracChangeset for help on using the changeset viewer.