DFG should have richer debug output for CFA and phi processing
https://bugs.webkit.org/show_bug.cgi?id=72922
Reviewed by Gavin Barraclough.
In the default verbose mode, we now print information about variable
state at the bottom of basic blocks in addition to the top, and we
also print local variable linking. In the verbose propagation mode,
the state of phi processing is dumped more richly and CFA merging (the
most subtle part of CFA) is traced as well.
* dfg/DFGAbstractState.cpp:
(JSC::DFG::AbstractState::endBasicBlock):
(JSC::DFG::AbstractState::mergeStateAtTail):
* dfg/DFGAbstractValue.h:
(JSC::DFG::StructureAbstractValue::dump):
(JSC::DFG::AbstractValue::dump):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::processPhiStack):
(JSC::DFG::ByteCodeParser::parse):
* dfg/DFGCommon.h:
(JSC::DFG::NodeIndexTraits::dump):
* dfg/DFGDriver.cpp:
(JSC::DFG::compile):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dump):
* dfg/DFGNode.h:
(JSC::DFG::Node::dumpChildren):
* dfg/DFGOSRExitCompiler.cpp:
* dfg/DFGOperands.h:
(JSC::DFG::OperandValueTraits::dump):
(JSC::DFG::dumpOperands):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@100975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/dfg/DFGNode.h b/Source/JavaScriptCore/dfg/DFGNode.h
index 51bffcc..5a4f2be 100644
--- a/Source/JavaScriptCore/dfg/DFGNode.h
+++ b/Source/JavaScriptCore/dfg/DFGNode.h
@@ -954,6 +954,21 @@
return nodeCanSpeculateInteger(arithNodeFlags());
}
+#ifndef NDEBUG
+ void dumpChildren(FILE* out)
+ {
+ if (child1() == NoNode)
+ return;
+ fprintf(out, "@%u", child1());
+ if (child2() == NoNode)
+ return;
+ fprintf(out, ", @%u", child2());
+ if (child3() == NoNode)
+ return;
+ fprintf(out, ", @%u", child3());
+ }
+#endif
+
// This enum value describes the type of the node.
NodeType op;
// Used to look up exception handling information (currently implemented as a bytecode index).