Revision: 23582
Author: [email protected]
Date: Tue Sep 2 08:44:25 2014 UTC
Log: Improve graph visualizer for deoptimization and readablity.
[email protected]
Review URL: https://codereview.chromium.org/523593002
https://code.google.com/p/v8/source/detail?r=23582
Modified:
/branches/bleeding_edge/src/compiler/graph-visualizer.cc
=======================================
--- /branches/bleeding_edge/src/compiler/graph-visualizer.cc Thu Aug 21
11:56:46 2014 UTC
+++ /branches/bleeding_edge/src/compiler/graph-visualizer.cc Tue Sep 2
08:44:25 2014 UTC
@@ -33,7 +33,7 @@
private:
void AnnotateNode(Node* node);
- void PrintEdge(Node* from, int index, Node* to);
+ void PrintEdge(Node::Edge edge);
Zone* zone_;
NodeSet all_nodes_;
@@ -168,7 +168,7 @@
}
for (int j = OperatorProperties::GetFrameStateInputCount(node->op()); j
0;
++i, j--) {
- os_ << "|<I" << i.index() << ">X #" << (*i)->id();
+ os_ << "|<I" << i.index() << ">F #" << (*i)->id();
}
for (int j = OperatorProperties::GetEffectInputCount(node->op()); j > 0;
++i, j--) {
@@ -196,7 +196,10 @@
}
-void GraphVisualizer::PrintEdge(Node* from, int index, Node* to) {
+void GraphVisualizer::PrintEdge(Node::Edge edge) {
+ Node* from = edge.from();
+ int index = edge.index();
+ Node* to = edge.to();
bool unconstrained = IsLikelyBackEdge(from, index, to);
os_ << " ID" << from->id();
if (all_nodes_.count(to) == 0) {
@@ -205,11 +208,15 @@
GetControlCluster(from) == NULL ||
(OperatorProperties::GetControlInputCount(from->op()) > 0 &&
NodeProperties::GetControlInput(from) != to)) {
- os_ << ":I" << index << ":n -> ID" << to->id() << ":s";
- if (unconstrained) os_ << " [constraint=false,style=dotted]";
+ os_ << ":I" << index << ":n -> ID" << to->id() << ":s"
+ << "[" << (unconstrained ? "constraint=false" : "")
+ << (NodeProperties::IsControlEdge(edge) ? "style=bold" : "")
+ << (NodeProperties::IsEffectEdge(edge) ? "style=dotted" : "")
+ << (NodeProperties::IsContextEdge(edge) ? "style=dashed" : "")
<< "]";
} else {
os_ << " -> ID" << to->id() << ":s [color=transparent"
- << (unconstrained ? ", constraint=false" : "") << "]";
+ << (unconstrained ? ", constraint=false" : "")
+ << (NodeProperties::IsControlEdge(edge) ? ", style=dashed" : "")
<< "]";
}
os_ << "\n";
}
@@ -219,6 +226,10 @@
os_ << "digraph D {\n"
<< " node [fontsize=8,height=0.25]\n"
<< " rankdir=\"BT\"\n"
+ << " ranksep=\"1.2 equally\"\n"
+ << " overlap=\"false\"\n"
+ << " splines=\"true\"\n"
+ << " concentrate=\"true\"\n"
<< " \n";
// Make sure all nodes have been output before writing out the edges.
@@ -244,7 +255,7 @@
Node::Inputs inputs = (*i)->inputs();
for (Node::Inputs::iterator iter(inputs.begin()); iter != inputs.end();
++iter) {
- PrintEdge(iter.edge().from(), iter.edge().index(), iter.edge().to());
+ PrintEdge(iter.edge());
}
}
os_ << "}\n";
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.