Changeset 278465 in webkit
- Timestamp:
- Jun 4, 2021 9:32:57 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r278464 r278465 1 2021-06-03 Filip Pizlo <fpizlo@apple.com> 2 3 DFG should speculate on CompareStrictEq(@x, @x) 4 https://bugs.webkit.org/show_bug.cgi?id=226621 5 6 Reviewed by Mark Lam. 7 8 * microbenchmarks/untyped-stricteq-self.js: Added. 9 (foo): 10 * stress/untyped-stricteq-self-fail.js: Added. 11 (bar): 12 (foo): 13 1 14 2021-06-04 Keith Miller <keith_miller@apple.com> 2 15 -
trunk/Source/JavaScriptCore/ChangeLog
r278463 r278465 1 2021-06-03 Filip Pizlo <fpizlo@apple.com> 2 3 DFG should speculate on CompareStrictEq(@x, @x) 4 https://bugs.webkit.org/show_bug.cgi?id=226621 5 6 Reviewed by Mark Lam. 7 8 Introduces a NotDouble: speculation. We use it to speculate on CompareStrictEq(@x, @x). 9 10 * bytecode/SpeculatedType.h: 11 (JSC::isNotDoubleSpeculation): 12 * dfg/DFGFixupPhase.cpp: 13 (JSC::DFG::FixupPhase::fixupCompareStrictEqAndSameValue): 14 * dfg/DFGNode.h: 15 (JSC::DFG::Node::shouldSpeculateNotDouble): 16 * dfg/DFGSafeToExecute.h: 17 (JSC::DFG::SafeToExecuteEdge::operator()): 18 * dfg/DFGSpeculativeJIT.cpp: 19 (JSC::DFG::SpeculativeJIT::speculateNotDouble): 20 (JSC::DFG::SpeculativeJIT::speculate): 21 * dfg/DFGSpeculativeJIT.h: 22 * dfg/DFGUseKind.cpp: 23 (WTF::printInternal): 24 * dfg/DFGUseKind.h: 25 (JSC::DFG::typeFilterFor): 26 (JSC::DFG::checkMayCrashIfInputIsEmpty): 27 * ftl/FTLCapabilities.cpp: 28 (JSC::FTL::canCompile): 29 * ftl/FTLLowerDFGToB3.cpp: 30 (JSC::FTL::DFG::LowerDFGToB3::speculate): 31 (JSC::FTL::DFG::LowerDFGToB3::speculateNotDouble): 32 1 33 2021-06-04 Robin Morisset <rmorisset@apple.com> 2 34 -
trunk/Source/JavaScriptCore/bytecode/SpeculatedType.h
r278253 r278465 440 440 } 441 441 442 inline bool isNotDoubleSpeculation(SpeculatedType type) 443 { 444 return !(type & SpecFullDouble); 445 } 446 442 447 inline bool isOtherSpeculation(SpeculatedType value) 443 448 { -
trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
r278462 r278465 4283 4283 ASSERT(node->op() == SameValue || node->op() == CompareStrictEq); 4284 4284 4285 if (node->child1().node() == node->child2().node() 4286 && node->child1()->shouldSpeculateNotDouble()) { 4287 m_insertionSet.insertNode( 4288 m_indexInBlock, SpecNone, Check, node->origin, 4289 Edge(node->child1().node(), NotDoubleUse)); 4290 m_graph.convertToConstant(node, jsBoolean(true)); 4291 return; 4292 } 4285 4293 if (Node::shouldSpeculateBoolean(node->child1().node(), node->child2().node())) { 4286 4294 fixEdge<BooleanUse>(node->child1()); -
trunk/Source/JavaScriptCore/dfg/DFGNode.h
r278445 r278465 2798 2798 return isNotCellNorBigIntSpeculation(prediction()); 2799 2799 } 2800 2801 bool shouldSpeculateNotDouble() 2802 { 2803 return isNotDoubleSpeculation(prediction()); 2804 } 2800 2805 2801 2806 bool shouldSpeculateUntypedForArithmetic() -
trunk/Source/JavaScriptCore/dfg/DFGSafeToExecute.h
r278462 r278465 93 93 case AnyIntUse: 94 94 case DoubleRepAnyIntUse: 95 case NotDoubleUse: 95 96 return; 96 97 -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r278462 r278465 11433 11433 } 11434 11434 11435 void SpeculativeJIT::speculateNotDouble(Edge edge) 11436 { 11437 JSValueOperand operand(this, edge, ManualOperandSpeculation); 11438 GPRTemporary temp(this); 11439 JSValueRegs regs = operand.jsValueRegs(); 11440 GPRReg tempGPR = temp.gpr(); 11441 11442 JITCompiler::Jump done = m_jit.branchIfInt32(regs); 11443 DFG_TYPE_CHECK(regs, edge, ~SpecFullDouble, m_jit.branchIfNumber(regs, tempGPR)); 11444 done.link(&m_jit); 11445 } 11446 11435 11447 void SpeculativeJIT::speculateOther(Edge edge, JSValueRegs regs, GPRReg tempGPR) 11436 11448 { … … 11614 11626 case NotCellNorBigIntUse: 11615 11627 speculateNotCellNorBigInt(edge); 11628 break; 11629 case NotDoubleUse: 11630 speculateNotDouble(edge); 11616 11631 break; 11617 11632 case OtherUse: -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
r278462 r278465 1672 1672 void speculateNotCell(Edge); 1673 1673 void speculateNotCellNorBigInt(Edge); 1674 void speculateNotDouble(Edge); 1674 1675 void speculateOther(Edge, JSValueRegs, GPRReg temp); 1675 1676 void speculateOther(Edge, JSValueRegs); -
trunk/Source/JavaScriptCore/dfg/DFGUseKind.cpp
r261755 r278465 171 171 out.print("NotCellNorBigInt"); 172 172 return; 173 case NotDoubleUse: 174 out.print("NotDouble"); 175 return; 173 176 case KnownOtherUse: 174 177 out.print("KnownOther"); -
trunk/Source/JavaScriptCore/dfg/DFGUseKind.h
r261147 r278465 82 82 NotCellUse, 83 83 NotCellNorBigIntUse, 84 NotDoubleUse, 84 85 KnownOtherUse, 85 86 OtherUse, … … 188 189 case NotCellNorBigIntUse: 189 190 return ~SpecCellCheck & ~SpecBigInt; 191 case NotDoubleUse: 192 return ~SpecFullDouble; 190 193 case KnownOtherUse: 191 194 case OtherUse: … … 306 309 case NotCellUse: 307 310 case NotCellNorBigIntUse: 311 case NotDoubleUse: 308 312 return false; 309 313 default: -
trunk/Source/JavaScriptCore/ftl/FTLCapabilities.cpp
r278462 r278465 529 529 case AnyIntUse: 530 530 case DoubleRepAnyIntUse: 531 case NotDoubleUse: 531 532 // These are OK. 532 533 break; -
trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
r278463 r278465 18404 18404 speculateNotCellNorBigInt(edge); 18405 18405 break; 18406 case NotDoubleUse: 18407 speculateNotDouble(edge); 18408 break; 18406 18409 case OtherUse: 18407 18410 speculateOther(edge); … … 18447 18450 speculateNotCell(edge); 18448 18451 #endif 18452 } 18453 18454 void speculateNotDouble(Edge edge) 18455 { 18456 LValue value = lowJSValue(edge, ManualOperandSpeculation); 18457 18458 LBasicBlock isNotInt32 = m_out.newBlock(); 18459 LBasicBlock continuation = m_out.newBlock(); 18460 18461 m_out.branch(isInt32(value, provenType(edge)), unsure(continuation), unsure(isNotInt32)); 18462 18463 LBasicBlock lastNext = m_out.appendTo(isNotInt32, continuation); 18464 FTL_TYPE_CHECK(jsValueValue(value), edge, ~SpecFullDouble, isNumber(value)); 18465 m_out.jump(continuation); 18466 18467 m_out.appendTo(continuation, lastNext); 18449 18468 } 18450 18469
Note: See TracChangeset
for help on using the changeset viewer.