Changeset 260802 in webkit
- Timestamp:
- Apr 27, 2020 5:35:45 PM (4 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r260799 r260802 1 2020-04-27 Saam Barati <sbarati@apple.com> 2 3 compilePeepHoleBigInt32Branch needs to handle all conditions 4 https://bugs.webkit.org/show_bug.cgi?id=211096 5 <rdar://problem/62469971> 6 7 Reviewed by Yusuke Suzuki. 8 9 We were falling through to the generic path for all conditions which 10 weren't Equal/NotEqual. The generic path does not do speculation, so 11 it was leading to potential miscompiles because we omitted a type check. 12 Defining compilePeepHoleBigInt32Branch for other conditions is trivial, 13 so this patch just implements that. 14 15 This failure is caught by microbenchmarks/sunspider-sha1-big-int.js 16 17 * dfg/DFGSpeculativeJIT.cpp: 18 (JSC::DFG::SpeculativeJIT::compilePeepHoleBranch): 19 * dfg/DFGSpeculativeJIT64.cpp: 20 (JSC::DFG::SpeculativeJIT::compilePeepHoleBigInt32Branch): 21 1 22 2020-04-27 Jason Lawrence <lawrence.j@apple.com> 2 23 -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r260730 r260802 1717 1717 compilePeepHoleInt32Branch(node, branchNode, condition); 1718 1718 #if USE(BIGINT32) 1719 else if (node->isBinaryUseKind(BigInt32Use) && (condition == MacroAssembler::Equal || condition == MacroAssembler::NotEqual))1719 else if (node->isBinaryUseKind(BigInt32Use)) 1720 1720 compilePeepHoleBigInt32Branch(node, branchNode, condition); 1721 1721 #endif -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
r260660 r260802 1768 1768 void SpeculativeJIT::compilePeepHoleBigInt32Branch(Node* node, Node* branchNode, JITCompiler::RelationalCondition condition) 1769 1769 { 1770 // Other conditions would require unboxing the BigInt32 to get correct results on negative numbers.1771 ASSERT(condition == MacroAssembler::Equal || condition == MacroAssembler::NotEqual);1772 1773 1770 BasicBlock* taken = branchNode->branchData()->taken.block; 1774 1771 BasicBlock* notTaken = branchNode->branchData()->notTaken.block; … … 1778 1775 if (taken == nextBlock()) { 1779 1776 condition = JITCompiler::invert(condition); 1780 BasicBlock* tmp = taken; 1781 taken = notTaken; 1782 notTaken = tmp; 1777 std::swap(taken, notTaken); 1783 1778 } 1784 1779 1785 1780 SpeculateBigInt32Operand op1(this, node->child1()); 1786 1781 SpeculateBigInt32Operand op2(this, node->child2()); 1787 1788 branch64(condition, op1.gpr(), op2.gpr(), taken); 1789 jump(notTaken); 1782 GPRReg op1GPR = op1.gpr(); 1783 GPRReg op2GPR = op2.gpr(); 1784 1785 if (condition == MacroAssembler::Equal || condition == MacroAssembler::NotEqual) { 1786 branch64(condition, op1GPR, op2GPR, taken); 1787 jump(notTaken); 1788 } else { 1789 GPRTemporary lhs(this, Reuse, op1); 1790 GPRTemporary rhs(this, Reuse, op2); 1791 GPRReg lhsGPR = lhs.gpr(); 1792 GPRReg rhsGPR = rhs.gpr(); 1793 m_jit.unboxBigInt32(op1GPR, lhsGPR); 1794 m_jit.unboxBigInt32(op2GPR, rhsGPR); 1795 branch32(condition, lhsGPR, rhsGPR, taken); 1796 jump(notTaken); 1797 } 1798 1790 1799 } 1791 1800 #endif // USE(BIGINT32)
Note: See TracChangeset
for help on using the changeset viewer.