/** * {@inheritDoc} */ public StackSize getStackSize() { return delegate.getStackSize(); }
/** * {@inheritDoc} */ public StackSize getStackSize() { return asErasure().getStackSize(); }
/** * {@inheritDoc} */ public StackSize getStackSize() { return asErasure().getStackSize(); }
/** * {@inheritDoc} */ public Size apply(MethodVisitor methodVisitor, Implementation.Context implementationContext) { methodVisitor.visitMethodInsn(Opcodes.INVOKEVIRTUAL, METHOD_HANDLE_NAME, INVOKE_EXACT, methodType.getDescriptor(), false); int size = methodType.getReturnType().getStackSize().getSize() - methodType.getParameterTypes().getStackSize(); return new Size(size, Math.max(size, 0)); } }
/** * {@inheritDoc} */ public Size apply(MethodVisitor methodVisitor, Implementation.Context implementationContext) { StringBuilder stringBuilder = new StringBuilder("("); for (TypeDescription parameterType : parameterTypes) { stringBuilder.append(parameterType.getDescriptor()); } String methodDescriptor = stringBuilder.append(')').append(returnType.getDescriptor()).toString(); methodVisitor.visitInvokeDynamicInsn(methodName, methodDescriptor, new Handle(handle == legacyHandle || implementationContext.getClassFileVersion().isAtLeast(ClassFileVersion.JAVA_V11) ? handle : legacyHandle, bootstrapMethod.getDeclaringType().getInternalName(), bootstrapMethod.getInternalName(), bootstrapMethod.getDescriptor(), bootstrapMethod.getDeclaringType().isInterface()), arguments.toArray(new Object[arguments.size()])); int stackSize = returnType.getStackSize().getSize() - StackSize.of(parameterTypes); return new Size(stackSize, Math.max(stackSize, 0)); } }
/** * {@inheritDoc} */ public int getOffset() { TypeList parameterType = getDeclaringMethod().getParameters().asTypeList().asErasures(); int offset = getDeclaringMethod().isStatic() ? StackSize.ZERO.getSize() : StackSize.SINGLE.getSize(); for (int i = 0; i < getIndex(); i++) { offset += parameterType.get(i).getStackSize().getSize(); } return offset; }
methodVisitor.visitFrame( Opcodes.F_SAME, 0, null, 0, null ); return new Size( 1 + 2 * persistentField.getType().asErasure().getStackSize().getSize(), instrumentedMethod.getStackSize() );
methodVisitor.visitFrame( Opcodes.F_SAME, 0, null, 0, null ); return new Size( 1 + 2 * persistentField.getType().asErasure().getStackSize().getSize(), instrumentedMethod.getStackSize() );