/** * Returns the label corresponding to the given bytecode offset. The default implementation of * this method creates a label for the given offset if it has not been already created. * * @param bytecodeOffset a bytecode offset in a method. * @param labels the already created labels, indexed by their offset. If a label already exists * for bytecodeOffset this method must not create a new one. Otherwise it must store the new * label in this array. * @return a non null Label, which must be equal to labels[bytecodeOffset]. */ protected Label readLabel(final int bytecodeOffset, final Label[] labels) { if (labels[bytecodeOffset] == null) { labels[bytecodeOffset] = new Label(); } return labels[bytecodeOffset]; }
/** * Ends the current basic block. This method must be used in the case where the current basic * block does not have any successor. * * <p>WARNING: this method must be called after the currently visited instruction has been put in * {@link #code} (if frames are computed, this method inserts a new Label to start a new basic * block after the current instruction). */ private void endCurrentBasicBlockWithNoSuccessor() { if (compute == COMPUTE_ALL_FRAMES) { Label nextBasicBlock = new Label(); nextBasicBlock.frame = new Frame(nextBasicBlock); nextBasicBlock.resolve(code.data, code.length); lastBasicBlock.nextBasicBlock = nextBasicBlock; lastBasicBlock = nextBasicBlock; currentBasicBlock = null; } else if (compute == COMPUTE_MAX_STACK_AND_LOCAL) { currentBasicBlock.outputStackMax = (short) maxRelativeStackSize; currentBasicBlock = null; } }
currentLocals = argumentsSize; firstBasicBlock = new Label(); visitLabel(firstBasicBlock);
visitLabel(new Label());
if (isLast) { mv.visitInsn(DUP); Label label = new Label(); mv.visitJumpInsn(IFNONNULL, label); mv.visitInsn(POP); if (isLast) { mv.visitInsn(DUP); Label label = new Label(); mv.visitJumpInsn(IFNONNULL, label); mv.visitInsn(POP); if (isLast) { mv.visitInsn(DUP); Label label = new Label(); mv.visitJumpInsn(IFNONNULL, label); mv.visitInsn(POP); if (isLast) { mv.visitInsn(DUP); Label label = new Label(); mv.visitJumpInsn(IFNONNULL, label); mv.visitInsn(POP); if (isLast) { mv.visitInsn(DUP); Label label = new Label(); mv.visitJumpInsn(IFNONNULL, label); mv.visitInsn(POP);
if (previousFrame == null) { int argumentsSize = Type.getArgumentsAndReturnSizes(descriptor) >> 2; Frame implicitFirstFrame = new Frame(new Label()); implicitFirstFrame.setInputFrameFromDescriptor( symbolTable, accessFlags, descriptor, argumentsSize);
/** * Returns the label corresponding to the given bytecode offset. The default implementation of * this method creates a label for the given offset if it has not been already created. * * @param bytecodeOffset a bytecode offset in a method. * @param labels the already created labels, indexed by their offset. If a label already exists * for bytecodeOffset this method must not create a new one. Otherwise it must store the new * label in this array. * @return a non null Label, which must be equal to labels[bytecodeOffset]. */ protected Label readLabel(final int bytecodeOffset, final Label[] labels) { if (labels[bytecodeOffset] == null) { labels[bytecodeOffset] = new Label(); } return labels[bytecodeOffset]; }
/** * Ends the current basic block. This method must be used in the case where the current basic * block does not have any successor. * * <p>WARNING: this method must be called after the currently visited instruction has been put in * {@link #code} (if frames are computed, this method inserts a new Label to start a new basic * block after the current instruction). */ private void endCurrentBasicBlockWithNoSuccessor() { if (compute == COMPUTE_ALL_FRAMES) { Label nextBasicBlock = new Label(); nextBasicBlock.frame = new Frame(nextBasicBlock); nextBasicBlock.resolve(code.data, code.length); lastBasicBlock.nextBasicBlock = nextBasicBlock; lastBasicBlock = nextBasicBlock; currentBasicBlock = null; } else if (compute == COMPUTE_MAX_STACK_AND_LOCAL) { currentBasicBlock.outputStackMax = (short) maxRelativeStackSize; currentBasicBlock = null; } }
currentLocals = argumentsSize; firstBasicBlock = new Label(); visitLabel(firstBasicBlock);
visitLabel(new Label());
if (isLast) { mv.visitInsn(DUP); Label label = new Label(); mv.visitJumpInsn(IFNONNULL, label); mv.visitInsn(POP); if (isLast) { mv.visitInsn(DUP); Label label = new Label(); mv.visitJumpInsn(IFNONNULL, label); mv.visitInsn(POP); if (isLast) { mv.visitInsn(DUP); Label label = new Label(); mv.visitJumpInsn(IFNONNULL, label); mv.visitInsn(POP); if (isLast) { mv.visitInsn(DUP); Label label = new Label(); mv.visitJumpInsn(IFNONNULL, label); mv.visitInsn(POP); if (isLast) { mv.visitInsn(DUP); Label label = new Label(); mv.visitJumpInsn(IFNONNULL, label); mv.visitInsn(POP);
if (previousFrame == null) { int argumentsSize = Type.getArgumentsAndReturnSizes(descriptor) >> 2; Frame implicitFirstFrame = new Frame(new Label()); implicitFirstFrame.setInputFrameFromDescriptor( symbolTable, accessFlags, descriptor, argumentsSize);