Changeset 170907 in webkit
- Timestamp:
- Jul 8, 2014, 8:00:27 PM (11 years ago)
- Location:
- branches/ftlopt/Source/JavaScriptCore
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ftlopt/Source/JavaScriptCore/CMakeLists.txt
r170672 r170907 182 182 dfg/DFGOSRExitPreparation.cpp 183 183 dfg/DFGOperations.cpp 184 dfg/DFGPhantomRemovalPhase.cpp 184 185 dfg/DFGPhase.cpp 185 186 dfg/DFGPlan.cpp -
branches/ftlopt/Source/JavaScriptCore/ChangeLog
r170890 r170907 1 2014-07-08 Filip Pizlo <fpizlo@apple.com> 2 3 [ftlopt] Phantom simplification should be in its own phase 4 https://bugs.webkit.org/show_bug.cgi?id=134742 5 6 Reviewed by Geoffrey Garen. 7 8 This moves Phantom simplification out of CSE, which greatly simplifies CSE and gives it 9 more focus. Also this finally adds a phase that removes empty Phantoms. We sort of had 10 this in CPSRethreading, but that phase runs too infrequently and doesn't run at all for 11 SSA. 12 13 * CMakeLists.txt: 14 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: 15 * JavaScriptCore.xcodeproj/project.pbxproj: 16 * dfg/DFGAdjacencyList.h: 17 * dfg/DFGCSEPhase.cpp: 18 (JSC::DFG::CSEPhase::run): 19 (JSC::DFG::CSEPhase::setReplacement): 20 (JSC::DFG::CSEPhase::eliminate): 21 (JSC::DFG::CSEPhase::performNodeCSE): 22 (JSC::DFG::CSEPhase::eliminateIrrelevantPhantomChildren): Deleted. 23 * dfg/DFGPhantomRemovalPhase.cpp: Added. 24 (JSC::DFG::PhantomRemovalPhase::PhantomRemovalPhase): 25 (JSC::DFG::PhantomRemovalPhase::run): 26 (JSC::DFG::performCleanUp): 27 * dfg/DFGPhantomRemovalPhase.h: Added. 28 * dfg/DFGPlan.cpp: 29 (JSC::DFG::Plan::compileInThreadImpl): 30 1 31 2014-07-08 Filip Pizlo <fpizlo@apple.com> 2 32 -
branches/ftlopt/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj
r170672 r170907 433 433 <ClCompile Include="..\dfg\DFGOSRExitJumpPlaceholder.cpp" /> 434 434 <ClCompile Include="..\dfg\DFGOSRExitPreparation.cpp" /> 435 <ClCompile Include="..\dfg\DFGPhantomRemovalPhase.cpp" /> 435 436 <ClCompile Include="..\dfg\DFGPhase.cpp" /> 436 437 <ClCompile Include="..\dfg\DFGPlan.cpp" /> … … 1010 1011 <ClInclude Include="..\dfg\DFGOSRExitJumpPlaceholder.h" /> 1011 1012 <ClInclude Include="..\dfg\DFGOSRExitPreparation.h" /> 1013 <ClInclude Include="..\dfg\DFGPhantomRemovalPhase.h" /> 1012 1014 <ClInclude Include="..\dfg\DFGPhase.h" /> 1013 1015 <ClInclude Include="..\dfg\DFGPlan.h" /> -
branches/ftlopt/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r170672 r170907 457 457 0FBE0F7616C1DB0F0082C5E8 /* DFGUnificationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FBE0F6F16C1DB010082C5E8 /* DFGUnificationPhase.cpp */; }; 458 458 0FBE0F7716C1DB120082C5E8 /* DFGUnificationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FBE0F7016C1DB010082C5E8 /* DFGUnificationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; 459 0FBFDD04196C92BF007A5BFA /* DFGPhantomRemovalPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FBFDD02196C92BF007A5BFA /* DFGPhantomRemovalPhase.cpp */; }; 460 0FBFDD05196C92BF007A5BFA /* DFGPhantomRemovalPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FBFDD03196C92BF007A5BFA /* DFGPhantomRemovalPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; 459 461 0FC0976A1468A6F700CF2442 /* DFGOSRExit.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC097681468A6EF00CF2442 /* DFGOSRExit.h */; settings = {ATTRIBUTES = (Private, ); }; }; 460 462 0FC0977114693AF500CF2442 /* DFGOSRExitCompiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC0976F14693AEF00CF2442 /* DFGOSRExitCompiler.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 2642 2644 0FBE0F6F16C1DB010082C5E8 /* DFGUnificationPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGUnificationPhase.cpp; path = dfg/DFGUnificationPhase.cpp; sourceTree = "<group>"; }; 2643 2645 0FBE0F7016C1DB010082C5E8 /* DFGUnificationPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGUnificationPhase.h; path = dfg/DFGUnificationPhase.h; sourceTree = "<group>"; }; 2646 0FBFDD02196C92BF007A5BFA /* DFGPhantomRemovalPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGPhantomRemovalPhase.cpp; path = dfg/DFGPhantomRemovalPhase.cpp; sourceTree = "<group>"; }; 2647 0FBFDD03196C92BF007A5BFA /* DFGPhantomRemovalPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGPhantomRemovalPhase.h; path = dfg/DFGPhantomRemovalPhase.h; sourceTree = "<group>"; }; 2644 2648 0FC097681468A6EF00CF2442 /* DFGOSRExit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGOSRExit.h; path = dfg/DFGOSRExit.h; sourceTree = "<group>"; }; 2645 2649 0FC0976F14693AEF00CF2442 /* DFGOSRExitCompiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGOSRExitCompiler.h; path = dfg/DFGOSRExitCompiler.h; sourceTree = "<group>"; }; … … 5177 5181 0F235BE917178E7300690C7F /* DFGOSRExitPreparation.cpp */, 5178 5182 0F235BEA17178E7300690C7F /* DFGOSRExitPreparation.h */, 5183 0FBFDD02196C92BF007A5BFA /* DFGPhantomRemovalPhase.cpp */, 5184 0FBFDD03196C92BF007A5BFA /* DFGPhantomRemovalPhase.h */, 5179 5185 0FFFC94F14EF909500C72532 /* DFGPhase.cpp */, 5180 5186 0FFFC95014EF909500C72532 /* DFGPhase.h */, … … 6315 6321 A532438C18568335002ED692 /* InspectorJSTypeBuilders.h in Headers */, 6316 6322 A50E4B6218809DD50068A46D /* InspectorRuntimeAgent.h in Headers */, 6323 0FBFDD05196C92BF007A5BFA /* DFGPhantomRemovalPhase.h in Headers */, 6317 6324 A55D93AC18514F7900400DED /* InspectorTypeBuilder.h in Headers */, 6318 6325 A593CF831840377100BFCE27 /* InspectorValues.h in Headers */, … … 8068 8075 9330402C0E6A764000786E6A /* SmallStrings.cpp in Sources */, 8069 8076 0F8F2B9E17306C8D007DBDA5 /* SourceCode.cpp in Sources */, 8077 0FBFDD04196C92BF007A5BFA /* DFGPhantomRemovalPhase.cpp in Sources */, 8070 8078 0F493AFA16D0CAD30084508B /* SourceProvider.cpp in Sources */, 8071 8079 E49DC16B12EF293E00184A1F /* SourceProviderCache.cpp in Sources */, -
branches/ftlopt/Source/JavaScriptCore/dfg/DFGAdjacencyList.h
r170064 r170907 133 133 setChild(Size - 1, Edge()); 134 134 } 135 135 136 136 unsigned firstChild() const 137 137 { -
branches/ftlopt/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp
r170890 r170907 55 55 m_graph.clearReplacements(); 56 56 57 for (BlockIndex blockIndex = m_graph.numBlocks(); blockIndex--;) {58 BasicBlock* block = m_graph.block(blockIndex);59 if (!block)60 continue;61 62 // All Phis need to already be marked as relevant to OSR.63 if (!ASSERT_DISABLED) {64 for (unsigned i = 0; i < block->phis.size(); ++i)65 ASSERT(block->phis[i]->flags() & NodeRelevantToOSR);66 }67 68 for (unsigned i = block->size(); i--;) {69 Node* node = block->at(i);70 71 switch (node->op()) {72 case SetLocal:73 case GetLocal: // FIXME: The GetLocal case is only necessary until we do https://bugs.webkit.org/show_bug.cgi?id=106707.74 node->mergeFlags(NodeRelevantToOSR);75 break;76 default:77 node->clearFlags(NodeRelevantToOSR);78 break;79 }80 }81 }82 83 for (BlockIndex blockIndex = m_graph.numBlocks(); blockIndex--;) {84 BasicBlock* block = m_graph.block(blockIndex);85 if (!block)86 continue;87 88 for (unsigned i = block->size(); i--;) {89 Node* node = block->at(i);90 if (!node->containsMovHint())91 continue;92 93 ASSERT(node->op() != ZombieHint);94 node->child1()->mergeFlags(NodeRelevantToOSR);95 }96 }97 98 57 if (m_graph.m_form == SSA) { 99 58 Vector<BasicBlock*> depthFirst; … … 832 791 } 833 792 834 void eliminateIrrelevantPhantomChildren(Node* node)835 {836 ASSERT(node->op() == Phantom);837 for (unsigned i = 0; i < AdjacencyList::Size; ++i) {838 Edge edge = node->children.child(i);839 if (!edge)840 continue;841 if (edge.useKind() != UntypedUse)842 continue; // Keep the type check.843 if (edge->flags() & NodeRelevantToOSR)844 continue;845 846 node->children.removeEdge(i--);847 m_changed = true;848 }849 }850 851 793 bool setReplacement(Node* replacement) 852 794 { … … 855 797 856 798 m_currentNode->convertToPhantom(); 857 eliminateIrrelevantPhantomChildren(m_currentNode);858 799 859 800 // At this point we will eliminate all references to this node. … … 869 810 ASSERT(m_currentNode->mustGenerate()); 870 811 m_currentNode->convertToPhantom(); 871 eliminateIrrelevantPhantomChildren(m_currentNode);872 812 873 813 m_changed = true; … … 880 820 ASSERT(node->mustGenerate()); 881 821 node->setOpAndDefaultFlags(phantomType); 882 if (phantomType == Phantom)883 eliminateIrrelevantPhantomChildren(node);884 822 885 823 m_changed = true; … … 1111 1049 break; 1112 1050 1113 case Phantom:1114 // FIXME: we ought to remove Phantom's that have no children.1115 // NB. It would be incorrect to do this for HardPhantom. In fact, the whole point1116 // of HardPhantom is that we *don't* do this for HardPhantoms, since they signify1117 // a more strict kind of liveness than the Phantom bytecode liveness.1118 eliminateIrrelevantPhantomChildren(node);1119 break;1120 1121 1051 case Flush: 1122 1052 // This is needed for arguments simplification to work. We need to eliminate the -
branches/ftlopt/Source/JavaScriptCore/dfg/DFGPlan.cpp
r170060 r170907 50 50 #include "DFGOSRAvailabilityAnalysisPhase.h" 51 51 #include "DFGOSREntrypointCreationPhase.h" 52 #include "DFGPhantomRemovalPhase.h" 52 53 #include "DFGPredictionInjectionPhase.h" 53 54 #include "DFGPredictionPropagationPhase.h" … … 261 262 if (validationEnabled()) 262 263 validate(dfg); 263 264 264 265 performCPSRethreading(dfg); 265 266 if (changed) { … … 282 283 283 284 performStoreBarrierElision(dfg); 285 performPhantomRemoval(dfg); 284 286 performCPSRethreading(dfg); 285 287 performDCE(dfg); … … 309 311 } 310 312 313 performPhantomRemoval(dfg); 311 314 performCriticalEdgeBreaking(dfg); 312 315 performLoopPreHeaderCreation(dfg); … … 325 328 } 326 329 performLICM(dfg); 330 performPhantomRemoval(dfg); 327 331 performIntegerCheckCombining(dfg); 328 332 performCSE(dfg); … … 333 337 334 338 performStoreBarrierElision(dfg); 339 performPhantomRemoval(dfg); 335 340 performLivenessAnalysis(dfg); 336 341 performCFA(dfg);
Note:
See TracChangeset
for help on using the changeset viewer.