| 558 | // -------------------------------------------------------------------------- |
| 559 | |
| 560 | public void visitInsn (final int opcode) { |
| 561 | if (computeMaxs) { |
| 562 | // updates current and max stack sizes |
| 563 | int size = stackSize + SIZE[opcode]; |
| 564 | if (size > maxStackSize) { |
| 565 | maxStackSize = size; |
| 566 | } |
| 567 | stackSize = size; |
| 568 | // if opcode == ATHROW or xRETURN, ends current block (no successor) |
| 569 | if ((opcode >= Constants.IRETURN && opcode <= Constants.RETURN) || |
| 570 | opcode == Constants.ATHROW) |
| 571 | { |
| 572 | if (currentBlock != null) { |
| 573 | currentBlock.maxStackSize = maxStackSize; |
| 574 | currentBlock = null; |
| 575 | } |
| 576 | } |
| 577 | } |
| 578 | // adds the instruction to the bytecode of the method |
| 579 | code.put1(opcode); |
| 580 | } |
| 581 | |
| 582 | public void visitIntInsn (final int opcode, final int operand) { |
| 583 | if (computeMaxs && opcode != Constants.NEWARRAY) { |