Changeset 95594 in webkit
- Timestamp:
- Sep 20, 2011 7:22:52 PM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r95564 r95594 1 2011-09-20 Filip Pizlo <fpizlo@apple.com> 2 3 DFG JIT always speculates integer on modulo 4 https://bugs.webkit.org/show_bug.cgi?id=68485 5 6 Reviewed by Oliver Hunt. 7 8 Added support for double modulo, which is a call to fmod(). 9 Also added support for recording the old JIT's statistics 10 on op_mod and propagating them along the graph. Finally, 11 fixed a goof in the ArithNodeFlags propagation logic that 12 was made obvious when I started testing ArithMod. 13 14 * dfg/DFGByteCodeParser.cpp: 15 (JSC::DFG::ByteCodeParser::makeSafe): 16 (JSC::DFG::ByteCodeParser::parseBlock): 17 * dfg/DFGNode.h: 18 (JSC::DFG::Node::hasArithNodeFlags): 19 * dfg/DFGPropagator.cpp: 20 (JSC::DFG::Propagator::propagateArithNodeFlags): 21 (JSC::DFG::Propagator::propagateNodePredictions): 22 (JSC::DFG::Propagator::fixupNode): 23 * dfg/DFGSpeculativeJIT.cpp: 24 (JSC::DFG::SpeculativeJIT::compile): 25 1 26 2011-09-20 ChangSeok Oh <shivamidow@gmail.com> 2 27 -
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r95563 r95594 522 522 case ArithSub: 523 523 case ValueAdd: 524 case ArithMod: // for ArithMode "MayOverflow" means we tried to divide by zero, or we saw double. 524 525 m_graph[nodeIndex].mergeArithNodeFlags(NodeMayOverflow); 525 526 break; … … 898 899 NodeIndex op1 = getToNumber(currentInstruction[2].u.operand); 899 900 NodeIndex op2 = getToNumber(currentInstruction[3].u.operand); 900 set(currentInstruction[1].u.operand, addToGraph(ArithMod, op1, op2));901 set(currentInstruction[1].u.operand, makeSafe(addToGraph(ArithMod, OpInfo(NodeUseBottom), op1, op2))); 901 902 NEXT_OPCODE(op_mod); 902 903 } -
trunk/Source/JavaScriptCore/dfg/DFGNode.h
r95563 r95594 481 481 case ArithMin: 482 482 case ArithMax: 483 case ArithMod: 483 484 case ValueAdd: 484 485 return true; -
trunk/Source/JavaScriptCore/dfg/DFGPropagator.cpp
r95563 r95594 262 262 if (node.child2() == NoNode) 263 263 break; 264 changed |= m_graph[node.child 1()].mergeArithNodeFlags(flags);264 changed |= m_graph[node.child2()].mergeArithNodeFlags(flags); 265 265 if (node.child3() == NoNode) 266 266 break; … … 361 361 case BitLShift: 362 362 case BitURShift: 363 case ValueToInt32: 363 case ValueToInt32: { 364 changed |= setPrediction(makePrediction(PredictInt32, StrongPrediction)); 365 break; 366 } 367 364 368 case ArithMod: { 365 changed |= setPrediction(makePrediction(PredictInt32, StrongPrediction)); 369 PredictedType left = m_predictions[node.child1()]; 370 PredictedType right = m_predictions[node.child2()]; 371 372 if (isStrongPrediction(left) && isStrongPrediction(right)) { 373 if (isInt32Prediction(mergePredictions(left, right)) && nodeCanSpeculateInteger(node.arithNodeFlags())) 374 changed |= mergePrediction(makePrediction(PredictInt32, StrongPrediction)); 375 else 376 changed |= mergePrediction(makePrediction(PredictDouble, StrongPrediction)); 377 } 366 378 break; 367 379 } … … 622 634 case ArithMul: 623 635 case ArithMin: 624 case ArithMax: { 636 case ArithMax: 637 case ArithMod: { 625 638 if (!nodeCanSpeculateInteger(node.arithNodeFlags())) { 626 639 toDouble(node.child1()); -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r95563 r95594 1106 1106 1107 1107 case ArithMod: { 1108 if (shouldNotSpeculateInteger(node.child1()) || shouldNotSpeculateInteger(node.child2()) 1109 || !nodeCanSpeculateInteger(node.arithNodeFlags())) { 1110 SpeculateDoubleOperand op1(this, node.child1()); 1111 SpeculateDoubleOperand op2(this, node.child2()); 1112 1113 FPRReg op1FPR = op1.fpr(); 1114 FPRReg op2FPR = op2.fpr(); 1115 1116 flushRegisters(); 1117 1118 FPRResult result(this); 1119 1120 callOperation(fmod, result.fpr(), op1FPR, op2FPR); 1121 1122 doubleResult(result.fpr(), m_compileIndex); 1123 break; 1124 } 1125 1108 1126 SpeculateIntegerOperand op1(this, node.child1()); 1109 1127 SpeculateIntegerOperand op2(this, node.child2());
Note: See TracChangeset
for help on using the changeset viewer.