From c9fcfd02a69170cedcd4cf2e66826f246dff6267 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Tue, 5 Jan 2021 16:57:30 +0000 Subject: Optimizing: Add debugging output for HInstruction. Allow printing individual instruction and its arguments with the HGraphVisualizer. Arguments are dumped "recursively" (but implemented with a queue instead of actual recursion). For example, printing the Return instruction from the method Main.testLoop17 in 530-checker-lse yields v28 Return [i27] dex_pc:23 loop:none i27 Add [i24,i26] dex_pc:22 loop:none i24 Phi [i5,i15] dex_pc:n/a reg:0 is_catch_phi:false loop:none i5 IntConstant dex_pc:0 1 loop:none i15 IntConstant dex_pc:5 2 loop:none i26 InstanceFieldGet [l6] dex_pc:20 field_name:TestClass.i field_type:Int32 loop:none l6 NullCheck [l1] dex_pc:1 env:[[i5,_,_,l1,i2]] loop:none l1 ParameterValue dex_pc:n/a loop:none Test: Manual; modify LSE to print the instruction above. Change-Id: Iaf41ba62cd6a5a36236ad0abca082ebffcf6a20e --- compiler/optimizing/optimizing_compiler.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/optimizing/optimizing_compiler.cc') diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index b7e9d63e2f..ac241aa9c9 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -117,7 +117,7 @@ class PassObserver : public ValueObject { visualizer_oss_(), visualizer_output_(visualizer_output), visualizer_enabled_(!compiler_options.GetDumpCfgFileName().empty()), - visualizer_(&visualizer_oss_, graph, *codegen), + visualizer_(&visualizer_oss_, graph, codegen), codegen_(codegen), visualizer_dump_mutex_(dump_mutex), graph_in_bad_state_(false) { -- cgit v1.2.3-59-g8ed1b