本文整理汇总了Java中net.bytebuddy.implementation.bytecode.StackSize.getSize方法的典型用法代码示例。如果您正苦于以下问题:Java StackSize.getSize方法的具体用法?Java StackSize.getSize怎么用?Java StackSize.getSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.bytebuddy.implementation.bytecode.StackSize
的用法示例。
在下文中一共展示了StackSize.getSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drainStack
import net.bytebuddy.implementation.bytecode.StackSize; //导入方法依赖的package包/类
/**
* Drains the stack to only contain the top value. For this, the value on top of the stack is temporarily stored
* in the local variable array until all values on the stack are popped off. Subsequently, the top value is pushed
* back onto the operand stack.
*
* @param store The opcode used for storing the top value.
* @param load The opcode used for loading the top value.
* @param size The size of the value on top of the operand stack.
* @return The minimal size of the local variable array that is required to perform the operation.
*/
public int drainStack(int store, int load, StackSize size) {
int difference = current.get(current.size() - 1).getSize() - size.getSize();
if (current.size() == 1 && difference == 0) {
return 0;
} else {
super.visitVarInsn(store, freeIndex);
if (difference == 1) {
super.visitInsn(Opcodes.POP);
} else if (difference != 0) {
throw new IllegalStateException("Unexpected remainder on the operand stack: " + difference);
}
doDrain(current.subList(0, current.size() - 1));
super.visitVarInsn(load, freeIndex);
return freeIndex + size.getSize();
}
}
示例2: resolveSize
import net.bytebuddy.implementation.bytecode.StackSize; //导入方法依赖的package包/类
@Override
protected Size resolveSize(StackSize fieldSize) {
int sizeChange = fieldSize.getSize() - targetSizeChange;
return new Size(sizeChange, sizeChange);
}
示例3: MethodInvocationTest
import net.bytebuddy.implementation.bytecode.StackSize; //导入方法依赖的package包/类
public MethodInvocationTest(StackSize stackSize) {
this.stackSize = stackSize;
this.expectedSize = stackSize.getSize() - ARGUMENT_STACK_SIZE;
}