From bb7a28a9275239f4e6d5f7863d8256ae036a9d5e Mon Sep 17 00:00:00 2001 From: Zheng Xu Date: Fri, 9 Jan 2015 14:40:47 +0800 Subject: ART: Dump environment to cfg file. Environment shows additional dependency and instructions with environment should usually be a safepoint as well. Change-Id: I04606624e6ea212ab1dc7502cdb87b5d5d0e3ac2 --- compiler/optimizing/graph_visualizer.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'compiler/optimizing/graph_visualizer.cc') diff --git a/compiler/optimizing/graph_visualizer.cc b/compiler/optimizing/graph_visualizer.cc index 9383d31e8f..835bca688f 100644 --- a/compiler/optimizing/graph_visualizer.cc +++ b/compiler/optimizing/graph_visualizer.cc @@ -194,6 +194,19 @@ class HGraphVisualizerPrinter : public HGraphVisitor { } output_ << "]"; } + if (instruction->HasEnvironment()) { + HEnvironment* env = instruction->GetEnvironment(); + output_ << " (env: [ "; + for (size_t i = 0, e = env->Size(); i < e; ++i) { + HInstruction* insn = env->GetInstructionAt(i); + if (insn != nullptr) { + output_ << GetTypeId(insn->GetType()) << insn->GetId() << " "; + } else { + output_ << " _ "; + } + } + output_ << "])"; + } if (pass_name_ == kLivenessPassName && is_after_pass_ && instruction->GetLifetimePosition() != kNoLifetime) { -- cgit v1.2.3-59-g8ed1b