Changeset 156029 in webkit for trunk/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
- Timestamp:
- Sep 18, 2013, 12:25:52 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
r156019 r156029 117 117 SpeculatedType speculatedDoubleTypeForPrediction(SpeculatedType value) 118 118 { 119 if (!is FullNumberSpeculation(value))119 if (!isNumberSpeculation(value)) 120 120 return SpecDouble; 121 121 if (value & SpecDoubleNaN) … … 143 143 case WeakJSConstant: { 144 144 SpeculatedType type = speculationFromValue(m_graph.valueOfJSConstant(node)); 145 if (type == SpecInt 52AsDouble)146 type = SpecInt 52;145 if (type == SpecInt48AsDouble) 146 type = SpecInt48; 147 147 changed |= setPrediction(type); 148 148 break; … … 150 150 151 151 case GetLocal: { 152 VariableAccessData* variable = node->variableAccessData(); 153 SpeculatedType prediction = variable->prediction(); 154 if (variable->shouldNeverUnbox() && (prediction & SpecInt52)) 155 prediction = (prediction | SpecInt52AsDouble) & ~SpecInt52; 152 VariableAccessData* variableAccessData = node->variableAccessData(); 153 SpeculatedType prediction = variableAccessData->prediction(); 156 154 if (prediction) 157 155 changed |= mergePrediction(prediction); … … 206 204 changed |= mergePrediction(SpecInt32); 207 205 else 208 changed |= mergePrediction(Spec BytecodeNumber);206 changed |= mergePrediction(SpecNumber); 209 207 break; 210 208 } … … 215 213 216 214 if (left && right) { 217 if (is FullNumberSpeculationExpectingDefined(left) && isFullNumberSpeculationExpectingDefined(right)) {215 if (isNumberSpeculationExpectingDefined(left) && isNumberSpeculationExpectingDefined(right)) { 218 216 if (m_graph.addSpeculationMode(node) != DontSpeculateInt32) 219 217 changed |= mergePrediction(SpecInt32); 220 218 else if (m_graph.addShouldSpeculateMachineInt(node)) 221 changed |= mergePrediction(SpecInt 52);219 changed |= mergePrediction(SpecInt48); 222 220 else 223 221 changed |= mergePrediction(speculatedDoubleTypeForPredictions(left, right)); 224 } else if (!(left & Spec FullNumber) || !(right & SpecFullNumber)) {222 } else if (!(left & SpecNumber) || !(right & SpecNumber)) { 225 223 // left or right is definitely something other than a number. 226 224 changed |= mergePrediction(SpecString); … … 239 237 changed |= mergePrediction(SpecInt32); 240 238 else if (m_graph.addShouldSpeculateMachineInt(node)) 241 changed |= mergePrediction(SpecInt 52);239 changed |= mergePrediction(SpecInt48); 242 240 else 243 241 changed |= mergePrediction(speculatedDoubleTypeForPredictions(left, right)); … … 254 252 changed |= mergePrediction(SpecInt32); 255 253 else if (m_graph.addShouldSpeculateMachineInt(node)) 256 changed |= mergePrediction(SpecInt 52);254 changed |= mergePrediction(SpecInt48); 257 255 else 258 256 changed |= mergePrediction(speculatedDoubleTypeForPredictions(left, right)); … … 266 264 changed |= mergePrediction(SpecInt32); 267 265 else if (m_graph.negateShouldSpeculateMachineInt(node)) 268 changed |= mergePrediction(SpecInt 52);266 changed |= mergePrediction(SpecInt48); 269 267 else 270 268 changed |= mergePrediction(speculatedDoubleTypeForPrediction(node->child1()->prediction())); … … 295 293 changed |= mergePrediction(SpecInt32); 296 294 else if (m_graph.mulShouldSpeculateMachineInt(node)) 297 changed |= mergePrediction(SpecInt 52);295 changed |= mergePrediction(SpecInt48); 298 296 else 299 297 changed |= mergePrediction(speculatedDoubleTypeForPredictions(left, right)); … … 371 369 372 370 case GetByVal: { 373 if (!node->child1()->prediction())374 break;375 if (!node->getHeapPrediction())376 break;377 378 371 if (node->child1()->shouldSpeculateFloat32Array() 379 372 || node->child1()->shouldSpeculateFloat64Array()) 380 373 changed |= mergePrediction(SpecDouble); 381 else if (node->child1()->shouldSpeculateUint32Array()) { 382 if (isInt32Speculation(node->getHeapPrediction())) 383 changed |= mergePrediction(SpecInt32); 384 else 385 changed |= mergePrediction(SpecInt52); 386 } else 374 else 387 375 changed |= mergePrediction(node->getHeapPrediction()); 388 376 break; … … 579 567 case Unreachable: 580 568 case LoopHint: 581 case Int52ToValue:582 case Int52ToDouble:583 569 break; 584 570 … … 655 641 DoubleBallot ballot; 656 642 657 if (isFullNumberSpeculationExpectingDefined(left) && isFullNumberSpeculationExpectingDefined(right) 658 && !m_graph.addShouldSpeculateInt32(node) 659 && !m_graph.addShouldSpeculateMachineInt(node)) 643 if (isNumberSpeculationExpectingDefined(left) && isNumberSpeculationExpectingDefined(right) 644 && !m_graph.addShouldSpeculateInt32(node)) 660 645 ballot = VoteDouble; 661 646 else … … 673 658 DoubleBallot ballot; 674 659 675 if (isFullNumberSpeculation(left) && isFullNumberSpeculation(right) 676 && !m_graph.mulShouldSpeculateInt32(node) 677 && !m_graph.mulShouldSpeculateMachineInt(node)) 660 if (isNumberSpeculation(left) && isNumberSpeculation(right) 661 && !m_graph.mulShouldSpeculateInt32(node)) 678 662 ballot = VoteDouble; 679 663 else … … 694 678 DoubleBallot ballot; 695 679 696 if (is FullNumberSpeculation(left) && isFullNumberSpeculation(right)680 if (isNumberSpeculation(left) && isNumberSpeculation(right) 697 681 && !(Node::shouldSpeculateInt32ForArithmetic(node->child1().node(), node->child2().node()) && node->canSpeculateInt32())) 698 682 ballot = VoteDouble; … … 723 707 if (isDoubleSpeculation(prediction)) 724 708 node->variableAccessData()->vote(VoteDouble); 725 else if ( 726 !isFullNumberSpeculation(prediction) 727 || isInt32Speculation(prediction) || isMachineIntSpeculation(prediction)) 709 else if (!isNumberSpeculation(prediction) || isInt32Speculation(prediction)) 728 710 node->variableAccessData()->vote(VoteValue); 729 711 break;
Note:
See TracChangeset
for help on using the changeset viewer.