| Modifier and Type | Field and Description |
|---|---|
| private final ByteCodeForm | |
| private int | |
| private int[] | |
| private ClassFileEntry[] | |
| private int[][] | |
| private static ByteCode[] | |
| private int[] |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | applyByteCodeTargetFixup(final CodeAttribute
the code attribute codeAttribute)Some ByteCodes (in particular, those with labels need to be fixed up after all the bytecodes in the CodeAttribute have been added. |
| protected void | doWrite(final DataOutputStream dos)
Implements abstract org. |
| public boolean | equals(final Object
the reference object with which to compare. obj)Implements abstract org. |
| public void | |
| public static ByteCode | |
| protected ByteCodeForm | |
| public int | |
| public int[] | |
| public int | |
| public String | |
| public ClassFileEntry[] | |
| public int[] | |
| public int[][] | |
| public int | |
| public int[] | Returns: Some bytecodes.Some bytecodes (the ones with variable lengths) can't have a static rewrite array - they need the ability to update the array. |
| public int | hashCode()
Implements abstract org. |
| public boolean | Returns: boolean true if multibytecode, false otherwiseThis method will answer true if the receiver is a multi-bytecode instruction (such as aload0_putfield_super); otherwise, it will answer false. |
| public boolean | |
| protected void | resolve(final ClassConstantPool
TODO pool)Overrides org. |
| public void | setByteCodeIndex(final int
int position in code array. byteCodeOffset)ByteCodes may need to know their position in the code array (in particular, label byte codes need to know where they are in order to calculate their targets). |
| public void | setByteCodeTargets(final int[]
int index in array byteCodeTargets)Some ByteCodes (in particular, those with labels) have to keep track of byteCodeTargets. |
| public void | |
| public void | setNestedPositions(final int[][]
Each subarray specifies a position of a nested element (from the nested[] array) and the length of that element. nestedPositions)nestedPositions is an array of arrays of ints. |
| public void | setOperand2Bytes(final int
int to set the rewrite bytes to operand, final int int position in the operands of the rewrite bytes. For a rewrite array of {100, -1, -1, -1} position 0 is the first -1, position 1 is the
second -1, etc. position)Given an int operand, set the rewrite bytes for that position and the one immediately following it to a high-byte, low-byte encoding of the operand. |
| public void | setOperandByte(final int
int to set the rewrite byte to (unsigned) operand, final int int position in the operands of the rewrite bytes. For a rewrite array of {100, -1, -1, -1} position 0 is the first -1, position 1 is the
second -1, etc. position)Given an int operand, treat it as a byte and set the rewrite byte for that position to that value. |
| public void | setOperandBytes(final int[]
int[] rewrite operand bytes operands)Given an array of ints which correspond to bytes in the operand of the bytecode, set the rewrite bytes of the operand to be the appropriate values. |
| public void | setOperandSigned2Bytes(final int
int to set the rewrite bytes to operand, final int int position of the operands in the rewrite bytes position)This is just like setOperandInt, but takes special care when the operand is less than 0 to make sure it's written correctly. |
| public void | setRewrite(final int[]
Some bytecodes. rewrite)Some bytecodes (the ones with variable lengths) can't have a static rewrite array - they need the ability to update the array. |
| public String | toString()
Implements abstract org. |
| byteCodeForm | back to summary |
|---|---|
| private final ByteCodeForm byteCodeForm | |
| byteCodeOffset | back to summary |
|---|---|
| private int byteCodeOffset | |
| byteCodeTargets | back to summary |
|---|---|
| private int[] byteCodeTargets | |
| nested | back to summary |
|---|---|
| private ClassFileEntry[] nested | |
| nestedPositions | back to summary |
|---|---|
| private int[][] nestedPositions | |
| noArgByteCodes | back to summary |
|---|---|
| private static ByteCode[] noArgByteCodes | |
| rewrite | back to summary |
|---|---|
| private int[] rewrite | |
| ByteCode | back to summary |
|---|---|
| protected ByteCode(final int opcode) | |
| ByteCode | back to summary |
|---|---|
| protected ByteCode(final int opcode, final ClassFileEntry[] nested) | |
| applyByteCodeTargetFixup | back to summary |
|---|---|
| public void applyByteCodeTargetFixup(final CodeAttribute codeAttribute) Some ByteCodes (in particular, those with labels need to be fixed up after all the bytecodes in the CodeAttribute have been added. (This can't be done beforehand because the CodeAttribute needs to be complete before targets can be assigned.)
| |
| doWrite | back to summary |
|---|---|
| protected void doWrite(final DataOutputStream dos) throws IOException Implements abstract org.
| |
| equals | back to summary |
|---|---|
| public boolean equals(final Object obj) Implements abstract org. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| extractOperands | back to summary |
|---|---|
| public void extractOperands(final OperandManager operandManager, final Segment segment, final int codeLength) | |
| getByteCode | back to summary |
|---|---|
| public static ByteCode getByteCode(final int opcode) | |
| getByteCodeForm | back to summary |
|---|---|
| protected ByteCodeForm getByteCodeForm() | |
| getByteCodeIndex | back to summary |
|---|---|
| public int getByteCodeIndex() | |
| getByteCodeTargets | back to summary |
|---|---|
| public int[] getByteCodeTargets() | |
| getLength | back to summary |
|---|---|
| public int getLength() | |
| getName | back to summary |
|---|---|
| public String getName() | |
| getNestedClassFileEntries | back to summary |
|---|---|
| public ClassFileEntry[] getNestedClassFileEntries() Overrides org.
| |
| getNestedPosition | back to summary |
|---|---|
| public int[] getNestedPosition(final int index) | |
| getNestedPositions | back to summary |
|---|---|
| public int[][] getNestedPositions() | |
| getOpcode | back to summary |
|---|---|
| public int getOpcode() | |
| getRewrite | back to summary |
|---|---|
| public int[] getRewrite() Some bytecodes (the ones with variable lengths) can't have a static rewrite array - they need the ability to update the array. This method permits their associated bytecode formst to query their rewrite array. Note that this should not be called from bytecodes which have a static rewrite; use the table in ByteCodeForm instead to specify those rewrites.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Implements abstract org. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| hasMultipleByteCodes | back to summary |
|---|---|
| public boolean hasMultipleByteCodes() This method will answer true if the receiver is a multi-bytecode instruction (such as aload0_putfield_super); otherwise, it will answer false.
| |
| nestedMustStartClassPool | back to summary |
|---|---|
| public boolean nestedMustStartClassPool() | |
| resolve | back to summary |
|---|---|
| protected void resolve(final ClassConstantPool pool) Overrides org. Doc from org. Allows the constant pool entries to resolve their nested entries.
| |
| setByteCodeIndex | back to summary |
|---|---|
| public void setByteCodeIndex(final int byteCodeOffset) ByteCodes may need to know their position in the code array (in particular, label byte codes need to know where they are in order to calculate their targets). This method lets the CodeAttribute specify where the byte code is. Since there are no aload0+label instructions, this method doesn't worry about multioperation bytecodes.
| |
| setByteCodeTargets | back to summary |
|---|---|
| public void setByteCodeTargets(final int[] byteCodeTargets) Some ByteCodes (in particular, those with labels) have to keep track of byteCodeTargets. These are initially offsets in the CodeAttribute array relative to the byteCodeOffset, but later get fixed up to point to the absolute position in the CodeAttribute array. This method sets the targets.
| |
| setNested | back to summary |
|---|---|
| public void setNested(final ClassFileEntry[] nested) | |
| setNestedPositions | back to summary |
|---|---|
| public void setNestedPositions(final int[][] nestedPositions) nestedPositions is an array of arrays of ints. Each subarray specifies a position of a nested element (from the nested[] array) and the length of that element. For instance, one might have a nested of: {CPClass java/lang/Foo, CPFloat 3.14} The nestedPositions would then be: {{0,2},{2,2}} In other words, when the bytecode is resolved, the CPClass will be resolved to an int and inserted at position 0 and 1 of the rewrite arguments (the first occurrences of -1). The CPFloat will be resolved to an int position and inserted at positions 2 and 3 of the rewrite arguments.
| |
| setOperand2Bytes | back to summary |
|---|---|
| public void setOperand2Bytes(final int operand, final int position) Given an int operand, set the rewrite bytes for that position and the one immediately following it to a high-byte, low-byte encoding of the operand.
| |
| setOperandByte | back to summary |
|---|---|
| public void setOperandByte(final int operand, final int position) Given an int operand, treat it as a byte and set the rewrite byte for that position to that value. Mask of anything beyond 0xFF.
| |
| setOperandBytes | back to summary |
|---|---|
| public void setOperandBytes(final int[] operands) Given an array of ints which correspond to bytes in the operand of the bytecode, set the rewrite bytes of the operand to be the appropriate values. All values in operands[] will be masked with 0xFF so they fit into a byte.
| |
| setOperandSigned2Bytes | back to summary |
|---|---|
| public void setOperandSigned2Bytes(final int operand, final int position) This is just like setOperandInt, but takes special care when the operand is less than 0 to make sure it's written correctly.
| |
| setRewrite | back to summary |
|---|---|
| public void setRewrite(final int[] rewrite) Some bytecodes (the ones with variable lengths) can't have a static rewrite array - they need the ability to update the array. This method permits that. Note that this should not be called from bytecodes which have a static rewrite; use the table in ByteCodeForm instead to specify those rewrites.
| |
| toString | back to summary |
|---|---|
| public String toString() Implements abstract org. Doc from java. Returns a string representation of the object. | |