Class Initialiser
java.lang.Object
org.spongepowered.asm.mixin.transformer.struct.Initialiser
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumStrategy for injecting initialiser insns -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final int[]List of opcodes which must not appear in a class initialiser, mainly a sanity check so that if any of the specified opcodes are found, we can log it as an error condition and then people can bitch at me to fix it. -
Constructor Summary
ConstructorsConstructorDescriptionInitialiser(MixinTargetContext mixin, org.objectweb.asm.tree.MethodNode ctor, InsnRange range) -
Method Summary
Modifier and TypeMethodDescriptionorg.objectweb.asm.tree.MethodNodegetCtor()Get the source constructorDeque<org.objectweb.asm.tree.AbstractInsnNode> getInsns()Get the extracted instructionsintGet the MAXS for the original (source) constructorvoidinjectInto(Constructor ctor) Inject initialiser code into the target constructorintsize()Get the number of instructions in the extracted initialiser
-
Field Details
-
OPCODE_BLACKLIST
protected static final int[] OPCODE_BLACKLISTList of opcodes which must not appear in a class initialiser, mainly a sanity check so that if any of the specified opcodes are found, we can log it as an error condition and then people can bitch at me to fix it. Essentially if it turns out that field initialisers can somehow make use of local variables, then I need to write some code to ensure that said locals are shifted so that they don't interfere with locals in the receiving constructor.
-
-
Constructor Details
-
Initialiser
public Initialiser(MixinTargetContext mixin, org.objectweb.asm.tree.MethodNode ctor, InsnRange range)
-
-
Method Details
-
size
public int size()Get the number of instructions in the extracted initialiser -
getMaxStack
public int getMaxStack()Get the MAXS for the original (source) constructor -
getCtor
public org.objectweb.asm.tree.MethodNode getCtor()Get the source constructor -
getInsns
Get the extracted instructions -
injectInto
Inject initialiser code into the target constructor- Parameters:
ctor- Constructor to inject into
-