Class BinaryFloatExpressionHelper

java.lang.Object
org.codehaus.groovy.classgen.asm.BinaryExpressionWriter
org.codehaus.groovy.classgen.asm.BinaryFloatExpressionHelper

public class BinaryFloatExpressionHelper extends BinaryExpressionWriter
Binary expression helper specialized for float operations.
  • Constructor Details

    • BinaryFloatExpressionHelper

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

    • doubleTwoOperands

      protected void doubleTwoOperands(org.objectweb.asm.MethodVisitor mv)
      Duplicates the two operands already on the operand stack.
      Specified by:
      doubleTwoOperands in class BinaryExpressionWriter
      Parameters:
      mv - the current method visitor
    • writeBitwiseOp

      protected boolean writeBitwiseOp(int type, boolean simulate)
      writes some the bitwise operations. type is one of BITWISE_OR, BITWISE_AND, BITWISE_XOR
      Overrides:
      writeBitwiseOp in class BinaryExpressionWriter
      Parameters:
      type - the token type
      Returns:
      true if a successful bitwise operation write
    • getBitwiseOperationBytecode

      protected int getBitwiseOperationBytecode(int type)
      Returns the bitwise opcode for the supplied token.
      Specified by:
      getBitwiseOperationBytecode in class BinaryExpressionWriter
      Parameters:
      type - the normalized token index
      Returns:
      the ASM opcode
    • getCompareCode

      protected int getCompareCode()
      Specified by:
      getCompareCode in class BinaryExpressionWriter
      Returns:
      the ASM compare opcode used by this primitive type
    • getNormalOpResultType

      protected ClassNode getNormalOpResultType()
      Specified by:
      getNormalOpResultType in class BinaryExpressionWriter
      Returns:
      the result type for normal arithmetic operations
    • writeShiftOp

      protected boolean writeShiftOp(int type, boolean simulate)
      Write shifting operations. Type is one of LEFT_SHIFT, RIGHT_SHIFT, or RIGHT_SHIFT_UNSIGNED
      Overrides:
      writeShiftOp in class BinaryExpressionWriter
      Parameters:
      type - the token type
      Returns:
      true on a successful shift operation write
    • getShiftOperationBytecode

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

      protected int getStandardOperationBytecode(int type)
      Returns the arithmetic opcode for the supplied token.
      Specified by:
      getStandardOperationBytecode in class BinaryExpressionWriter
      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.
      Specified by:
      removeTwoOperands in class BinaryExpressionWriter
      Parameters:
      mv - the current method visitor
    • writeMinusMinus

      protected void writeMinusMinus(org.objectweb.asm.MethodVisitor mv)
      Emits a prefix/postfix decrement.
      Specified by:
      writeMinusMinus in class BinaryExpressionWriter
      Parameters:
      mv - the current method visitor
    • writePlusPlus

      protected void writePlusPlus(org.objectweb.asm.MethodVisitor mv)
      Emits a prefix/postfix increment.
      Specified by:
      writePlusPlus in class BinaryExpressionWriter
      Parameters:
      mv - the current method visitor
    • getDevisionOpResultType

      protected ClassNode getDevisionOpResultType()
      Specified by:
      getDevisionOpResultType in class BinaryExpressionWriter
      Returns:
      the result type for division operations