Changeset 213233 in webkit for trunk/Source/JavaScriptCore/ftl/FTLCompile.cpp
- Timestamp:
- Mar 1, 2017, 11:13:37 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ftl/FTLCompile.cpp
r212775 r213233 34 34 #include "B3ProcedureInlines.h" 35 35 #include "B3StackSlot.h" 36 #include "B3Value.h" 36 37 #include "CodeBlockWithJITType.h" 37 38 #include "CCallHelpers.h" … … 158 159 159 160 if (B3::Air::Disassembler* disassembler = state.proc->code().disassembler()) { 160 dataLogLn("\nGenerated FTL JIT code for ", CodeBlockWithJITType(state.graph.m_codeBlock, JITCode::FTLJIT), ", instruction count = ", state.graph.m_codeBlock->instructionCount(), ":"); 161 PrintStream& out = WTF::dataFile(); 162 163 out.print("\nGenerated FTL JIT code for ", CodeBlockWithJITType(state.graph.m_codeBlock, JITCode::FTLJIT), ", instruction count = ", state.graph.m_codeBlock->instructionCount(), ":\n"); 164 161 165 LinkBuffer& linkBuffer = *state.finalizer->b3CodeLinkBuffer; 162 disassembler->dump(state.proc->code(), WTF::dataFile(), linkBuffer); 166 B3::Value* currentB3Value = nullptr; 167 Node* currentDFGNode = nullptr; 168 169 HashSet<B3::Value*> printedValues; 170 HashSet<Node*> printedNodes; 171 const char* dfgPrefix = " "; 172 const char* b3Prefix = " "; 173 const char* airPrefix = " "; 174 const char* asmPrefix = " "; 175 176 auto printDFGNode = [&] (Node* node) { 177 if (currentDFGNode == node) 178 return; 179 180 currentDFGNode = node; 181 if (!currentDFGNode) 182 return; 183 184 HashSet<Node*> localPrintedNodes; 185 std::function<void(Node*)> printNodeRecursive = [&] (Node* node) { 186 if (printedNodes.contains(node) || localPrintedNodes.contains(node)) 187 return; 188 189 localPrintedNodes.add(node); 190 graph.doToChildren(node, [&] (Edge child) { 191 printNodeRecursive(child.node()); 192 }); 193 graph.dump(out, dfgPrefix, node); 194 }; 195 printNodeRecursive(node); 196 printedNodes.add(node); 197 }; 198 199 auto printB3Value = [&] (B3::Value* value) { 200 if (currentB3Value == value) 201 return; 202 203 currentB3Value = value; 204 if (!currentB3Value) 205 return; 206 207 printDFGNode(bitwise_cast<Node*>(value->origin().data())); 208 209 HashSet<B3::Value*> localPrintedValues; 210 std::function<void(B3::Value*)> printValueRecursive = [&] (B3::Value* value) { 211 if (printedValues.contains(value) || localPrintedValues.contains(value)) 212 return; 213 214 localPrintedValues.add(value); 215 for (unsigned i = 0; i < value->numChildren(); i++) 216 printValueRecursive(value->child(i)); 217 out.print(b3Prefix); 218 value->deepDump(state.proc.get(), out); 219 out.print("\n"); 220 }; 221 222 printValueRecursive(currentB3Value); 223 printedValues.add(value); 224 }; 225 226 auto forEachInst = [&] (B3::Air::Inst& inst) { 227 printB3Value(inst.origin); 228 }; 229 230 disassembler->dump(state.proc->code(), out, linkBuffer, airPrefix, asmPrefix, forEachInst); 163 231 linkBuffer.didAlreadyDisassemble(); 164 232 }
Note:
See TracChangeset
for help on using the changeset viewer.