Changeset 96482 in webkit


Ignore:
Timestamp:
Oct 2, 2011 7:13:11 PM (13 years ago)
Author:
fpizlo@apple.com
Message:

DFG misses some obvious opportunities for common subexpression elimination
https://bugs.webkit.org/show_bug.cgi?id=69233

Reviewed by Oliver Hunt.

0.7% speed-up on SunSpider.

  • dfg/DFGPropagator.cpp:

(JSC::DFG::Propagator::getByValLoadElimination):
(JSC::DFG::Propagator::getMethodLoadElimination):
(JSC::DFG::Propagator::checkStructureLoadElimination):
(JSC::DFG::Propagator::getByOffsetLoadElimination):
(JSC::DFG::Propagator::getPropertyStorageLoadElimination):
(JSC::DFG::Propagator::performNodeCSE):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r96479 r96482  
     12011-10-02  Filip Pizlo  <fpizlo@apple.com>
     2
     3        DFG misses some obvious opportunities for common subexpression elimination
     4        https://bugs.webkit.org/show_bug.cgi?id=69233
     5
     6        Reviewed by Oliver Hunt.
     7       
     8        0.7% speed-up on SunSpider.
     9
     10        * dfg/DFGPropagator.cpp:
     11        (JSC::DFG::Propagator::getByValLoadElimination):
     12        (JSC::DFG::Propagator::getMethodLoadElimination):
     13        (JSC::DFG::Propagator::checkStructureLoadElimination):
     14        (JSC::DFG::Propagator::getByOffsetLoadElimination):
     15        (JSC::DFG::Propagator::getPropertyStorageLoadElimination):
     16        (JSC::DFG::Propagator::performNodeCSE):
     17
    1182011-10-02  Gavin Barraclough  <barraclough@apple.com>
    219
  • trunk/Source/JavaScriptCore/dfg/DFGPropagator.cpp

    r96461 r96482  
    965965                    return node.child3();
    966966                break;
     967            case PutStructure:
     968            case PutByOffset:
     969                // GetByVal currently always speculates that it's accessing an
     970                // array with an integer index, which means that it's impossible
     971                // for a structure change or a put to property storage to affect
     972                // the GetByVal.
     973                break;
    967974            default:
    968                 break;
    969             }
    970             if (clobbersWorld(index))
    971                 break;
     975                if (clobbersWorld(index))
     976                    return NoNode;
     977                break;
     978            }
    972979        }
    973980        return NoNode;
     
    979986        for (NodeIndex index = m_compileIndex; index-- > start;) {
    980987            Node& node = m_graph[index];
    981             if (node.op == CheckMethod
    982                 && node.child1() == child1
    983                 && node.identifierNumber() == identifierNumber
    984                 && m_graph.m_methodCheckData[node.methodCheckDataIndex()] == methodCheckData)
    985                 return index;
    986             if (clobbersWorld(index))
    987                 break;
     988            switch (node.op) {
     989            case CheckMethod:
     990                if (node.child1() == child1
     991                    && node.identifierNumber() == identifierNumber
     992                    && m_graph.m_methodCheckData[node.methodCheckDataIndex()] == methodCheckData)
     993                    return index;
     994                break;
     995               
     996            case PutByOffset:
     997                // If a put was optimized to by-offset then it's not changing the structure
     998                break;
     999               
     1000            case PutByVal:
     1001            case PutByValAlias:
     1002                // PutByVal currently always speculates that it's accessing an array with an
     1003                // integer index, which means that it's impossible for it to cause a structure
     1004                // change.
     1005                break;
     1006               
     1007            default:
     1008                if (clobbersWorld(index))
     1009                    return NoNode;
     1010                break;
     1011            }
    9881012        }
    9891013        return NoNode;
     
    10121036                break;
    10131037               
     1038            case PutByVal:
     1039            case PutByValAlias:
     1040                // PutByVal currently always speculates that it's accessing an array with an
     1041                // integer index, which means that it's impossible for it to cause a structure
     1042                // change.
     1043                break;
     1044               
    10141045            default:
    10151046                if (clobbersWorld(index))
     
    10451076                break;
    10461077               
     1078            case PutByVal:
     1079            case PutByValAlias:
     1080                // PutByVal currently always speculates that it's accessing an array with an
     1081                // integer index, which means that it's impossible for it to cause a structure
     1082                // change.
     1083                break;
     1084               
    10471085            default:
    10481086                if (clobbersWorld(index))
     
    10691107                // Changing the structure or putting to the storage cannot
    10701108                // change the property storage pointer.
     1109                break;
     1110               
     1111            case PutByVal:
     1112            case PutByValAlias:
     1113                // PutByVal currently always speculates that it's accessing an array with an
     1114                // integer index, which means that it's impossible for it to cause a structure
     1115                // change.
    10711116                break;
    10721117               
     
    11921237        case ArithSqrt:
    11931238        case GetCallee:
    1194         case GetArrayLength:
    11951239        case GetStringLength:
    11961240            setReplacement(pureCSE(node));
     1241            break;
     1242           
     1243        case GetArrayLength:
     1244            setReplacement(impureCSE(node));
    11971245            break;
    11981246           
Note: See TracChangeset for help on using the changeset viewer.