/** * Returns the argument types of the method described by this object. * * @return the argument types of the method described by this object. */ public Type[] getArgumentTypes() { return Type.getArgumentTypes(desc); }
public static Type[] getArgumentTypes(MethodNode m){ return Type.getArgumentTypes(m.desc); }
public static int getArgumentSize(MethodNode m){ return Type.getArgumentTypes(m.desc).length; }
/** * Returns the argument types of methods of this type. This method should * only be used for method types. * * @return the argument types of methods of this type. */ public Type[] getArgumentTypes() { return getArgumentTypes(getDescriptor()); }
public static Class<?>[] getArgumentClassTypes(MethodNode m) { Type[] argTypes = Type.getArgumentTypes(m.desc); if(argTypes == null || argTypes.length == 0) { return Arrays2.EMPTY_CLASS_ARRAY; } Class<?>[] classTypes = new Class<?>[argTypes.length]; for(int i=0;i<argTypes.length;i++) { classTypes[i] = getClassType(argTypes[i]); } return classTypes; }
public LocalVariableTableVisitor(Class<?> clazz, Map<Member, String[]> map, String name, String desc, boolean isStatic) { super(ASM.API); this.clazz = clazz; this.memberMap = map; this.name = name; // determine args args = Type.getArgumentTypes(desc); this.parameterNames = new String[args.length]; this.isStatic = isStatic; this.lvtSlotIndex = computeLvtSlotIndices(isStatic, args); }
@Override public AnnotationVisitor visitParameterAnnotation(final int parameter, final String desc, final boolean visible) { AnnotationNode an = new AnnotationNode(desc); if (visible) { if (visibleParameterAnnotations == null) { int params = Type.getArgumentTypes(this.desc).length; visibleParameterAnnotations = (List<AnnotationNode>[]) new List<?>[params]; } if (visibleParameterAnnotations[parameter] == null) { visibleParameterAnnotations[parameter] = new ArrayList<AnnotationNode>( 1); } visibleParameterAnnotations[parameter].add(an); } else { if (invisibleParameterAnnotations == null) { int params = Type.getArgumentTypes(this.desc).length; invisibleParameterAnnotations = (List<AnnotationNode>[]) new List<?>[params]; } if (invisibleParameterAnnotations[parameter] == null) { invisibleParameterAnnotations[parameter] = new ArrayList<AnnotationNode>( 1); } invisibleParameterAnnotations[parameter].add(an); } return an; }
/** * Creates a new {@link GeneratorAdapter}. * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. * @param mv * the method visitor to which this adapter delegates calls. * @param access * the method's access flags (see {@link Opcodes}). * @param name * the method's name. * @param desc * the method's descriptor (see {@link Type Type}). */ protected GeneratorAdapter(final int api, final MethodVisitor mv, final int access, final String name, final String desc) { super(api, access, desc, mv); this.access = access; this.returnType = Type.getReturnType(desc); this.argumentTypes = Type.getArgumentTypes(desc); }
/** * Creates a new {@link LocalVariablesSorter}. * * @param api * the ASM API version implemented by this visitor. Must be one * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. * @param access * access flags of the adapted method. * @param desc * the method's descriptor (see {@link Type Type}). * @param mv * the method visitor to which this adapter delegates calls. */ protected LocalVariablesSorter(final int api, final int access, final String desc, final MethodVisitor mv) { super(api, mv); Type[] args = Type.getArgumentTypes(desc); nextLocal = (Opcodes.ACC_STATIC & access) == 0 ? 1 : 0; for (int i = 0; i < args.length; i++) { nextLocal += args[i].getSize(); } firstLocal = nextLocal; }
public String mapMethodDesc(String desc) { if ("()V".equals(desc)) { return desc; } Type[] args = Type.getArgumentTypes(desc); StringBuilder sb = new StringBuilder("("); for (int i = 0; i < args.length; i++) { sb.append(mapDesc(args[i].getDescriptor())); } Type returnType = Type.getReturnType(desc); if (returnType == Type.VOID_TYPE) { sb.append(")V"); return sb.toString(); } sb.append(')').append(mapDesc(returnType.getDescriptor())); return sb.toString(); }
void addMethodDesc(final String desc) { addType(Type.getReturnType(desc)); Type[] types = Type.getArgumentTypes(desc); for (int i = 0; i < types.length; i++) { addType(types[i]); } }
Type[] types = Type.getArgumentTypes(desc); for (int i = 0; i < types.length; ++i) { Type type = types[i];
private void pop(final String desc) { char c = desc.charAt(0); if (c == '(') { int n = 0; Type[] types = Type.getArgumentTypes(desc); for (int i = 0; i < types.length; ++i) { n += types[i].getSize(); } pop(n); } else if (c == 'J' || c == 'D') { pop(2); } else { pop(1); } }
if (visible) { if (panns == null) { panns = new AnnotationWriter[Type.getArgumentTypes(descriptor).length]; } else { if (ipanns == null) { ipanns = new AnnotationWriter[Type.getArgumentTypes(descriptor).length];
Type[] args = Type.getArgumentTypes(desc); while (i < values.size()) { BasicValue expected = newValue(args[j++]);
int synthetics = Type.getArgumentTypes(context.desc).length - n; AnnotationVisitor av; for (i = 0; i < synthetics; ++i) {
@Override public void visitInvokeDynamicInsn(String name, String desc, Handle bsm, Object... bsmArgs) { mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs); if (constructor) { Type[] types = Type.getArgumentTypes(desc); for (int i = 0; i < types.length; i++) { popValue(); if (types[i].getSize() == 2) { popValue(); } } Type returnType = Type.getReturnType(desc); if (returnType != Type.VOID_TYPE) { pushValue(OTHER); if (returnType.getSize() == 2) { pushValue(OTHER); } } } }
mv.visitMethodInsn(opcode, owner, name, desc, itf); if (constructor) { Type[] types = Type.getArgumentTypes(desc); for (int i = 0; i < types.length; i++) { popValue();
Frame<V> handler = newFrame(m.maxLocals, m.maxStack); current.setReturn(interpreter.newValue(Type.getReturnType(m.desc))); Type[] args = Type.getArgumentTypes(m.desc); int local = 0; if ((m.access & ACC_STATIC) == 0) {
Type[] args = Type.getArgumentTypes(descriptor); f.initInputFrame(cw, access, args, this.maxLocals); visitFrame(f);