Package org.codehaus.groovy.classgen.asm
Class BinaryDoubleExpressionHelper
java.lang.Object
org.codehaus.groovy.classgen.asm.BinaryExpressionWriter
org.codehaus.groovy.classgen.asm.BinaryLongExpressionHelper
org.codehaus.groovy.classgen.asm.BinaryDoubleExpressionHelper
Binary expression helper specialized for
double operations.-
Field Summary
Fields inherited from class org.codehaus.groovy.classgen.asm.BinaryExpressionWriter
stdCompareCodes -
Constructor Summary
ConstructorsConstructorDescriptionBinaryDoubleExpressionHelper(WriterController controller) Creates adouble-specialized binary expression helper. -
Method Summary
Modifier and TypeMethodDescriptionprotected intgetBitwiseOperationBytecode(int op) Returns the bitwise opcode for the supplied token.protected intprotected ClassNodeprotected ClassNodeprotected intgetShiftOperationBytecode(int type) Returns the shift opcode for the supplied token.protected intgetStandardOperationBytecode(int type) Returns the arithmetic opcode for the supplied token.protected booleanprotected booleanwriteBitwiseOp(int op, boolean simulate) writes some the bitwise operations.protected voidwriteMinusMinus(org.objectweb.asm.MethodVisitor mv) Emits a prefix/postfix decrement.protected voidwritePlusPlus(org.objectweb.asm.MethodVisitor mv) Emits a prefix/postfix increment.protected booleanwriteShiftOp(int type, boolean simulate) Write shifting operations.Methods inherited from class org.codehaus.groovy.classgen.asm.BinaryLongExpressionHelper
doubleTwoOperands, removeTwoOperandsMethods inherited from class org.codehaus.groovy.classgen.asm.BinaryExpressionWriter
arrayGet, arraySet, getArrayGetCaller, getArrayGetResultType, getArraySetCaller, getController, setArraySetAndGet, write, writeDivision, writePostOrPrefixMethod, writeSpaceship, writeStdCompare, writeStdOperators
-
Constructor Details
-
BinaryDoubleExpressionHelper
Creates adouble-specialized binary expression helper.- Parameters:
controller- the active writer controller
-
-
Method Details
-
writeBitwiseOp
protected boolean writeBitwiseOp(int op, boolean simulate) writes some the bitwise operations. type is one of BITWISE_OR, BITWISE_AND, BITWISE_XOR- Overrides:
writeBitwiseOpin classBinaryExpressionWriter- Parameters:
op- the token type- Returns:
- true if a successful bitwise operation write
-
getBitwiseOperationBytecode
protected int getBitwiseOperationBytecode(int op) Returns the bitwise opcode for the supplied token.- Overrides:
getBitwiseOperationBytecodein classBinaryLongExpressionHelper- Parameters:
op- the normalized token index- Returns:
- the ASM opcode
-
getCompareCode
protected int getCompareCode()- Overrides:
getCompareCodein classBinaryLongExpressionHelper- Returns:
- the ASM compare opcode used by this primitive type
-
getNormalOpResultType
- Overrides:
getNormalOpResultTypein classBinaryLongExpressionHelper- 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:
writeShiftOpin classBinaryExpressionWriter- 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.- Overrides:
getShiftOperationBytecodein classBinaryLongExpressionHelper- 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:
getStandardOperationBytecodein classBinaryLongExpressionHelper- Parameters:
type- the normalized token index- Returns:
- the ASM opcode
-
writeMinusMinus
protected void writeMinusMinus(org.objectweb.asm.MethodVisitor mv) Emits a prefix/postfix decrement.- Overrides:
writeMinusMinusin classBinaryLongExpressionHelper- Parameters:
mv- the current method visitor
-
writePlusPlus
protected void writePlusPlus(org.objectweb.asm.MethodVisitor mv) Emits a prefix/postfix increment.- Overrides:
writePlusPlusin classBinaryLongExpressionHelper- Parameters:
mv- the current method visitor
-
getDevisionOpResultType
- Overrides:
getDevisionOpResultTypein classBinaryLongExpressionHelper- Returns:
- the result type for division operations
-
supportsDivision
protected boolean supportsDivision()- Overrides:
supportsDivisionin classBinaryLongExpressionHelper- Returns:
- whether this primitive helper supports division bytecode directly
-