From 5cb387c2b71b4ba93b6417478f5cdb8788722eb0 Mon Sep 17 00:00:00 2001 From: danno Date: Fri, 17 Apr 2015 08:46:23 -0700 Subject: [PATCH] [visualizer]: Add types to visualizer output Review URL: https://codereview.chromium.org/1083083006 Cr-Commit-Position: refs/heads/master@{#27922} --- src/compiler/graph-visualizer.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/compiler/graph-visualizer.cc b/src/compiler/graph-visualizer.cc index 5d255f064e..67b10d6e83 100644 --- a/src/compiler/graph-visualizer.cc +++ b/src/compiler/graph-visualizer.cc @@ -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_ << "}"; }