@Override public void visitMethodInsn( final int opcode, final String owner, final String name, final String descriptor, final boolean isInterface) { if (api < Opcodes.ASM5) { super.visitMethodInsn(opcode, owner, name, descriptor, isInterface); return; } doVisitMethodInsn(opcode, owner, name, descriptor, isInterface); }
/** * Returns the remaining leeway of a method's allowed size. * * @param methodNode the {@link MethodNode} to check. * @return the remaining leeway of a method's allowed size. */ protected int getSizeLeeway(MethodNode methodNode) { CodeSizeEvaluator cse = new CodeSizeEvaluator(null); methodNode.accept(cse); // Max allowed method size is 65534 (https://docs.oracle.com/javase/specs/jvms/se10/html/jvms-4.html#jvms-4.7.3) return (65534 - cse.getMaxSize()); }
@Override public void visitEnd() { super.visitEnd(); if (getMaxSize() > 64 * 1024) { state = State.FAIL_TOO_LONG; message = "the method " + name + " was too long."; } } };
@Override public void visitEnd() { super.visitEnd(); System.out.printf("%s: [%d, %d]\n", method.methodName, getMinSize(), getMaxSize()); } }
@Override public void visitMethodInsn( final int opcode, final String owner, final String name, final String descriptor, final boolean isInterface) { if (api < Opcodes.ASM5) { super.visitMethodInsn(opcode, owner, name, descriptor, isInterface); return; } doVisitMethodInsn(opcode, owner, name, descriptor, isInterface); }
@Override public void visitMethodInsn( final int opcode, final String owner, final String name, final String descriptor, final boolean isInterface) { if (api < Opcodes.ASM5) { super.visitMethodInsn(opcode, owner, name, descriptor, isInterface); return; } doVisitMethodInsn(opcode, owner, name, descriptor, isInterface); }
@Override public void visitMethodInsn(final int opcode, final String owner, final String name, final String desc, final boolean itf) { if (api < Opcodes.ASM5) { super.visitMethodInsn(opcode, owner, name, desc, itf); return; } doVisitMethodInsn(opcode, owner, name, desc, itf); }
@Deprecated @Override public void visitMethodInsn(final int opcode, final String owner, final String name, final String desc) { if (api >= Opcodes.ASM5) { super.visitMethodInsn(opcode, owner, name, desc); return; } doVisitMethodInsn(opcode, owner, name, desc, opcode == Opcodes.INVOKEINTERFACE); }
/** * Deprecated. * * @deprecated use {@link #visitMethodInsn(int, String, String, String, boolean)} instead. */ @Deprecated @Override public void visitMethodInsn( final int opcode, final String owner, final String name, final String descriptor) { if (api >= Opcodes.ASM5) { super.visitMethodInsn(opcode, owner, name, descriptor); return; } doVisitMethodInsn(opcode, owner, name, descriptor, opcode == Opcodes.INVOKEINTERFACE); }
/** * Deprecated. * * @deprecated use {@link #visitMethodInsn(int, String, String, String, boolean)} instead. */ @Deprecated @Override public void visitMethodInsn( final int opcode, final String owner, final String name, final String descriptor) { if (api >= Opcodes.ASM5) { super.visitMethodInsn(opcode, owner, name, descriptor); return; } doVisitMethodInsn(opcode, owner, name, descriptor, opcode == Opcodes.INVOKEINTERFACE); }
/** * Deprecated. * * @deprecated use {@link #visitMethodInsn(int, String, String, String, boolean)} instead. */ @Deprecated @Override public void visitMethodInsn( final int opcode, final String owner, final String name, final String descriptor) { if (api >= Opcodes.ASM5) { super.visitMethodInsn(opcode, owner, name, descriptor); return; } doVisitMethodInsn(opcode, owner, name, descriptor, opcode == Opcodes.INVOKEINTERFACE); }