Changeset 209929 in webkit
- Timestamp:
- Dec 16, 2016 11:28:58 AM (7 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r209928 r209929 1 2016-12-16 Mark Lam <mark.lam@apple.com> 2 3 Add predecessor info to dumps from JSC_dumpBytecodeLivenessResults=true. 4 https://bugs.webkit.org/show_bug.cgi?id=165958 5 6 Reviewed by Saam Barati. 7 8 Also: 9 1. refactored the code to use a common lambda function to dump FastBitVectors. 10 2. list successors by their block index instead of pointers. 11 12 * bytecode/BytecodeLivenessAnalysis.cpp: 13 (JSC::BytecodeLivenessAnalysis::dumpResults): 14 1 15 2016-12-16 Saam Barati <sbarati@apple.com> 2 16 -
trunk/Source/JavaScriptCore/bytecode/BytecodeLivenessAnalysis.cpp
r209358 r209929 143 143 Instruction* instructionsBegin = codeBlock->instructions().begin(); 144 144 unsigned i = 0; 145 146 unsigned numberOfBlocks = m_graph.size(); 147 Vector<FastBitVector> predecessors(numberOfBlocks); 148 for (BytecodeBasicBlock* block : m_graph) 149 predecessors[block->index()].resize(numberOfBlocks); 150 for (BytecodeBasicBlock* block : m_graph) { 151 for (unsigned j = 0; j < block->successors().size(); j++) { 152 unsigned blockIndex = block->index(); 153 unsigned successorIndex = block->successors()[j]->index(); 154 predecessors[successorIndex][blockIndex] = true; 155 } 156 } 157 158 auto dumpBitVector = [] (FastBitVector& bits) { 159 for (unsigned j = 0; j < bits.numBits(); j++) { 160 if (bits[j]) 161 dataLogF(" %u", j); 162 } 163 }; 164 145 165 for (BytecodeBasicBlock* block : m_graph) { 146 166 dataLogF("\nBytecode basic block %u: %p (offset: %u, length: %u)\n", i++, block, block->leaderOffset(), block->totalLength()); 147 dataLogF("Successors: "); 167 168 dataLogF("Predecessors:"); 169 dumpBitVector(predecessors[block->index()]); 170 dataLogF("\n"); 171 172 dataLogF("Successors:"); 173 FastBitVector successors; 174 successors.resize(numberOfBlocks); 148 175 for (unsigned j = 0; j < block->successors().size(); j++) { 149 176 BytecodeBasicBlock* successor = block->successors()[j]; 150 dataLogF("%p ", successor); 151 } 177 successors[successor->index()] = true; 178 } 179 dumpBitVector(successors); // Dump in sorted order. 152 180 dataLogF("\n"); 181 153 182 if (block->isEntryBlock()) { 154 183 dataLogF("Entry block %p\n", block); … … 162 191 const Instruction* currentInstruction = &instructionsBegin[bytecodeOffset]; 163 192 164 dataLogF("Live variables: 193 dataLogF("Live variables:"); 165 194 FastBitVector liveBefore = getLivenessInfoAtBytecodeOffset(bytecodeOffset); 166 for (unsigned j = 0; j < liveBefore.numBits(); j++) { 167 if (liveBefore[j]) 168 dataLogF("%u ", j); 169 } 195 dumpBitVector(liveBefore); 170 196 dataLogF("\n"); 171 197 codeBlock->dumpBytecode(WTF::dataFile(), codeBlock->globalObject()->globalExec(), instructionsBegin, currentInstruction); … … 176 202 } 177 203 178 dataLogF("Live variables: 204 dataLogF("Live variables:"); 179 205 FastBitVector liveAfter = block->out(); 180 for (unsigned j = 0; j < liveAfter.numBits(); j++) { 181 if (liveAfter[j]) 182 dataLogF("%u ", j); 183 } 206 dumpBitVector(liveAfter); 184 207 dataLogF("\n"); 185 208 }
Note: See TracChangeset
for help on using the changeset viewer.