From b2d38fdb968c818e53a4f82ce0a513cbd3bfa299 Mon Sep 17 00:00:00 2001 From: Mark Mendell Date: Mon, 16 Nov 2015 12:21:53 -0500 Subject: Allow NullConstant to be untyped in GraphVisualiser. The NullConstant may be added to the graph during other passes that happen between ReferenceTypePropagation and Inliner (e.g. InstructionSimplifier). If the inliner doesn't run or doesn't inline anything, the NullConstant remains untyped. The infrastructure to properly type NullConstants everywhere is to complex to add for the benefits Bug: 25786318 Change-Id: I904a3e605b57f8cac9936e82f19a4994c7b1a82a Signed-off-by: Mark Mendell --- compiler/optimizing/graph_visualizer.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'compiler/optimizing/graph_visualizer.cc') diff --git a/compiler/optimizing/graph_visualizer.cc b/compiler/optimizing/graph_visualizer.cc index 2b7790184a..bfb1cd647e 100644 --- a/compiler/optimizing/graph_visualizer.cc +++ b/compiler/optimizing/graph_visualizer.cc @@ -500,6 +500,18 @@ class HGraphVisualizerPrinter : public HGraphDelegateVisitor { StartAttributeStream("exact") << std::boolalpha << info.IsExact() << std::noboolalpha; } else if (instruction->IsLoadClass()) { StartAttributeStream("klass") << "unresolved"; + } else if (instruction->IsNullConstant()) { + // The NullConstant may be added to the graph during other passes that happen between + // ReferenceTypePropagation and Inliner (e.g. InstructionSimplifier). If the inliner + // doesn't run or doesn't inline anything, the NullConstant remains untyped. + // So we should check NullConstants for validity only after reference type propagation. + // + // Note: The infrastructure to properly type NullConstants everywhere is to complex to add + // for the benefits. + StartAttributeStream("klass") << "not_set"; + DCHECK(!is_after_pass_ + || !IsPass(ReferenceTypePropagation::kReferenceTypePropagationPassName)) + << " Expected a valid rti after reference type propagation"; } else { DCHECK(!is_after_pass_) << "Expected a valid rti after reference type propagation"; -- cgit v1.2.3