Tealer now stores original source code of instructions. Also, comments not part of the instructions are saved and outputted in the CFG dot file.
Adds helpers to add comments to basic blocks and instructions. These comments are outputted in the CFG.
Adds colors to edges to differentiate jump branch, default branch, and call edge.
Adds border color to basic blocks belonging to a subroutine in the output CFG.
E.g
Basic-block level tealer comments are added in a separate row at the top of the block. Every basic block would contain a comment containing basic block's id and the total cost of executing instructions in that basic block.
Instruction level tealer comments are displayed directly above the instruction. For example, see "ApplicationID is 0 in Creation Txn" on txn ApplicationId instruction in basic-block 0.
All tealer added comments are made bold for better distinction.
Entry block of a subroutine contains a comment describing its name, see "Subroutine addupton_0" comment in basic-block 12.
Instructions BZ/BNZ either jump to a location in the code and execute from there or continue the execution from the next instruction in the source code.
Outgoing edges of basic blocks ending with BZ/BNZ have a "green" outgoing edge and "red" outgoing edge. "green" edge is taken if the condition to take the JUMP is satisfied (jump branch) and "red" edge represents the default branch(no jump is taken).
Additionally, the edge representing a call to a subroutine has an orange color to differentiate normal branches from subroutine calls.
And each of the basic blocks that are part of a subroutine has an "orange" border color for the same reason.
Note that, currently all subroutine blocks have the same border color i.e blocks of Subroutine 1, subroutine 2, and ... have the same orange border color. However, it might be best to use different border colors for each of subroutine for better UX.
Changes:
E.g
Basic-block level tealer comments are added in a separate row at the top of the block. Every basic block would contain a comment containing basic block's id and the total cost of executing instructions in that basic block.
Instruction level tealer comments are displayed directly above the instruction. For example, see "ApplicationID is 0 in Creation Txn" on
txn ApplicationId
instruction in basic-block 0.All tealer added comments are made bold for better distinction.
Entry block of a subroutine contains a comment describing its name, see "Subroutine addupton_0" comment in basic-block 12.
Instructions
BZ/BNZ
either jump to a location in the code and execute from there or continue the execution from the next instruction in the source code. Outgoing edges of basic blocks ending withBZ/BNZ
have a "green" outgoing edge and "red" outgoing edge. "green" edge is taken if the condition to take the JUMP is satisfied (jump branch) and "red" edge represents the default branch(no jump is taken).Additionally, the edge representing a call to a subroutine has an orange color to differentiate normal branches from subroutine calls. And each of the basic blocks that are part of a subroutine has an "orange" border color for the same reason.
Note that, currently all subroutine blocks have the same border color i.e blocks of Subroutine 1, subroutine 2, and ... have the same orange border color. However, it might be best to use different border colors for each of subroutine for better UX.