Changeset 96280 in webkit
- Timestamp:
- Sep 28, 2011 5:47:07 PM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r96259 r96280 1 2011-09-28 Filip Pizlo <fpizlo@apple.com> 2 3 DFG JIT falls back on numerical comparisons when it does not 4 recognize a prediction 5 https://bugs.webkit.org/show_bug.cgi?id=68977 6 7 Reviewed by Geoffrey Garen. 8 9 This fixes both the way comparison implementations are selected. It 10 also fixes a bug where comparisons other than equality (like < or >) 11 on objects are compiled as if the comparison was equality. 12 13 * dfg/DFGSpeculativeJIT.cpp: 14 (JSC::DFG::SpeculativeJIT::compare): 15 1 16 2011-09-28 Gavin Barraclough <barraclough@apple.com> 2 17 -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r96247 r96280 651 651 return true; 652 652 } 653 654 if (shouldSpeculateFinalObject(node.child1(), node.child2())) 655 compileObjectEquality(node, m_jit.globalData()->jsFinalObjectVPtr); 656 else if (shouldSpeculateArray(node.child1(), node.child2())) 657 compileObjectEquality(node, m_jit.globalData()->jsArrayVPtr); 658 else if (!shouldSpeculateNumber(node.child1()) && !shouldSpeculateNumber(node.child2())) 659 nonSpeculativeNonPeepholeCompare(node, condition, operation); 660 else if ((shouldSpeculateNumber(node.child1()) || shouldSpeculateNumber(node.child2())) && !shouldSpeculateInteger(node.child1(), node.child2())) { 661 // Normal case, not fused to branch. 653 654 if (shouldSpeculateInteger(node.child1(), node.child2())) { 655 SpeculateIntegerOperand op1(this, node.child1()); 656 SpeculateIntegerOperand op2(this, node.child2()); 657 GPRTemporary result(this, op1, op2); 658 659 m_jit.compare32(condition, op1.gpr(), op2.gpr(), result.gpr()); 660 661 // If we add a DataFormatBool, we should use it here. 662 m_jit.or32(TrustedImm32(ValueFalse), result.gpr()); 663 jsValueResult(result.gpr(), m_compileIndex, DataFormatJSBoolean); 664 } else if (shouldSpeculateNumber(node.child1(), node.child2())) { 662 665 SpeculateDoubleOperand op1(this, node.child1()); 663 666 SpeculateDoubleOperand op2(this, node.child2()); … … 670 673 671 674 jsValueResult(result.gpr(), m_compileIndex, DataFormatJSBoolean); 672 } else { 673 // Normal case, not fused to branch. 674 SpeculateIntegerOperand op1(this, node.child1()); 675 SpeculateIntegerOperand op2(this, node.child2()); 676 GPRTemporary result(this, op1, op2); 677 678 m_jit.compare32(condition, op1.gpr(), op2.gpr(), result.gpr()); 679 680 // If we add a DataFormatBool, we should use it here. 681 m_jit.or32(TrustedImm32(ValueFalse), result.gpr()); 682 jsValueResult(result.gpr(), m_compileIndex, DataFormatJSBoolean); 683 } 675 } else if (node.op == CompareEq && shouldSpeculateFinalObject(node.child1(), node.child2())) 676 compileObjectEquality(node, m_jit.globalData()->jsFinalObjectVPtr); 677 else if (node.op == CompareEq && shouldSpeculateArray(node.child1(), node.child2())) 678 compileObjectEquality(node, m_jit.globalData()->jsArrayVPtr); 679 else 680 nonSpeculativeNonPeepholeCompare(node, condition, operation); 684 681 685 682 return false;
Note: See TracChangeset
for help on using the changeset viewer.