Top Description Inners Fields Constructors Methods
net.bytebuddy.implementation.bytecode

public sealed Enum Duplication

extends Enum<Duplication>
implements StackManipulation
Class Inheritance
All Implemented Interfaces
net.bytebuddy.implementation.bytecode.StackManipulation
Imports
net.bytebuddy.description.type.TypeDefinition, net.bytebuddy.implementation.Implementation, net.bytebuddy.jar.asm.MethodVisitor, .Opcodes

Duplicates a value that is lying on top of the stack.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static enum
Duplication.WithFlip

A duplication that flips a value over the second value on the operand stack.

Field Summary

Modifier and TypeField and Description
public static final Duplication
DOUBLE

A duplication of a double-sized stack value.

private final int
opcode

The opcode that represents the manipulation.

public static final Duplication
SINGLE

A duplication of a single-sized stack values.

protected final StackManipulation.Size
size

The size representing the impact of applying the duplication onto the operand stack.

public static final Duplication
ZERO

A duplication of no values.

Constructor Summary

AccessConstructor and Description
private
Duplication(StackSize
The size representing the impact of applying the duplication onto the operand stack.
stackSize
,
int
The opcode that represents the manipulation.
opcode
)

Creates a new duplication.

Method Summary

Modifier and TypeMethod and Description
public StackManipulation.Size
apply(MethodVisitor
The method visitor used to write the method implementation to.
methodVisitor
,
Implementation.Context
The context of the current implementation.
implementationContext
)

Implements net.bytebuddy.implementation.bytecode.StackManipulation.apply.

Applies the stack manipulation that is described by this instance.
public abstract StackManipulation

Returns:

A stack manipulation that represents such a duplication flip.
flipOver
(TypeDefinition
The type of the second element on the operand stack.
typeDefinition
)

Creates a duplication that flips the stack's top value over the second stack element.

public boolean
isValid()

Implements net.bytebuddy.implementation.bytecode.StackManipulation.isValid.

Determines if this stack manipulation is valid.
public static Duplication

Returns:

A stack manipulation that duplicates the given type.
of
(TypeDefinition
The type to be duplicated.
typeDefinition
)

Duplicates a value given its type.

