Changeset 188747 in webkit
- Timestamp:
- Aug 20, 2015 8:59:33 PM (9 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r188720 r188747 1 2015-08-20 Filip Pizlo <fpizlo@apple.com> 2 3 DFG should have a KnownBooleanUse for cases where we are required to know that the child is a boolean and it's not OK to speculate 4 https://bugs.webkit.org/show_bug.cgi?id=148286 5 6 Reviewed by Benjamin Poulain. 7 8 This enables us to ensure that the Branch or LogicalNot after an effectful CompareXYZ can 9 be marked as !mayExit(). I need that for https://bugs.webkit.org/show_bug.cgi?id=145204. 10 11 * dfg/DFGFixupPhase.cpp: 12 (JSC::DFG::FixupPhase::fixupNode): 13 (JSC::DFG::FixupPhase::observeUseKindOnNode): 14 * dfg/DFGSafeToExecute.h: 15 (JSC::DFG::SafeToExecuteEdge::operator()): 16 * dfg/DFGSpeculativeJIT.cpp: 17 (JSC::DFG::SpeculativeJIT::speculate): 18 * dfg/DFGSpeculativeJIT.h: 19 (JSC::DFG::SpeculateBooleanOperand::SpeculateBooleanOperand): 20 * dfg/DFGSpeculativeJIT32_64.cpp: 21 (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean): 22 (JSC::DFG::SpeculativeJIT::compileLogicalNot): 23 (JSC::DFG::SpeculativeJIT::emitBranch): 24 * dfg/DFGSpeculativeJIT64.cpp: 25 (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean): 26 (JSC::DFG::SpeculativeJIT::compileLogicalNot): 27 (JSC::DFG::SpeculativeJIT::emitBranch): 28 * dfg/DFGUseKind.cpp: 29 (WTF::printInternal): 30 * dfg/DFGUseKind.h: 31 (JSC::DFG::typeFilterFor): 32 (JSC::DFG::shouldNotHaveTypeCheck): 33 * ftl/FTLCapabilities.cpp: 34 (JSC::FTL::canCompile): 35 * ftl/FTLLowerDFGToLLVM.cpp: 36 (JSC::FTL::DFG::LowerDFGToLLVM::boolify): 37 (JSC::FTL::DFG::LowerDFGToLLVM::lowBoolean): 38 1 39 2015-08-20 Filip Pizlo <fpizlo@apple.com> 2 40 -
trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
r188624 r188747 357 357 358 358 case LogicalNot: { 359 if (node->child1()->shouldSpeculateBoolean()) 360 fixEdge<BooleanUse>(node->child1()); 361 else if (node->child1()->shouldSpeculateObjectOrOther()) 359 if (node->child1()->shouldSpeculateBoolean()) { 360 if (node->child1()->result() == NodeResultBoolean) { 361 // This is necessary in case we have a bytecode instruction implemented by: 362 // 363 // a: CompareEq(...) 364 // b: LogicalNot(@a) 365 // 366 // In that case, CompareEq might have a side-effect. Then, we need to make 367 // sure that we know that Branch does not exit. 368 fixEdge<KnownBooleanUse>(node->child1()); 369 } else 370 fixEdge<BooleanUse>(node->child1()); 371 } else if (node->child1()->shouldSpeculateObjectOrOther()) 362 372 fixEdge<ObjectOrOtherUse>(node->child1()); 363 373 else if (node->child1()->shouldSpeculateInt32OrBoolean()) … … 820 830 821 831 case Branch: { 822 if (node->child1()->shouldSpeculateBoolean()) 823 fixEdge<BooleanUse>(node->child1()); 824 else if (node->child1()->shouldSpeculateObjectOrOther()) 832 if (node->child1()->shouldSpeculateBoolean()) { 833 if (node->child1()->result() == NodeResultBoolean) { 834 // This is necessary in case we have a bytecode instruction implemented by: 835 // 836 // a: CompareEq(...) 837 // b: Branch(@a) 838 // 839 // In that case, CompareEq might have a side-effect. Then, we need to make 840 // sure that we know that Branch does not exit. 841 fixEdge<KnownBooleanUse>(node->child1()); 842 } else 843 fixEdge<BooleanUse>(node->child1()); 844 } else if (node->child1()->shouldSpeculateObjectOrOther()) 825 845 fixEdge<ObjectOrOtherUse>(node->child1()); 826 846 else if (node->child1()->shouldSpeculateInt32OrBoolean()) … … 1778 1798 switch (useKind) { 1779 1799 case Int32Use: 1800 case KnownInt32Use: 1780 1801 if (alwaysUnboxSimplePrimitives() 1781 1802 || isInt32Speculation(variable->prediction())) … … 1790 1811 break; 1791 1812 case BooleanUse: 1813 case KnownBooleanUse: 1792 1814 if (alwaysUnboxSimplePrimitives() 1793 1815 || isBooleanSpeculation(variable->prediction())) -
trunk/Source/JavaScriptCore/dfg/DFGSafeToExecute.h
r188624 r188747 73 73 case KnownInt32Use: 74 74 if (m_state.forNode(edge).m_type & ~SpecInt32) 75 m_result = false; 76 return; 77 78 case KnownBooleanUse: 79 if (m_state.forNode(edge).m_type & ~SpecBoolean) 75 80 m_result = false; 76 81 return; -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r188624 r188747 5909 5909 speculateBoolean(edge); 5910 5910 break; 5911 case KnownBooleanUse: 5912 ASSERT(!needsTypeCheck(edge, SpecBoolean)); 5913 break; 5911 5914 case CellUse: 5912 5915 speculateCell(edge); -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
r188624 r188747 3246 3246 { 3247 3247 ASSERT(m_jit); 3248 ASSERT_UNUSED(mode, mode == ManualOperandSpeculation || edge.useKind() == BooleanUse );3248 ASSERT_UNUSED(mode, mode == ManualOperandSpeculation || edge.useKind() == BooleanUse || edge.useKind() == KnownBooleanUse); 3249 3249 if (jit->isFilled(node())) 3250 3250 gpr(); -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
r188649 r188747 1034 1034 AbstractValue& value = m_state.forNode(edge); 1035 1035 SpeculatedType type = value.m_type; 1036 ASSERT(edge.useKind() != KnownBooleanUse || !(value.m_type & ~SpecBoolean)); 1036 1037 1037 1038 m_interpreter.filter(value, SpecBoolean); … … 1464 1465 { 1465 1466 switch (node->child1().useKind()) { 1466 case BooleanUse: { 1467 case BooleanUse: 1468 case KnownBooleanUse: { 1467 1469 SpeculateBooleanOperand value(this, node->child1()); 1468 1470 GPRTemporary result(this, Reuse, value); … … 1583 1585 1584 1586 switch (node->child1().useKind()) { 1585 case BooleanUse: { 1587 case BooleanUse: 1588 case KnownBooleanUse: { 1586 1589 SpeculateBooleanOperand value(this, node->child1()); 1587 1590 MacroAssembler::ResultCondition condition = MacroAssembler::NonZero; -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
r188649 r188747 1140 1140 AbstractValue& value = m_state.forNode(edge); 1141 1141 SpeculatedType type = value.m_type; 1142 ASSERT(edge.useKind() != KnownBooleanUse || !(value.m_type & ~SpecBoolean)); 1142 1143 1143 1144 m_interpreter.filter(value, SpecBoolean); … … 1618 1619 } 1619 1620 1620 case BooleanUse: { 1621 case BooleanUse: 1622 case KnownBooleanUse: { 1621 1623 if (!needsTypeCheck(node->child1(), SpecBoolean)) { 1622 1624 SpeculateBooleanOperand value(this, node->child1()); … … 1770 1772 1771 1773 case UntypedUse: 1772 case BooleanUse: { 1774 case BooleanUse: 1775 case KnownBooleanUse: { 1773 1776 JSValueOperand value(this, node->child1(), ManualOperandSpeculation); 1774 1777 GPRReg valueGPR = value.gpr(); 1775 1778 1776 if (node->child1().useKind() == BooleanUse ) {1779 if (node->child1().useKind() == BooleanUse || node->child1().useKind() == KnownBooleanUse) { 1777 1780 if (!needsTypeCheck(node->child1(), SpecBoolean)) { 1778 1781 MacroAssembler::ResultCondition condition = MacroAssembler::NonZero; -
trunk/Source/JavaScriptCore/dfg/DFGUseKind.cpp
r188299 r188747 71 71 out.print("Boolean"); 72 72 return; 73 case KnownBooleanUse: 74 out.print("KnownBoolean"); 75 return; 73 76 case CellUse: 74 77 out.print("Cell"); -
trunk/Source/JavaScriptCore/dfg/DFGUseKind.h
r188299 r188747 49 49 RealNumberUse, 50 50 BooleanUse, 51 KnownBooleanUse, 51 52 CellUse, 52 53 KnownCellUse, … … 102 103 return SpecInt52AsDouble; 103 104 case BooleanUse: 105 case KnownBooleanUse: 104 106 return SpecBoolean; 105 107 case CellUse: … … 146 148 case KnownCellUse: 147 149 case KnownStringUse: 150 case KnownBooleanUse: 148 151 case Int52RepUse: 149 152 case DoubleRepUse: -
trunk/Source/JavaScriptCore/ftl/FTLCapabilities.cpp
r188649 r188747 413 413 case DoubleRepRealUse: 414 414 case BooleanUse: 415 case KnownBooleanUse: 415 416 case CellUse: 416 417 case KnownCellUse: -
trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp
r188649 r188747 6131 6131 switch (edge.useKind()) { 6132 6132 case BooleanUse: 6133 case KnownBooleanUse: 6133 6134 return lowBoolean(edge); 6134 6135 case Int32Use: … … 7121 7122 LValue lowBoolean(Edge edge, OperandSpeculationMode mode = AutomaticOperandSpeculation) 7122 7123 { 7123 ASSERT_UNUSED(mode, mode == ManualOperandSpeculation || edge.useKind() == BooleanUse );7124 ASSERT_UNUSED(mode, mode == ManualOperandSpeculation || edge.useKind() == BooleanUse || edge.useKind() == KnownBooleanUse); 7124 7125 7125 7126 if (edge->hasConstant()) {
Note: See TracChangeset
for help on using the changeset viewer.