Interface Check


public interface Check
Utility for explicitly checking the stack at a given point in a bytecode sequence.
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static <N> Emitter<N>
    expect(Emitter<N> em)
    Explicitly check the stack at this point in the bytecode sequence
  • Method Details

    • expect

      static <N> Emitter<N> expect(Emitter<N> em)
      Explicitly check the stack at this point in the bytecode sequence

      This is meant to be used with chosen type parameters, e.g.:

       return em
                      .emit(Op::ldc__i, 42)
                      .emit(Check::<Ent<Bot, TInt>> expect);
       

      Granted, that's not a particularly complicated case warranting such a check, it demonstrates the idiom for placing the check. These are often only in place while the sequence is devised, and then removed.

      Type Parameters:
      N - the expected stack
      Parameters:
      em - the emitter typed with the expected stack
      Returns:
      the same emitter