public abstract class BinaryExpressionWriter
extends Object
Base class for writing primitive typed operations
| Modifiers | Name | Description |
|---|---|---|
protected static int[] |
stdCompareCodes |
Jump opcodes used for primitive comparison results. |
| Constructor and description |
|---|
BinaryExpressionWriter(WriterController controller, MethodCaller arraySet, MethodCaller arrayGet)Creates a primitive-operation writer. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public boolean |
arrayGet(int operation, boolean simulate)Attempts to write an array-read operation. |
|
public boolean |
arraySet(boolean simulate)Writes an array-store operation. |
|
protected abstract void |
doubleTwoOperands(org.objectweb.asm.MethodVisitor mv)Duplicates the two operands already on the operand stack. |
|
protected MethodCaller |
getArrayGetCaller()
|
|
protected ClassNode |
getArrayGetResultType()
|
|
protected MethodCaller |
getArraySetCaller()
|
|
protected abstract int |
getBitwiseOperationBytecode(int type)Returns the bitwise opcode for the supplied token. |
|
protected abstract int |
getCompareCode()
|
|
public WriterController |
getController()return writer controller |
|
protected abstract ClassNode |
getDevisionOpResultType()
|
|
protected abstract ClassNode |
getNormalOpResultType()
|
|
protected abstract int |
getShiftOperationBytecode(int type)Returns the shift opcode for the supplied token. |
|
protected abstract int |
getStandardOperationBytecode(int type)Returns the arithmetic opcode for the supplied token. |
|
protected abstract void |
removeTwoOperands(org.objectweb.asm.MethodVisitor mv)Removes the two operands already on the operand stack. |
|
public void |
setArraySetAndGet(MethodCaller arraySet, MethodCaller arrayGet)Replaces the helpers used for primitive array access. |
|
protected boolean |
supportsDivision()
|
|
public boolean |
write(int operation, boolean simulate)Attempts to write the supplied binary operation. |
|
protected boolean |
writeBitwiseOp(int type, boolean simulate)writes some the bitwise operations. type is one of BITWISE_OR, BITWISE_AND, BITWISE_XOR |
|
protected boolean |
writeDivision(boolean simulate)Writes a division operation for the current primitive type. |
|
protected abstract void |
writeMinusMinus(org.objectweb.asm.MethodVisitor mv)Emits a prefix/postfix decrement. |
|
protected abstract void |
writePlusPlus(org.objectweb.asm.MethodVisitor mv)Emits a prefix/postfix increment. |
|
public boolean |
writePostOrPrefixMethod(int operation, boolean simulate)Attempts to write a postfix or prefix increment/decrement operation. |
|
protected boolean |
writeShiftOp(int type, boolean simulate)Write shifting operations. |
|
protected boolean |
writeSpaceship(int type, boolean simulate)Writes a spaceship comparison for the current primitive type. |
|
protected boolean |
writeStdCompare(int type, boolean simulate)writes some int standard operations for compares |
|
protected boolean |
writeStdOperators(int type, boolean simulate)Writes a standard arithmetic operator for the current primitive type. |
Jump opcodes used for primitive comparison results.
Creates a primitive-operation writer.
controller - the active writer controllerarraySet - the helper used for array storesarrayGet - the helper used for array loadsAttempts to write an array-read operation.
operation - the token typesimulate - whether to probe support without emitting bytecodetrue if the operation is an array readWrites an array-store operation.
simulate - whether to probe support without emitting bytecodetrueDuplicates the two operands already on the operand stack.
mv - the current method visitor
Returns the bitwise opcode for the supplied token.
type - the normalized token index
return writer controller
Returns the shift opcode for the supplied token.
type - the normalized token indexReturns the arithmetic opcode for the supplied token.
type - the normalized token indexRemoves the two operands already on the operand stack.
mv - the current method visitorReplaces the helpers used for primitive array access.
arraySet - the array-store helperarrayGet - the array-load helper
Attempts to write the supplied binary operation.
operation - the token typesimulate - whether to probe support without emitting bytecodetrue if the operation is supportedwrites some the bitwise operations. type is one of BITWISE_OR, BITWISE_AND, BITWISE_XOR
type - the token typeWrites a division operation for the current primitive type.
simulate - whether to probe support without emitting bytecodetrue if division is supportedEmits a prefix/postfix decrement.
mv - the current method visitorEmits a prefix/postfix increment.
mv - the current method visitorAttempts to write a postfix or prefix increment/decrement operation.
operation - the token typesimulate - whether to probe support without emitting bytecodetrue if the operation is supportedWrite shifting operations. Type is one of LEFT_SHIFT, RIGHT_SHIFT, or RIGHT_SHIFT_UNSIGNED
type - the token typeWrites a spaceship comparison for the current primitive type.
type - the token typesimulate - whether to probe support without emitting bytecodetrue if the operation is supportedwrites some int standard operations for compares
type - the token typeWrites a standard arithmetic operator for the current primitive type.
type - the token typesimulate - whether to probe support without emitting bytecodetrue if the operation is supportedCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.