[visualizer]: Add types to visualizer output

Review URL: https://codereview.chromium.org/1083083006

Cr-Commit-Position: refs/heads/master@{#27922}
This commit is contained in:
danno 2015-04-17 08:46:23 -07:00 committed by Commit bot
parent f4f2e9c558
commit 5cb387c2b7

View File

@ -129,6 +129,15 @@ class JSONGraphNodeWriter {
os_ << ",\"opcode\":\"" << IrOpcode::Mnemonic(node->opcode()) << "\"";
os_ << ",\"control\":" << (NodeProperties::IsControl(node) ? "true"
: "false");
if (NodeProperties::IsTyped(node)) {
Bounds bounds = NodeProperties::GetBounds(node);
std::ostringstream upper;
bounds.upper->PrintTo(upper);
std::ostringstream lower;
bounds.lower->PrintTo(lower);
os_ << ",\"upper_type\":\"" << Escaped(upper, "\"") << "\"";
os_ << ",\"lower_type\":\"" << Escaped(lower, "\"") << "\"";
}
os_ << "}";
}