Changeset 164059 in webkit for trunk/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp
- Timestamp:
- Feb 13, 2014, 2:46:51 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp
r163946 r164059 128 128 Node* pureCSE(Node* node) 129 129 { 130 Edge child1 = node->child1() ;131 Edge child2 = node->child2() ;132 Edge child3 = node->child3() ;130 Edge child1 = node->child1().sanitized(); 131 Edge child2 = node->child2().sanitized(); 132 Edge child3 = node->child3().sanitized(); 133 133 134 134 for (unsigned i = endIndexForPureCSE(); i--;) { … … 140 140 continue; 141 141 142 if (node->hasArithMode()) { 143 if (node->arithMode() != otherNode->arithMode()) 144 continue; 145 } 146 147 Edge otherChild = otherNode->child1(); 142 Edge otherChild = otherNode->child1().sanitized(); 148 143 if (!otherChild) 149 144 return otherNode; … … 151 146 continue; 152 147 153 otherChild = otherNode->child2() ;148 otherChild = otherNode->child2().sanitized(); 154 149 if (!otherChild) 155 150 return otherNode; … … 157 152 continue; 158 153 159 otherChild = otherNode->child3() ;154 otherChild = otherNode->child3().sanitized(); 160 155 if (!otherChild) 161 156 return otherNode; … … 176 171 switch (otherNode->op()) { 177 172 case Int32ToDouble: 178 if (otherNode->child1() == node->child1())173 if (otherNode->child1().sanitized() == node->child1().sanitized()) 179 174 return otherNode; 180 175 break; … … 1096 1091 case BitLShift: 1097 1092 case BitURShift: 1098 case ArithAdd:1099 case ArithSub:1100 case ArithNegate:1101 case ArithMul:1102 case ArithMod:1103 case ArithDiv:1104 1093 case ArithAbs: 1105 1094 case ArithMin: … … 1116 1105 case IsObject: 1117 1106 case IsFunction: 1118 case DoubleAsInt32:1119 1107 case LogicalNot: 1120 1108 case SkipTopScope: … … 1132 1120 setReplacement(pureCSE(node)); 1133 1121 break; 1122 1123 case ArithAdd: 1124 case ArithSub: 1125 case ArithNegate: 1126 case ArithMul: 1127 case ArithDiv: 1128 case ArithMod: 1129 case UInt32ToNumber: 1130 case DoubleAsInt32: { 1131 if (cseMode == StoreElimination) 1132 break; 1133 Node* candidate = pureCSE(node); 1134 if (!candidate) 1135 break; 1136 if (!subsumes(candidate->arithMode(), node->arithMode())) { 1137 if (!subsumes(node->arithMode(), candidate->arithMode())) 1138 break; 1139 candidate->setArithMode(node->arithMode()); 1140 } 1141 setReplacement(candidate); 1142 break; 1143 } 1134 1144 1135 1145 case Int32ToDouble: … … 1408 1418 case Phantom: 1409 1419 // FIXME: we ought to remove Phantom's that have no children. 1420 // NB. It would be incorrect to do this for HardPhantom. In fact, the whole point 1421 // of HardPhantom is that we *don't* do this for HardPhantoms, since they signify 1422 // a more strict kind of liveness than the Phantom bytecode liveness. 1410 1423 eliminateIrrelevantPhantomChildren(node); 1411 1424 break;
Note:
See TracChangeset
for help on using the changeset viewer.