Adds a successor to the #currentBlock currentBlock block. @param stackSize the current (relative) stack size in the current block. @param successor the successor block to be added to the current block.
(final int stackSize, final Label successor)
| 1118 | */ |
| 1119 | |
| 1120 | private void addSuccessor (final int stackSize, final Label successor) { |
| 1121 | Edge b; |
| 1122 | // creates a new Edge object or reuses one from the shared pool |
| 1123 | synchronized (SIZE) { |
| 1124 | if (pool == null) { |
| 1125 | b = new Edge(); |
| 1126 | } else { |
| 1127 | b = pool; |
| 1128 | // removes b from the pool |
| 1129 | pool = pool.poolNext; |
| 1130 | } |
| 1131 | } |
| 1132 | // adds the previous Edge to the list of Edges used by this CodeWriter |
| 1133 | if (tail == null) { |
| 1134 | tail = b; |
| 1135 | } |
| 1136 | b.poolNext = head; |
| 1137 | head = b; |
| 1138 | // initializes the previous Edge object... |
| 1139 | b.stackSize = stackSize; |
| 1140 | b.successor = successor; |
| 1141 | // ...and adds it to the successor list of the currentBlock block |
| 1142 | b.next = currentBlock.successors; |
| 1143 | currentBlock.successors = b; |
| 1144 | } |
| 1145 | |
| 1146 | // -------------------------------------------------------------------------- |
| 1147 | // Utility methods: dump bytecode array |
no outgoing calls
no test coverage detected