/** * {@inheritDoc} */ public int getRequiredVariablePadding() { return StackSize.ZERO.getSize(); } }
/** * {@inheritDoc} */ public int getRequiredVariablePadding() { return StackSize.ZERO.getSize(); } }
/** * Creates an instance of a * {@link StackManipulation.Size} * that describes a stack decrease of this size. * * @return A stack size decrease by the size represented by this stack size. */ public StackManipulation.Size toDecreasingSize() { return new StackManipulation.Size(-1 * getSize(), 0); }
/** * Computes the stack size of all supplied types. * * @param typeDefinitions The types for which to compute the size. * @return The total size of all types. */ public static int of(Collection<? extends TypeDefinition> typeDefinitions) { int size = 0; for (TypeDefinition typeDefinition : typeDefinitions) { size += typeDefinition.getStackSize().getSize(); } return size; }
/** * {@inheritDoc} */ public int getStackSize() { int stackSize = 0; for (TypeDescription.Generic typeDescription : this) { stackSize += typeDescription.getStackSize().getSize(); } return stackSize; }
@Override protected Size resolveSize(StackSize fieldSize) { int sizeChange = fieldSize.getSize() - targetSizeChange; return new Size(sizeChange, sizeChange); } }
@Override protected Size resolveSize(StackSize fieldSize) { return new Size(-1 * (fieldSize.getSize() + targetSizeChange), 0); } }
/** * {@inheritDoc} */ public int enter() { return instrumentedMethod.getStackSize() + exitType.getStackSize().getSize() + StackSize.of(namedTypes.values()); }
/** * {@inheritDoc} */ public int enter() { return instrumentedMethod.getStackSize() + exitType.getStackSize().getSize() + StackSize.of(namedTypes.values()); }
/** * {@inheritDoc} */ public ParameterDescription.InDefinedShape get(int index) { int offset = declaringMethod.isStatic() ? 0 : 1; for (ParameterDescription.Token token : tokens.subList(0, index)) { offset += token.getType().getStackSize().getSize(); } return new ParameterDescription.Latent(declaringMethod, tokens.get(index), index, offset); }
/** * {@inheritDoc} */ public int mapped(int offset) { return instrumentedMethod.getStackSize() + exitType.getStackSize().getSize() + StackSize.of(namedTypes.values()) - adviceMethod.getStackSize() + offset; } }
/** * {@inheritDoc} */ public int named(String name) { return instrumentedMethod.getStackSize() + exitType.getStackSize().getSize() + StackSize.of(namedTypes.headMap(name).values()); }
/** * {@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)); } }