Class BinaryBooleanExpressionHelper


public class BinaryBooleanExpressionHelper extends BinaryIntExpressionHelper
Binary write operations specialised for Booleans
  • Constructor Details

    • BinaryBooleanExpressionHelper

      public BinaryBooleanExpressionHelper(WriterController wc)
      Creates a boolean-specialized binary expression helper.
      Parameters:
      wc - the active writer controller
  • Method Details

    • getArrayGetResultType

      protected ClassNode getArrayGetResultType()
      Overrides:
      getArrayGetResultType in class BinaryExpressionWriter
      Returns:
      the result type produced by BinaryExpressionWriter.getArrayGetCaller()
    • writePostOrPrefixMethod

      public boolean writePostOrPrefixMethod(int operation, boolean simulate)
      Attempts to write a postfix or prefix increment/decrement operation.
      Overrides:
      writePostOrPrefixMethod in class BinaryExpressionWriter
      Parameters:
      operation - the token type
      simulate - whether to probe support without emitting bytecode
      Returns:
      true if the operation is supported
    • writeStdOperators

      protected boolean writeStdOperators(int type, boolean simulate)
      Writes a standard arithmetic operator for the current primitive type.
      Overrides:
      writeStdOperators in class BinaryExpressionWriter
      Parameters:
      type - the token type
      simulate - whether to probe support without emitting bytecode
      Returns:
      true if the operation is supported
    • writeDivision

      protected boolean writeDivision(boolean simulate)
      Writes a division operation for the current primitive type.
      Overrides:
      writeDivision in class BinaryExpressionWriter
      Parameters:
      simulate - whether to probe support without emitting bytecode
      Returns:
      true if division is supported
    • getNormalOpResultType

      protected ClassNode getNormalOpResultType()
      Overrides:
      getNormalOpResultType in class BinaryIntExpressionHelper
      Returns:
      the result type for normal arithmetic operations
    • getDevisionOpResultType

      protected ClassNode getDevisionOpResultType()
      Overrides:
      getDevisionOpResultType in class BinaryIntExpressionHelper
      Returns:
      the result type for division operations
    • getShiftOperationBytecode

      protected int getShiftOperationBytecode(int type)
      Returns the shift opcode for the supplied token.
      Overrides:
      getShiftOperationBytecode in class BinaryIntExpressionHelper
      Parameters:
      type - the normalized token index
      Returns:
      the ASM opcode
    • getStandardOperationBytecode

      protected int getStandardOperationBytecode(int type)
      Returns the arithmetic opcode for the supplied token.
      Overrides:
      getStandardOperationBytecode in class BinaryIntExpressionHelper
      Parameters:
      type - the normalized token index
      Returns:
      the ASM opcode
    • removeTwoOperands

      protected void removeTwoOperands(org.objectweb.asm.MethodVisitor mv)
      Removes the two operands already on the operand stack.
      Overrides:
      removeTwoOperands in class BinaryIntExpressionHelper
      Parameters:
      mv - the current method visitor
    • writePlusPlus

      protected void writePlusPlus(org.objectweb.asm.MethodVisitor mv)
      Emits a prefix/postfix increment.
      Overrides:
      writePlusPlus in class BinaryIntExpressionHelper
      Parameters:
      mv - the current method visitor
    • writeMinusMinus

      protected void writeMinusMinus(org.objectweb.asm.MethodVisitor mv)
      Emits a prefix/postfix decrement.
      Overrides:
      writeMinusMinus in class BinaryIntExpressionHelper
      Parameters:
      mv - the current method visitor
    • doubleTwoOperands

      protected void doubleTwoOperands(org.objectweb.asm.MethodVisitor mv)
      Duplicates the two operands already on the operand stack.
      Overrides:
      doubleTwoOperands in class BinaryIntExpressionHelper
      Parameters:
      mv - the current method visitor