@@ -349,7 +349,7 @@ public static void writeTo(final CFGDominatorTree tree, final PrintStream ps) {
349349 c3 [style = invis];
350350 d8 [style = invis];
351351 d9 [style = invis];
352-
352+
353353 }
354354 c0 -> c1 [label="Control flow", style=solid, color=red]
355355 c2 -> c3 [label="Control flow back edge", style=dashed, color=red]
@@ -369,8 +369,8 @@ public static void writeBytecodeCFGTo(final MethodAnalyzer analyzer, final Print
369369 if (optCode .isPresent ()) {
370370 final CodeModel code = optCode .get ();
371371
372- final MethodAnalyzer . Frame [] frames = analyzer .getFrames ();
373- final List <MethodAnalyzer . Frame > topologicalOrder = analyzer .getCodeModelTopologicalOrder ();
372+ final Frame [] frames = analyzer .getFrames ();
373+ final List <Frame > topologicalOrder = analyzer .getCodeModelTopologicalOrder ();
374374
375375 final List <CodeElement > elements = code .elementList ();
376376 for (int i = 0 ; i < elements .size (); i ++) {
@@ -393,9 +393,9 @@ public static void writeBytecodeCFGTo(final MethodAnalyzer analyzer, final Print
393393 }
394394
395395 for (int elementIndex = 0 ; elementIndex < frames .length ; elementIndex ++) {
396- final MethodAnalyzer . Frame frame = frames [elementIndex ];
396+ final Frame frame = frames [elementIndex ];
397397 if (frame != null ) {
398- for (final MethodAnalyzer . CFGEdge edge : frame .predecessors ) {
398+ for (final FrameCFGEdge edge : frame .predecessors ) {
399399 ps .print (" node" );
400400 ps .print (edge .fromIndex ());
401401 ps .print (" -> node" );
@@ -406,6 +406,13 @@ public static void writeBytecodeCFGTo(final MethodAnalyzer analyzer, final Print
406406 }
407407 ps .println ("];" );
408408 }
409+ if (frame .immediateDominator != null ) {
410+ ps .print (" node" );
411+ ps .print (elementIndex );
412+ ps .print (" -> node" );
413+ ps .print (topologicalOrder .indexOf (frame .immediateDominator ));
414+ ps .println ("[color=fuchsia];" );
415+ }
409416 }
410417 }
411418 }
0 commit comments