Changeset 206047 in webkit
- Timestamp:
- Sep 16, 2016 2:17:33 PM (8 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r206018 r206047 1 2016-09-16 Yusuke Suzuki <utatane.tea@gmail.com> 2 3 [DFG] Introduce ArrayUse 4 https://bugs.webkit.org/show_bug.cgi?id=162063 5 6 Reviewed by Keith Miller. 7 8 ArrayUse is particularly useful: for IsJSArray. 9 We can drop IsJSArray in fixup phase by setting ArrayUse edge filter. 10 11 Since @isJSArray user is limited (Array.prototype.concat), the effect of this patch is small. 12 But later, I'll update {@isArray, Array.isArray} to use @isJSArray[1]. In that patch, we are planning 13 to implement more aggressive optimization like, setting CellUse edge filter to avoid cell check in 14 SpeculativeJIT::compileIsJSArray. 15 16 In the benchmark using Array.prototype.concat, we can see perf improvement since we can drop IsJSArray in fixup phase. 17 18 baseline patched 19 20 lazy-array-species-watchpoints 25.0911+-0.0516 ^ 24.7687+-0.0767 ^ definitely 1.0130x faster 21 22 [1]: https://bugs.webkit.org/show_bug.cgi?id=162000 23 24 * dfg/DFGFixupPhase.cpp: 25 (JSC::DFG::FixupPhase::fixupNode): 26 * dfg/DFGSafeToExecute.h: 27 (JSC::DFG::SafeToExecuteEdge::operator()): 28 * dfg/DFGSpeculativeJIT.cpp: 29 (JSC::DFG::SpeculativeJIT::speculateArray): 30 (JSC::DFG::SpeculativeJIT::speculate): 31 * dfg/DFGSpeculativeJIT.h: 32 * dfg/DFGUseKind.cpp: 33 (WTF::printInternal): 34 * dfg/DFGUseKind.h: 35 (JSC::DFG::typeFilterFor): 36 (JSC::DFG::isCell): 37 * ftl/FTLCapabilities.cpp: 38 (JSC::FTL::canCompile): 39 * ftl/FTLLowerDFGToB3.cpp: 40 (JSC::FTL::DFG::LowerDFGToB3::speculate): 41 (JSC::FTL::DFG::LowerDFGToB3::speculateArray): 42 (JSC::FTL::DFG::LowerDFGToB3::speculateObject): Deleted. 43 1 44 2016-09-16 Joseph Pecoraro <pecoraro@apple.com> 2 45 -
trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
r205974 r206047 1418 1418 break; 1419 1419 1420 case IsJSArray: 1421 if (node->child1()->shouldSpeculateArray()) { 1422 m_insertionSet.insertNode( 1423 m_indexInBlock, SpecNone, Check, node->origin, 1424 Edge(node->child1().node(), ArrayUse)); 1425 m_graph.convertToConstant(node, jsBoolean(true)); 1426 observeUseKindOnNode<ArrayUse>(node); 1427 } 1428 break; 1429 1420 1430 case GetEnumerableLength: { 1421 1431 fixEdge<CellUse>(node->child1()); … … 1623 1633 case DeleteById: 1624 1634 case DeleteByVal: 1625 case IsJSArray:1626 1635 case IsTypedArrayView: 1627 1636 case IsEmpty: -
trunk/Source/JavaScriptCore/dfg/DFGSafeToExecute.h
r205828 r206047 56 56 case CellOrOtherUse: 57 57 case ObjectUse: 58 case ArrayUse: 58 59 case FunctionUse: 59 60 case FinalObjectUse: -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r205974 r206047 7395 7395 } 7396 7396 7397 void SpeculativeJIT::speculateArray(Edge edge, GPRReg cell) 7398 { 7399 speculateCellType(edge, cell, SpecArray, ArrayType); 7400 } 7401 7402 void SpeculativeJIT::speculateArray(Edge edge) 7403 { 7404 if (!needsTypeCheck(edge, SpecArray)) 7405 return; 7406 7407 SpeculateCellOperand operand(this, edge); 7408 speculateArray(edge, operand.gpr()); 7409 } 7410 7397 7411 void SpeculativeJIT::speculateMapObject(Edge edge, GPRReg cell) 7398 7412 { … … 7703 7717 case FunctionUse: 7704 7718 speculateFunction(edge); 7719 break; 7720 case ArrayUse: 7721 speculateArray(edge); 7705 7722 break; 7706 7723 case FinalObjectUse: -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
r205828 r206047 2675 2675 void speculateCellOrOther(Edge); 2676 2676 void speculateObject(Edge); 2677 void speculateArray(Edge, GPRReg cell); 2678 void speculateArray(Edge); 2677 2679 void speculateFunction(Edge); 2678 2680 void speculateFinalObject(Edge); -
trunk/Source/JavaScriptCore/dfg/DFGUseKind.cpp
r205520 r206047 86 86 out.print("Object"); 87 87 return; 88 case ArrayUse: 89 out.print("Array"); 90 return; 88 91 case FunctionUse: 89 92 out.print("Function"); -
trunk/Source/JavaScriptCore/dfg/DFGUseKind.h
r205520 r206047 54 54 CellOrOtherUse, 55 55 ObjectUse, 56 ArrayUse, 56 57 FunctionUse, 57 58 FinalObjectUse, … … 118 119 case ObjectUse: 119 120 return SpecObject; 121 case ArrayUse: 122 return SpecArray; 120 123 case FunctionUse: 121 124 return SpecFunction; … … 219 222 case KnownCellUse: 220 223 case ObjectUse: 224 case ArrayUse: 221 225 case FunctionUse: 222 226 case FinalObjectUse: -
trunk/Source/JavaScriptCore/ftl/FTLCapabilities.cpp
r205830 r206047 423 423 case CellOrOtherUse: 424 424 case ObjectUse: 425 case ArrayUse: 425 426 case FunctionUse: 426 427 case ObjectOrOtherUse: -
trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
r205974 r206047 10677 10677 speculateObject(edge); 10678 10678 break; 10679 case ArrayUse: 10680 speculateArray(edge); 10681 break; 10679 10682 case FunctionUse: 10680 10683 speculateFunction(edge); … … 10961 10964 speculateObject(edge, lowCell(edge)); 10962 10965 } 10966 10967 void speculateArray(Edge edge, LValue cell) 10968 { 10969 FTL_TYPE_CHECK( 10970 jsValueValue(cell), edge, SpecArray, isNotType(cell, ArrayType)); 10971 } 10972 10973 void speculateArray(Edge edge) 10974 { 10975 speculateArray(edge, lowCell(edge)); 10976 } 10963 10977 10964 10978 void speculateFunction(Edge edge, LValue cell)
Note: See TracChangeset
for help on using the changeset viewer.