Changeset 188849 in webkit for trunk/Source/JavaScriptCore/bytecode/BytecodeLivenessAnalysis.cpp
- Timestamp:
- Aug 23, 2015, 11:18:42 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/bytecode/BytecodeLivenessAnalysis.cpp
r183207 r188849 52 52 } 53 53 54 static unsigned getLeaderOffsetForBasicBlock( RefPtr<BytecodeBasicBlock>* basicBlock)54 static unsigned getLeaderOffsetForBasicBlock(std::unique_ptr<BytecodeBasicBlock>* basicBlock) 55 55 { 56 56 return (*basicBlock)->leaderBytecodeOffset(); 57 57 } 58 58 59 static BytecodeBasicBlock* findBasicBlockWithLeaderOffset(Vector< RefPtr<BytecodeBasicBlock>>& basicBlocks, unsigned leaderOffset)60 { 61 return (*tryBinarySearch< RefPtr<BytecodeBasicBlock>, unsigned>(basicBlocks, basicBlocks.size(), leaderOffset, getLeaderOffsetForBasicBlock)).get();59 static BytecodeBasicBlock* findBasicBlockWithLeaderOffset(Vector<std::unique_ptr<BytecodeBasicBlock>>& basicBlocks, unsigned leaderOffset) 60 { 61 return (*tryBinarySearch<std::unique_ptr<BytecodeBasicBlock>, unsigned>(basicBlocks, basicBlocks.size(), leaderOffset, getLeaderOffsetForBasicBlock)).get(); 62 62 } 63 63 … … 68 68 } 69 69 70 static BytecodeBasicBlock* findBasicBlockForBytecodeOffset(Vector< RefPtr<BytecodeBasicBlock>>& basicBlocks, unsigned bytecodeOffset)70 static BytecodeBasicBlock* findBasicBlockForBytecodeOffset(Vector<std::unique_ptr<BytecodeBasicBlock>>& basicBlocks, unsigned bytecodeOffset) 71 71 { 72 72 /* … … 77 77 return 0; 78 78 */ 79 RefPtr<BytecodeBasicBlock>* basicBlock = approximateBinarySearch<RefPtr<BytecodeBasicBlock>, unsigned>(79 std::unique_ptr<BytecodeBasicBlock>* basicBlock = approximateBinarySearch<std::unique_ptr<BytecodeBasicBlock>, unsigned>( 80 80 basicBlocks, basicBlocks.size(), bytecodeOffset, getLeaderOffsetForBasicBlock); 81 81 // We found the block we were looking for. … … 99 99 // exception handlers in the uses. 100 100 template<typename UseFunctor, typename DefFunctor> 101 static void stepOverInstruction(CodeBlock* codeBlock, Vector< RefPtr<BytecodeBasicBlock>>& basicBlocks, unsigned bytecodeOffset, const UseFunctor& use, const DefFunctor& def)101 static void stepOverInstruction(CodeBlock* codeBlock, Vector<std::unique_ptr<BytecodeBasicBlock>>& basicBlocks, unsigned bytecodeOffset, const UseFunctor& use, const DefFunctor& def) 102 102 { 103 103 // This abstractly execute the instruction in reverse. Instructions logically first use operands and … … 139 139 } 140 140 141 static void stepOverInstruction(CodeBlock* codeBlock, Vector< RefPtr<BytecodeBasicBlock>>& basicBlocks, unsigned bytecodeOffset, FastBitVector& out)141 static void stepOverInstruction(CodeBlock* codeBlock, Vector<std::unique_ptr<BytecodeBasicBlock>>& basicBlocks, unsigned bytecodeOffset, FastBitVector& out) 142 142 { 143 143 stepOverInstruction( … … 153 153 } 154 154 155 static void computeLocalLivenessForBytecodeOffset(CodeBlock* codeBlock, BytecodeBasicBlock* block, Vector< RefPtr<BytecodeBasicBlock>>& basicBlocks, unsigned targetOffset, FastBitVector& result)155 static void computeLocalLivenessForBytecodeOffset(CodeBlock* codeBlock, BytecodeBasicBlock* block, Vector<std::unique_ptr<BytecodeBasicBlock>>& basicBlocks, unsigned targetOffset, FastBitVector& result) 156 156 { 157 157 ASSERT(!block->isExitBlock()); … … 171 171 } 172 172 173 static void computeLocalLivenessForBlock(CodeBlock* codeBlock, BytecodeBasicBlock* block, Vector< RefPtr<BytecodeBasicBlock>>& basicBlocks)173 static void computeLocalLivenessForBlock(CodeBlock* codeBlock, BytecodeBasicBlock* block, Vector<std::unique_ptr<BytecodeBasicBlock>>& basicBlocks) 174 174 { 175 175 if (block->isExitBlock() || block->isEntryBlock()) … … 295 295 BytecodeBasicBlock* block = m_basicBlocks[i].get(); 296 296 dataLogF("\nBytecode basic block %u: %p (offset: %u, length: %u)\n", i, block, block->leaderBytecodeOffset(), block->totalBytecodeLength()); 297 dataLogF("Predecessors: ");298 for (unsigned j = 0; j < block->predecessors().size(); j++) {299 BytecodeBasicBlock* predecessor = block->predecessors()[j];300 dataLogF("%p ", predecessor);301 }302 dataLogF("\n");303 297 dataLogF("Successors: "); 304 298 for (unsigned j = 0; j < block->successors().size(); j++) {
Note:
See TracChangeset
for help on using the changeset viewer.