The following control flow graph is the bytecode graph generated by Control Flow Graph Factory:
|
| Control Flow Graph of the method C1.t() |
The Control Flow Graph Factory GraphXML export of the graph C1.t() without visual or geometric information is presented below:
<?xml version="1.0"?> <!DOCTYPE GraphXML SYSTEM "GraphXML.dtd"> <GraphXML> <graph version="1.0" vendor="www.drgarbage.com" id="C4.t.byte.graph"> <node name="2"> <label>0 iload_0</label> </node> <node name="3"> <label>1 tableswitch</label> </node> <node name="4"> <label>24 getstatic</label> </node> <node name="5"> <label>27 iconst_1</label> </node> <node name="6"> <label>28 iadd</label> </node> <node name="7"> <label>29 putstatic</label> </node> <node name="8"> <label>32 goto</label> </node> <node name="9"> <label>35 iload_0</label> </node> <node name="10"> <label>36 bipush</label> </node> <node name="11"> <label>38 if_icmple</label> </node> <node name="12"> <label>41 iinc</label> </node> <node name="13"> <label>44 return</label> </node> <node name="14"> <label>START</label> </node> <node name="15"> <label>EXIT</label> </node> <edge source="14" target="2"> <label></label> </edge> <edge source="2" target="3"> <label></label> </edge> <edge source="3" target="4"> <label>0</label> </edge> <edge source="4" target="5"> <label></label> </edge> <edge source="5" target="6"> <label></label> </edge> <edge source="6" target="7"> <label></label> </edge> <edge source="7" target="8"> <label></label> </edge> <edge source="3" target="9"> <label>1</label> </edge> <edge source="9" target="10"> <label></label> </edge> <edge source="10" target="11"> <label></label> </edge> <edge source="11" target="12"> <label>true</label> </edge> <edge source="3" target="13"> <label>default</label> </edge> <edge source="8" target="13"> <label></label> </edge> <edge source="11" target="13"> <label>false</label> </edge> <edge source="12" target="13"> <label></label> </edge> <edge source="13" target="15"> <label></label> </edge> </graph> </GraphXML>download the GraphXML graph file |
Each node has a unique ID (name) and a label.
The label includes the information about the original code label="29 putstatic".
In this example the information about the bytecode instruction.
Control flow specific information are assigned to the label of an edge for e.g. a switch table value or decision. The label may be empty.
The GraphXML export of the graph C1.t() with visual information is presented below:
<?xml version="1.0"?> <!DOCTYPE GraphXML SYSTEM "GraphXML.dtd"> <GraphXML> <graph version="1.0" vendor="www.drgarbage.com" id="C4.t.byte.graph"> <node name="2"> <label>0 iload_0</label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </node> <node name="3"> <label>1 tableswitch</label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </node> <node name="4"> <label>24 getstatic</label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </node> <node name="5"> <label>27 iconst_1</label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </node> <node name="6"> <label>28 iadd</label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </node> <node name="7"> <label>29 putstatic</label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </node> <node name="8"> <label>32 goto</label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </node> <node name="9"> <label>35 iload_0</label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </node> <node name="10"> <label>36 bipush</label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </node> <node name="11"> <label>38 if_icmple</label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </node> <node name="12"> <label>41 iinc</label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </node> <node name="13"> <label>44 return</label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </node> <node name="14"> <label>START</label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </node> <node name="15"> <label>EXIT</label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </node> <edge source="14" target="2"> <label></label> <style> <line linestyle="dashed" linewidth="1.2" colour="black"/> </style> </edge> <edge source="2" target="3"> <label></label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </edge> <edge source="3" target="4"> <label>0</label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </edge> <edge source="4" target="5"> <label></label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </edge> <edge source="5" target="6"> <label></label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </edge> <edge source="6" target="7"> <label></label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </edge> <edge source="7" target="8"> <label></label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </edge> <edge source="3" target="9"> <label>1</label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </edge> <edge source="9" target="10"> <label></label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </edge> <edge source="10" target="11"> <label></label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </edge> <edge source="11" target="12"> <label>true</label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </edge> <edge source="3" target="13"> <label>default</label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </edge> <edge source="8" target="13"> <label></label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </edge> <edge source="11" target="13"> <label>false</label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </edge> <edge source="12" target="13"> <label></label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </edge> <edge source="13" target="15"> <label></label> <style> <line linestyle="dashed" linewidth="1.2" colour="black"/> </style> </edge> </graph> </GraphXML>download the GraphXML graph file |
The export of the graph C1.t() with visual and geometric information is presented below:
<?xml version="1.0"?> <!DOCTYPE GraphXML SYSTEM "GraphXML.dtd"> <GraphXML> <graph version="1.0" vendor="www.drgarbage.com" id="C4.t.byte.graph"> <node name="2"> <label>0 iload_0</label> <position x="152" y="84"/> <size width="85" height="36"/> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </node> <node name="3"> <label>1 tableswitch</label> <position x="141" y="152"/> <size width="117" height="36"/> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </node> <node name="4"> <label>24 getstatic</label> <position x="80" y="214"/> <size width="115" height="36"/> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </node> <node name="5"> <label>27 iconst_1</label> <position x="90" y="282"/> <size width="85" height="36"/> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </node> <node name="6"> <label>28 iadd</label> <position x="90" y="350"/> <size width="85" height="36"/> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </node> <node name="7"> <label>29 putstatic</label> <position x="90" y="418"/> <size width="85" height="36"/> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </node> <node name="8"> <label>32 goto</label> <position x="90" y="486"/> <size width="85" height="36"/> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </node> <node name="9"> <label>35 iload_0</label> <position x="240" y="214"/> <size width="85" height="36"/> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </node> <node name="10"> <label>36 bipush</label> <position x="240" y="282"/> <size width="85" height="36"/> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </node> <node name="11"> <label>38 if_icmple</label> <position x="240" y="350"/> <size width="124" height="43"/> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </node> <node name="12"> <label>41 iinc</label> <position x="294" y="437"/> <size width="85" height="36"/> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </node> <node name="13"> <label>44 return</label> <position x="158" y="559"/> <size width="85" height="36"/> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </node> <node name="14"> <label>START</label> <position x="152" y="16"/> <size width="85" height="36"/> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </node> <node name="15"> <label>EXIT</label> <position x="158" y="628"/> <size width="85" height="36"/> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </node> <edge source="14" target="2"> <label></label> <style> <line linestyle="dashed" linewidth="1.2" colour="black"/> </style> </edge> <edge source="2" target="3"> <label></label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </edge> <edge source="3" target="4"> <label>0</label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </edge> <edge source="4" target="5"> <label></label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </edge> <edge source="5" target="6"> <label></label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </edge> <edge source="6" target="7"> <label></label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </edge> <edge source="7" target="8"> <label></label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </edge> <edge source="3" target="9"> <label>1</label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </edge> <edge source="9" target="10"> <label></label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </edge> <edge source="10" target="11"> <label></label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </edge> <edge source="11" target="12"> <label>true</label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </edge> <edge source="3" target="13"> <label>default</label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </edge> <edge source="8" target="13"> <label></label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </edge> <edge source="11" target="13"> <label>false</label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </edge> <edge source="12" target="13"> <label></label> <style> <line linestyle="solid" linewidth="1.2" colour="black"/> </style> </edge> <edge source="13" target="15"> <label></label> <style> <line linestyle="dashed" linewidth="1.2" colour="black"/> </style> </edge> </graph> </GraphXML>download the GraphXML graph file |