Changeset 190749 in webkit
- Timestamp:
- Oct 8, 2015 3:18:49 PM (9 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r190743 r190749 1 2015-10-08 Filip Pizlo <fpizlo@apple.com> 2 3 DFG SSA should remove unreachable code 4 https://bugs.webkit.org/show_bug.cgi?id=149931 5 6 Reviewed by Geoffrey Garen. 7 8 * dfg/DFGConstantFoldingPhase.cpp: 9 (JSC::DFG::ConstantFoldingPhase::run): Remove unreachable code. 10 * dfg/DFGObjectAllocationSinkingPhase.cpp: Deal with the CFG changing. 11 * dfg/DFGPutStackSinkingPhase.cpp: Deal with the CFG changing. 12 1 13 2015-10-08 Joseph Pecoraro <pecoraro@apple.com> 2 14 -
trunk/Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp
r190076 r190749 31 31 #include "DFGAbstractInterpreterInlines.h" 32 32 #include "DFGArgumentsUtilities.h" 33 #include "DFGBasicBlock .h"33 #include "DFGBasicBlockInlines.h" 34 34 #include "DFGGraph.h" 35 35 #include "DFGInPlaceAbstractState.h" … … 56 56 { 57 57 bool changed = false; 58 59 for (BlockIndex blockIndex = 0; blockIndex < m_graph.numBlocks(); ++blockIndex) { 60 BasicBlock* block = m_graph.block(blockIndex); 61 if (!block) 62 continue; 58 59 for (BasicBlock* block : m_graph.blocksInNaturalOrder()) { 63 60 if (block->cfaFoundConstants) 64 61 changed |= foldConstants(block); … … 67 64 if (changed && m_graph.m_form == SSA) { 68 65 // It's now possible that we have Upsilons pointed at JSConstants. Fix that. 69 for (BlockIndex blockIndex = m_graph.numBlocks(); blockIndex--;) { 70 BasicBlock* block = m_graph.block(blockIndex); 71 if (!block) 72 continue; 66 for (BasicBlock* block : m_graph.blocksInNaturalOrder()) 73 67 fixUpsilons(block); 68 } 69 70 if (m_graph.m_form == SSA) { 71 // It's now possible to simplify basic blocks by placing an Unreachable terminator right 72 // after anything that invalidates AI. 73 bool didClipBlock = false; 74 for (BasicBlock* block : m_graph.blocksInNaturalOrder()) { 75 m_state.beginBasicBlock(block); 76 for (unsigned nodeIndex = 0; nodeIndex < block->size(); ++nodeIndex) { 77 if (block->at(nodeIndex)->isTerminal()) { 78 // It's possible that we have something after the terminal. It could be a 79 // no-op Check node, for example. We don't want the logic below to turn that 80 // node into Unreachable, since then we'd have two terminators. 81 break; 82 } 83 if (!m_state.isValid()) { 84 NodeOrigin origin = block->at(nodeIndex)->origin; 85 for (unsigned killIndex = nodeIndex; killIndex < block->size(); ++killIndex) 86 m_graph.m_allocator.free(block->at(killIndex)); 87 block->resize(nodeIndex); 88 block->appendNode(m_graph, SpecNone, Unreachable, origin); 89 didClipBlock = true; 90 break; 91 } 92 m_interpreter.execute(nodeIndex); 93 } 94 } 95 96 if (didClipBlock) { 97 changed = true; 98 m_graph.invalidateCFG(); 99 m_graph.resetReachability(); 100 m_graph.killUnreachableBlocks(); 74 101 } 75 102 } -
trunk/Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp
r190076 r190749 728 728 m_graph.computeRefCounts(); 729 729 m_graph.initializeNodeOwners(); 730 m_graph.m_dominators.computeIfNecessary(m_graph); 730 731 performLivenessAnalysis(m_graph); 731 732 performOSRAvailabilityAnalysis(m_graph); -
trunk/Source/JavaScriptCore/dfg/DFGPutStackSinkingPhase.cpp
r189013 r190749 76 76 m_graph.dump(); 77 77 } 78 79 m_graph.m_dominators.computeIfNecessary(m_graph); 78 80 79 81 SSACalculator ssaCalculator(m_graph);
Note: See TracChangeset
for help on using the changeset viewer.