java.lang.Object
org.spongepowered.asm.mixin.transformer.struct.Initialiser

public class Initialiser extends Object
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Strategy for injecting initialiser insns
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected 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

    Constructors
    Constructor
    Description
    Initialiser(MixinTargetContext mixin, org.objectweb.asm.tree.MethodNode ctor, InsnRange range)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.objectweb.asm.tree.MethodNode
    Get the source constructor
    Deque<org.objectweb.asm.tree.AbstractInsnNode>
    Get the extracted instructions
    int
    Get the MAXS for the original (source) constructor
    void
    Inject initialiser code into the target constructor
    int
    Get the number of instructions in the extracted initialiser

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • OPCODE_BLACKLIST

      protected static final int[] OPCODE_BLACKLIST
      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. 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

  • 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

      public Deque<org.objectweb.asm.tree.AbstractInsnNode> getInsns()
      Get the extracted instructions
    • injectInto

      public void injectInto(Constructor ctor)
      Inject initialiser code into the target constructor
      Parameters:
      ctor - Constructor to inject into