public static Duplication
public static Duplication[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

DOUBLEback to summary
public static final Duplication DOUBLE

A duplication of a double-sized stack value.

opcodeback to summary
private final int opcode

The opcode that represents the manipulation.

SINGLEback to summary
public static final Duplication SINGLE

A duplication of a single-sized stack values.

sizeback to summary
protected final StackManipulation.Size size

The size representing the impact of applying the duplication onto the operand stack.

ZEROback to summary
public static final Duplication ZERO

A duplication of no values. This corresponds a no-op instruction.

Constructor Detail

Duplicationback to summary
private Duplication(StackSize stackSize, int opcode)

Creates a new duplication.

Parameters
stackSize:StackSize

The size representing the impact of applying the duplication onto the operand stack.

opcode:int

The opcode that represents the manipulation.

Method Detail

applyback to summary
public StackManipulation.Size apply(MethodVisitor methodVisitor, Implementation.Context implementationContext)

Implements net.bytebuddy.implementation.bytecode.StackManipulation.apply.

Doc from net.bytebuddy.implementation.bytecode.StackManipulation.apply.

Applies the stack manipulation that is described by this instance.

Parameters
methodVisitor:MethodVisitor

The method visitor used to write the method implementation to.

implementationContext:Implementation.Context

The context of the current implementation.

Returns:StackManipulation.Size

The changes to the size of the operand stack that are implied by this stack manipulation.

flipOverback to summary
public abstract StackManipulation flipOver(TypeDefinition typeDefinition)

Creates a duplication that flips the stack's top value over the second stack element.

Parameters
typeDefinition:TypeDefinition

The type of the second element on the operand stack.

Returns:StackManipulation

A stack manipulation that represents such a duplication flip.

isValidback to summary
public boolean isValid()

Implements net.bytebuddy.implementation.bytecode.StackManipulation.isValid.

Doc from net.bytebuddy.implementation.bytecode.StackManipulation.isValid.

Determines if this stack manipulation is valid.

Returns:boolean

If false, this manipulation cannot be applied and should throw an exception.

ofback to summary
public static Duplication of(TypeDefinition typeDefinition)

Duplicates a value given its type.

Parameters
typeDefinition:TypeDefinition

The type to be duplicated.

Returns:Duplication

A stack manipulation that duplicates the given type.

valueOfback to summary
public static Duplication valueOf(String name)
valuesback to summary
public static Duplication[] values()
net.bytebuddy.implementation.bytecode back to summary

protected final Enum Duplication.WithFlip

extends Enum<Duplication.WithFlip>
implements StackManipulation
Class Inheritance
All Implemented Interfaces
net.bytebuddy.implementation.bytecode.StackManipulation

A duplication that flips a value over the second value on the operand stack.

Field Summary

Modifier and TypeField and Description
public static final Duplication.WithFlip
DOUBLE_DOUBLE

A flip instruction that flips a double-sized element over another double-size element.

public static final Duplication.WithFlip
DOUBLE_SINGLE

A flip instruction that flips a single-sized element over a double-size element.

private final int
opcode

The opcode to apply.

public static final Duplication.WithFlip
SINGLE_DOUBLE

A flip instruction that flips a double-sized element over a single-size element.

public static final Duplication.WithFlip
SINGLE_SINGLE

A flip instruction that flips a single-sized element over another single-size element.

private final StackSize
stackSize

The size that is added to the operand stack.

Constructor Summary

AccessConstructor and Description
private
WithFlip(int
The opcode to apply.
opcode
,
StackSize
The size that is added to the operand stack.
stackSize
)

Creates a flip duplication.

Method Summary

Modifier and TypeMethod and Description
public StackManipulation.Size
apply(MethodVisitor
The method visitor used to write the method implementation to.
methodVisitor
,
Implementation.Context
The context of the current implementation.
implementationContext
)

Implements net.bytebuddy.implementation.bytecode.StackManipulation.apply.

Applies the stack manipulation that is described by this instance.
public boolean
isValid()

Implements net.bytebuddy.implementation.bytecode.StackManipulation.isValid.

Determines if this stack manipulation is valid.
public static Duplication.WithFlip
public static Duplication.WithFlip[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

DOUBLE_DOUBLEback to summary
public static final Duplication.WithFlip DOUBLE_DOUBLE

A flip instruction that flips a double-sized element over another double-size element.

DOUBLE_SINGLEback to summary
public static final Duplication.WithFlip DOUBLE_SINGLE

A flip instruction that flips a single-sized element over a double-size element.

opcodeback to summary
private final int opcode

The opcode to apply.

SINGLE_DOUBLEback to summary
public static final Duplication.WithFlip SINGLE_DOUBLE

A flip instruction that flips a double-sized element over a single-size element.

SINGLE_SINGLEback to summary
public static final Duplication.WithFlip SINGLE_SINGLE

A flip instruction that flips a single-sized element over another single-size element.

stackSizeback to summary
private final StackSize stackSize

The size that is added to the operand stack.

Constructor Detail

WithFlipback to summary
private WithFlip(int opcode, StackSize stackSize)

Creates a flip duplication.

Parameters
opcode:int

The opcode to apply.

stackSize:StackSize

The size that is added to the operand stack.

Method Detail

applyback to summary
public StackManipulation.Size apply(MethodVisitor methodVisitor, Implementation.Context implementationContext)

Implements net.bytebuddy.implementation.bytecode.StackManipulation.apply.

Doc from net.bytebuddy.implementation.bytecode.StackManipulation.apply.

Applies the stack manipulation that is described by this instance.

Parameters
methodVisitor:MethodVisitor

The method visitor used to write the method implementation to.

implementationContext:Implementation.Context

The context of the current implementation.

Returns:StackManipulation.Size

The changes to the size of the operand stack that are implied by this stack manipulation.

isValidback to summary
public boolean isValid()

Implements net.bytebuddy.implementation.bytecode.StackManipulation.isValid.

Doc from net.bytebuddy.implementation.bytecode.StackManipulation.isValid.

Determines if this stack manipulation is valid.

Returns:boolean

If false, this manipulation cannot be applied and should throw an exception.

valueOfback to summary
public static Duplication.WithFlip valueOf(String name)
valuesback to summary
public static Duplication.WithFlip[] values()