/** * Detects a JSR instruction and sets a flag to indicate we will need to do * inlining. */ @Override public void visitJumpInsn(final int opcode, final Label lbl) { super.visitJumpInsn(opcode, lbl); LabelNode ln = ((JumpInsnNode) instructions.getLast()).label; if (opcode == JSR && !subroutineHeads.containsKey(ln)) { subroutineHeads.put(ln, new BitSet()); } }
private void registerSelfStackTopInsnNode() { List<Object> stack = this.stack; if (stack != null && !stack.isEmpty() && stack.get(stack.size() - 1).equals(this.metadataClass.getInternalName())) { this.selfWillBeStackTopInsnMap.put( ((MethodNode)this.mv).instructions.getLast(), stack.size() ); } }
InsnListIterator(int index) { if (index == size()) { next = null; prev = getLast(); } else { next = get(index); prev = next.prev; } }
@Override public AnnotationVisitor visitInsnAnnotation(int typeRef, TypePath typePath, String desc, boolean visible) { // Finds the last real instruction, i.e. the instruction targeted by // this annotation. AbstractInsnNode insn = instructions.getLast(); while (insn.getOpcode() == -1) { insn = insn.getPrevious(); } // Adds the annotation to this instruction. TypeAnnotationNode an = new TypeAnnotationNode(typeRef, typePath, desc); if (visible) { if (insn.visibleTypeAnnotations == null) { insn.visibleTypeAnnotations = new ArrayList<TypeAnnotationNode>( 1); } insn.visibleTypeAnnotations.add(an); } else { if (insn.invisibleTypeAnnotations == null) { insn.invisibleTypeAnnotations = new ArrayList<TypeAnnotationNode>( 1); } insn.invisibleTypeAnnotations.add(an); } return an; }
AbstractInsnNode lastInsnNode = methodEntry.methodNode.instructions.getLast(); AbstractInsnNode previousOfLastInsnNode = lastInsnNode.getPrevious(); if (firstInsnNode.getOpcode() != Opcodes.ALOAD ||
abstractInsnNode = tmpInstructions.getLast(); instructions.insertBefore(nextInsnNode, tmpInstructions); } else if (methodInsnNode.name.equals("isProvider") &&
for (AbstractInsnNode abstractInsnNode = instructions.getLast(); abstractInsnNode != null; abstractInsnNode = abstractInsnNode.getPrevious()) {
false)); tmpInstructions.add(new TypeInsnNode(Opcodes.CHECKCAST, "[Ljava/lang/Object;")); abstractInsnNode = tmpInstructions.getLast(); instructions.insertBefore(typeInsnNode, tmpInstructions); instructions.remove(typeInsnNode);