Class SuperBlock

java.lang.Object
org.mozilla.classfile.SuperBlock

final class SuperBlock extends Object
A super block is defined as a contiguous chunk of code with a single entry point and multiple exit points (therefore ending in an unconditional jump or the end of the method). This is used to emulate OpenJDK's compiler, which outputs stack map frames at the start of every super block except the method start.
  • Field Details

    • index

      private int index
    • start

      private int start
    • end

      private int end
    • locals

      private int[] locals
    • stack

      private int[] stack
    • isInitialized

      private boolean isInitialized
    • isInQueue

      private boolean isInQueue
  • Constructor Details

    • SuperBlock

      SuperBlock(int index, int start, int end, int[] initialLocals)
  • Method Details

    • getIndex

      int getIndex()
    • getLocals

      int[] getLocals()
    • getTrimmedLocals

      int[] getTrimmedLocals()
      Get a copy of the super block's locals without any trailing TOP types. This is useful for actual writing stack maps; during the computation of stack map types, all local arrays have the same size; the max locals for the method. In addition, DOUBLE and LONG types have trailing TOP types because they occupy two words. For writing purposes, these are not useful.
    • getStack

      int[] getStack()
    • merge

      boolean merge(int[] locals, int localsTop, int[] stack, int stackTop, ConstantPool pool)
    • mergeState

      private static boolean mergeState(int[] current, int[] incoming, int size, ConstantPool pool)
      Merge an operand stack or local variable array with incoming state. They are treated the same way; by this point, it should already be ensured that the array sizes are the same, which is the only additional constraint that is imposed on merging operand stacks (the local variable array is always the same size).
    • getStart

      int getStart()
    • getEnd

      int getEnd()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isInitialized

      boolean isInitialized()
    • setInitialized

      void setInitialized(boolean b)
    • isInQueue

      boolean isInQueue()
    • setInQueue

      void setInQueue(boolean b)