org.jikesrvm.classloader
Class BytecodeStream

java.lang.Object
  extended by org.jikesrvm.classloader.BytecodeStream
All Implemented Interfaces:
BytecodeConstants, ClassLoaderConstants, SizeConstants

public class BytecodeStream
extends Object
implements BytecodeConstants, ClassLoaderConstants, SizeConstants

Provides minimal abstraction layer to a stream of bytecodes from the code attribute of a method.


Field Summary
private  int bcIndex
           
private  int bcLength
           
private  byte[] bcodes
           
private  NormalMethod method
           
private  int opcode
           
private  boolean wide
           
 
Fields inherited from interface org.jikesrvm.classloader.BytecodeConstants
JBC_aaload, JBC_aastore, JBC_aconst_null, JBC_aload, JBC_aload_0, JBC_aload_1, JBC_aload_2, JBC_aload_3, JBC_anewarray, JBC_areturn, JBC_arraylength, JBC_astore, JBC_astore_0, JBC_astore_1, JBC_astore_2, JBC_astore_3, JBC_athrow, JBC_baload, JBC_bastore, JBC_bipush, JBC_caload, JBC_castore, JBC_checkcast, JBC_d2f, JBC_d2i, JBC_d2l, JBC_dadd, JBC_daload, JBC_dastore, JBC_dcmpg, JBC_dcmpl, JBC_dconst_0, JBC_dconst_1, JBC_ddiv, JBC_dload, JBC_dload_0, JBC_dload_1, JBC_dload_2, JBC_dload_3, JBC_dmul, JBC_dneg, JBC_drem, JBC_dreturn, JBC_dstore, JBC_dstore_0, JBC_dstore_1, JBC_dstore_2, JBC_dstore_3, JBC_dsub, JBC_dup, JBC_dup_x1, JBC_dup_x2, JBC_dup2, JBC_dup2_x1, JBC_dup2_x2, JBC_f2d, JBC_f2i, JBC_f2l, JBC_fadd, JBC_faload, JBC_fastore, JBC_fcmpg, JBC_fcmpl, JBC_fconst_0, JBC_fconst_1, JBC_fconst_2, JBC_fdiv, JBC_fload, JBC_fload_0, JBC_fload_1, JBC_fload_2, JBC_fload_3, JBC_fmul, JBC_fneg, JBC_frem, JBC_freturn, JBC_fstore, JBC_fstore_0, JBC_fstore_1, JBC_fstore_2, JBC_fstore_3, JBC_fsub, JBC_getfield, JBC_getstatic, JBC_goto, JBC_goto_w, JBC_i2d, JBC_i2f, JBC_i2l, JBC_iadd, JBC_iaload, JBC_iand, JBC_iastore, JBC_iconst_0, JBC_iconst_1, JBC_iconst_2, JBC_iconst_3, JBC_iconst_4, JBC_iconst_5, JBC_iconst_m1, JBC_idiv, JBC_if_acmpeq, JBC_if_acmpne, JBC_if_icmpeq, JBC_if_icmpge, JBC_if_icmpgt, JBC_if_icmple, JBC_if_icmplt, JBC_if_icmpne, JBC_ifeq, JBC_ifge, JBC_ifgt, JBC_ifle, JBC_iflt, JBC_ifne, JBC_ifnonnull, JBC_ifnull, JBC_iinc, JBC_iload, JBC_iload_0, JBC_iload_1, JBC_iload_2, JBC_iload_3, JBC_impdep1, JBC_impdep2, JBC_imul, JBC_ineg, JBC_instanceof, JBC_int2byte, JBC_int2char, JBC_int2short, JBC_invokeinterface, JBC_invokespecial, JBC_invokestatic, JBC_invokevirtual, JBC_ior, JBC_irem, JBC_ireturn, JBC_ishl, JBC_ishr, JBC_istore, JBC_istore_0, JBC_istore_1, JBC_istore_2, JBC_istore_3, JBC_isub, JBC_iushr, JBC_ixor, JBC_jsr, JBC_jsr_w, JBC_l2d, JBC_l2f, JBC_l2i, JBC_ladd, JBC_laload, JBC_land, JBC_lastore, JBC_lcmp, JBC_lconst_0, JBC_lconst_1, JBC_ldc, JBC_ldc_w, JBC_ldc2_w, JBC_ldiv, JBC_length, JBC_lload, JBC_lload_0, JBC_lload_1, JBC_lload_2, JBC_lload_3, JBC_lmul, JBC_lneg, JBC_lookupswitch, JBC_lor, JBC_lrem, JBC_lreturn, JBC_lshl, JBC_lshr, JBC_lstore, JBC_lstore_0, JBC_lstore_1, JBC_lstore_2, JBC_lstore_3, JBC_lsub, JBC_lushr, JBC_lxor, JBC_monitorenter, JBC_monitorexit, JBC_multianewarray, JBC_name, JBC_new, JBC_newarray, JBC_nop, JBC_pop, JBC_pop2, JBC_putfield, JBC_putstatic, JBC_ret, JBC_return, JBC_saload, JBC_sastore, JBC_sipush, JBC_swap, JBC_tableswitch, JBC_wide, JBC_xxxunusedxxx
 
Fields inherited from interface org.jikesrvm.classloader.ClassLoaderConstants
ACC_ABSTRACT, ACC_ANNOTATION, ACC_ENUM, ACC_FINAL, ACC_INTERFACE, ACC_NATIVE, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_STRICT, ACC_SUPER, ACC_SYNCHRONIZED, ACC_SYNTHETIC, ACC_TRANSIENT, ACC_VOLATILE, APPLICABLE_TO_CLASSES, APPLICABLE_TO_FIELDS, APPLICABLE_TO_METHODS, ArrayTypeCode, BooleanTypeCode, BRIDGE, ByteTypeCode, CharTypeCode, CLASS_INITIALIZED, CLASS_INITIALIZER_FAILED, CLASS_INITIALIZING, CLASS_INSTANTIATED, CLASS_LOADED, CLASS_RESOLVED, CLASS_VACANT, ClassTypeCode, CP_CLASS, CP_DOUBLE, CP_FLOAT, CP_INT, CP_LONG, CP_MEMBER, CP_STRING, CP_UTF, DoubleTypeCode, FloatTypeCode, IntTypeCode, LongTypeCode, ShortTypeCode, TAG_DOUBLE, TAG_FIELDREF, TAG_FLOAT, TAG_INT, TAG_INTERFACE_METHODREF, TAG_LONG, TAG_MEMBERNAME_AND_DESCRIPTOR, TAG_METHODREF, TAG_STRING, TAG_TYPEREF, TAG_UNUSED, TAG_UTF, VARARGS, VoidTypeCode
 
Fields inherited from interface org.jikesrvm.SizeConstants
BITS_IN_ADDRESS, BITS_IN_BOOLEAN, BITS_IN_BYTE, BITS_IN_CHAR, BITS_IN_DOUBLE, BITS_IN_EXTENT, BITS_IN_FLOAT, BITS_IN_INT, BITS_IN_LONG, BITS_IN_OFFSET, BITS_IN_PAGE, BITS_IN_SHORT, BITS_IN_WORD, BYTES_IN_ADDRESS, BYTES_IN_BOOLEAN, BYTES_IN_BYTE, BYTES_IN_CHAR, BYTES_IN_DOUBLE, BYTES_IN_EXTENT, BYTES_IN_FLOAT, BYTES_IN_INT, BYTES_IN_LONG, BYTES_IN_OFFSET, BYTES_IN_PAGE, BYTES_IN_SHORT, BYTES_IN_WORD, LOG_BITS_IN_ADDRESS, LOG_BITS_IN_BOOLEAN, LOG_BITS_IN_BYTE, LOG_BITS_IN_CHAR, LOG_BITS_IN_DOUBLE, LOG_BITS_IN_EXTENT, LOG_BITS_IN_FLOAT, LOG_BITS_IN_INT, LOG_BITS_IN_LONG, LOG_BITS_IN_OFFSET, LOG_BITS_IN_PAGE, LOG_BITS_IN_SHORT, LOG_BITS_IN_WORD, LOG_BYTES_IN_ADDRESS, LOG_BYTES_IN_BOOLEAN, LOG_BYTES_IN_BYTE, LOG_BYTES_IN_CHAR, LOG_BYTES_IN_DOUBLE, LOG_BYTES_IN_EXTENT, LOG_BYTES_IN_FLOAT, LOG_BYTES_IN_INT, LOG_BYTES_IN_LONG, LOG_BYTES_IN_OFFSET, LOG_BYTES_IN_PAGE, LOG_BYTES_IN_SHORT, LOG_BYTES_IN_WORD
 
Constructor Summary
BytecodeStream(NormalMethod m, byte[] bc)
           
 
Method Summary
 void alignInvokeInterface()
          Skips the extra stuff after an invokeinterface instruction.
 void alignSwitch()
          Skips the padding of a switch instruction.
 int computeLookupSwitchOffset(int value, int num)
          Returns the offset for a given value of the lookupswitch (as a signed int) or 0 if the value is not in the table..
 int computeTableSwitchOffset(int value, int low, int high)
          Returns the offset for a given value of the tableswitch (as a signed int) or 0 if the value is out of range..
 int getArrayDimension()
          Returns the dimension of the array (as an unsigned byte).
 int getArrayElementType()
          Returns the element type (primitive) of the array (as an unsigned byte).
 int getBranchOffset()
          Returns the offset of the branch (as a signed short).
 int getByteValue()
          Returns a signed byte value Used for bipush
 int getConstantIndex()
          Returns the constant pool index of a constant (as an unsigned byte).
 byte getConstantType(int index)
          Returns the type of a constant at a given constant pool index (as a byte).
 RVMClass getDeclaringClass()
          Returns the declaring class that this bytecode stream is from
 int getDefaultSwitchOffset()
          Returns the default offset of the switch (as a signed int).
 double getDoubleConstant(int index)
          Returns the constant at a given constant pool index (as a double).
 FieldReference getFieldReference()
          Returns a reference to a field.
 FieldReference getFieldReference(int[] constantPool)
          Returns a reference to a field, for use prior to the class being loaded.
 float getFloatConstant(int index)
          Returns the constant at a given constant pool index (as a float).
 int getHighSwitchValue()
          Returns the highest value of the tableswitch (as a signed int).
 int getIncrement()
          Returns an increment value (as a signed byte).
 int getIntConstant(int index)
          Returns the constant at a given constant pool index (as an int).
 int getLocalNumber()
          Returns the number of the local (as an unsigned byte) Used for iload, lload, fload, dload, aload, istore, lstore, fstore, dstore, astore, iinc, ret
 long getLongConstant(int index)
          Returns the constant at a given constant pool index (as a long).
 int getLookupSwitchOffset(int num)
          Returns the numbered offset of the lookupswitch (as a signed int).
 int getLookupSwitchValue(int num)
          Returns the numbered value of the lookupswitch (as a signed int).
 int getLowSwitchValue()
          Returns the lowest value of the tableswitch (as a signed int).
 NormalMethod getMethod()
          Returns the method that this bytecode stream is from
 MethodReference getMethodReference()
          Returns a reference to a field.
 MethodReference getMethodReference(int[] constantPool)
          Returns a reference to a field, for use prior to the class being loaded.
 TypeReference getObjectArrayType()
          Returns the type of the object array (as a RVMType).
 RVMType getObjectArrayType(RVMType klass)
          Returns the type of the array of given object type (as a RVMType).
 int getOpcode()
          Returns the opcode of the current instruction in the sequence.
 RVMType getPrimitiveArrayType()
          Returns the type of the primitive array (as a RVMType).
 RVMArray getPrimitiveArrayType(int etype)
          Returns the type of the array of given primitive type (as a RVMType).
 int getShortValue()
          Returns a signed short value Used for sipush
private  int getSignedInt(int index)
           
 String getStringConstant(int index)
          Returns the constant at a given constant pool index (as a String).
 int getSwitchLength()
          Returns the number of match-offset pairs in the lookupswitch (as a signed int).
 int getTableSwitchOffset(int num)
          Returns the numbered offset of the tableswitch (as a signed int).
 TypeReference getTypeReference()
          Returns the type reference (as a RVMType).
private  int getUnsignedByte(int index)
           
 int getWideBranchOffset()
          Returns the wide offset of the branch (as a signed int).
 int getWideConstantIndex()
          Returns the wide constant pool index of a constant (as an unsigned short).
 int getWideIncrement()
          Returns an increment value (as a signed short).
 int getWideLocalNumber()
          Returns the wide number of the local (as an unsigned short) Used for iload, lload, fload, dload, aload, istore, lstore, fstore, dstore, astore, iinc prefixed by wide
 int getWideOpcode()
          Returns the opcode of the wide instruction.
 boolean hasMoreBytecodes()
          Does the stream have more bytecodes in it?
 int index()
          Returns the current bytecode index
 boolean isWide()
          Are we currently processing a wide instruction?
 int length()
          Returns the length of the bytecode stream Returns 0 if the method doesn't have any bytecodes (i.e. is abstract or native)
 int nextInstruction()
          Sets up the next instruction in the sequence
 int nextPseudoInstruction()
           
 int peekNextOpcode()
          Returns the opcode of the next instruction in the sequence without advancing to it
 int readIntConst()
           
private  long readLong()
           
 long readLongConst()
           
private  byte readSignedByte()
           
private  int readSignedInt()
           
private  int readSignedShort()
           
private  int readUnsignedByte()
           
private  int readUnsignedShort()
           
 void reset()
          Resets the stream to the beginning
 void reset(int index)
          Resets the stream to a given position Use with caution
 void skipInstruction()
          Skips the current instruction
 void skipInstruction(int opcode, boolean wide)
          Skips the current instruction (without using the opcode field) A slightly optimized version of skipInstruction()
 void skipLookupSwitchPairs(int num)
          Skips the match-offset pairs of a lookupswitch instruction.
private  void skipSpecialInstruction(int opcode)
           
 void skipTableSwitchOffsets(int num)
          Skips the offsets of a tableswitch instruction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

method

private final NormalMethod method

bcLength

private final int bcLength

bcodes

private final byte[] bcodes

bcIndex

private int bcIndex

opcode

private int opcode

wide

private boolean wide
Constructor Detail

BytecodeStream

public BytecodeStream(NormalMethod m,
                      byte[] bc)
Parameters:
m - the method containing the bytecodes
bc - the array of bytecodes
Method Detail

getMethod

public final NormalMethod getMethod()
Returns the method that this bytecode stream is from

Returns:
method

getDeclaringClass

public final RVMClass getDeclaringClass()
Returns the declaring class that this bytecode stream is from

Returns:
method

length

public final int length()
Returns the length of the bytecode stream Returns 0 if the method doesn't have any bytecodes (i.e. is abstract or native)

Returns:
bytecode stream length

index

public final int index()
Returns the current bytecode index

Returns:
the current bytecode index

reset

public final void reset()
Resets the stream to the beginning

See Also:
reset(int)

reset

public final void reset(int index)
Resets the stream to a given position Use with caution

Parameters:
index - the position to reset the stream to
See Also:
reset()

hasMoreBytecodes

public final boolean hasMoreBytecodes()
Does the stream have more bytecodes in it?

Returns:
whether there are more bytecodes

peekNextOpcode

public final int peekNextOpcode()
Returns the opcode of the next instruction in the sequence without advancing to it

Returns:
the opcode of the next instruction
See Also:
nextInstruction()

nextInstruction

public final int nextInstruction()
Sets up the next instruction in the sequence

Returns:
the opcode of the next instruction
See Also:
peekNextOpcode()

getOpcode

public final int getOpcode()
Returns the opcode of the current instruction in the sequence.

Note: if skipInstruction has been called, but nextInstruction has not, this method will return the opcode of the skipped instruction!

Returns:
the opcode of the current instruction
See Also:
nextInstruction(), isWide()

isWide

public final boolean isWide()
Are we currently processing a wide instruction?

Returns:
true if current instruction is wide
See Also:
nextInstruction(), getOpcode()

skipInstruction

public final void skipInstruction()
Skips the current instruction

See Also:
skipInstruction(int,boolean)

skipInstruction

public final void skipInstruction(int opcode,
                                  boolean wide)
Skips the current instruction (without using the opcode field) A slightly optimized version of skipInstruction()

Parameters:
opcode - current opcode
wide - whether current instruction follows wide
See Also:
skipInstruction()

getByteValue

public final int getByteValue()
Returns a signed byte value Used for bipush

Returns:
signed byte value

getShortValue

public final int getShortValue()
Returns a signed short value Used for sipush

Returns:
signed short value

getLocalNumber

public final int getLocalNumber()
Returns the number of the local (as an unsigned byte) Used for iload, lload, fload, dload, aload, istore, lstore, fstore, dstore, astore, iinc, ret

Returns:
local number
See Also:
getWideLocalNumber()

getWideLocalNumber

public final int getWideLocalNumber()
Returns the wide number of the local (as an unsigned short) Used for iload, lload, fload, dload, aload, istore, lstore, fstore, dstore, astore, iinc prefixed by wide

Returns:
wide local number
See Also:
getLocalNumber()

getIncrement

public final int getIncrement()
Returns an increment value (as a signed byte).

Used for iinc

Returns:
increment
See Also:
getWideIncrement()

getWideIncrement

public final int getWideIncrement()
Returns an increment value (as a signed short).

Used for iinc prefixed by wide

Returns:
wide increment
See Also:
getIncrement()

getBranchOffset

public final int getBranchOffset()
Returns the offset of the branch (as a signed short).

Used for if<cond>, ificmp<cond>, ifacmp<cond>, goto, jsr

Returns:
branch offset
See Also:
getWideBranchOffset()

getWideBranchOffset

public final int getWideBranchOffset()
Returns the wide offset of the branch (as a signed int).

Used for goto_w, jsr_w

Returns:
wide branch offset
See Also:
getBranchOffset()

alignSwitch

public final void alignSwitch()
Skips the padding of a switch instruction.

Used for tableswitch, lookupswitch


getDefaultSwitchOffset

public final int getDefaultSwitchOffset()
Returns the default offset of the switch (as a signed int).

Used for tableswitch, lookupswitch

Returns:
default switch offset

getLowSwitchValue

public final int getLowSwitchValue()
Returns the lowest value of the tableswitch (as a signed int).

Used for tableswitch

Returns:
lowest switch value
See Also:
getHighSwitchValue()

getHighSwitchValue

public final int getHighSwitchValue()
Returns the highest value of the tableswitch (as a signed int).

Used for tableswitch

Returns:
highest switch value
See Also:
getLowSwitchValue()

skipTableSwitchOffsets

public final void skipTableSwitchOffsets(int num)
Skips the offsets of a tableswitch instruction.

Used for tableswitch

Parameters:
num - the number of offsets to skip
See Also:
getTableSwitchOffset(int)

getTableSwitchOffset

public final int getTableSwitchOffset(int num)
Returns the numbered offset of the tableswitch (as a signed int).

Used for tableswitch.

The "cursor" has to be positioned at the start of the offset table.

NOTE: Will NOT advance cursor

Parameters:
num - the number of the offset to retrieve
Returns:
switch offset

computeTableSwitchOffset

public final int computeTableSwitchOffset(int value,
                                          int low,
                                          int high)
Returns the offset for a given value of the tableswitch (as a signed int) or 0 if the value is out of range..

Used for tableswitch.

The "cursor" has to be positioned at the start of the offset table.

NOTE: Will NOT advance cursor

Parameters:
value - the value to retrieve offset for
low - the lowest value of the tableswitch
high - the highest value of the tableswitch
Returns:
switch offset

getSwitchLength

public final int getSwitchLength()
Returns the number of match-offset pairs in the lookupswitch (as a signed int).

Used for lookupswitch

Returns:
number of switch pairs

skipLookupSwitchPairs

public final void skipLookupSwitchPairs(int num)
Skips the match-offset pairs of a lookupswitch instruction.

Used for lookupswitch

Parameters:
num - the number of match-offset pairs to skip
See Also:
getLookupSwitchValue(int), getLookupSwitchOffset(int)

getLookupSwitchOffset

public final int getLookupSwitchOffset(int num)
Returns the numbered offset of the lookupswitch (as a signed int).

Used for lookupswitch.

The "cursor" has to be positioned at the start of the pair table.

NOTE: Will NOT advance cursor

Parameters:
num - the number of the offset to retrieve
Returns:
switch offset
See Also:
getLookupSwitchValue(int)

getLookupSwitchValue

public final int getLookupSwitchValue(int num)
Returns the numbered value of the lookupswitch (as a signed int).

Used for lookupswitch.

The "cursor" has to be positioned at the start of the pair table.

NOTE: Will NOT advance cursor

Parameters:
num - the number of the value to retrieve
Returns:
switch value
See Also:
getLookupSwitchOffset(int)

computeLookupSwitchOffset

public final int computeLookupSwitchOffset(int value,
                                           int num)
Returns the offset for a given value of the lookupswitch (as a signed int) or 0 if the value is not in the table..

Used for lookupswitch.

The "cursor" has to be positioned at the start of the offset table.

NOTE: Will NOT advance cursor.

WARNING: Uses LINEAR search.

XXX Whoever has time on their hands can re-implement this as a binary search.

Parameters:
value - the value to retrieve offset for
num - the number of match-offset pairs in the lookupswitch
Returns:
switch offset

getFieldReference

public final FieldReference getFieldReference()
Returns a reference to a field.

Used for getstatic, putstatic, getfield, putfield

Returns:
field reference

getFieldReference

public final FieldReference getFieldReference(int[] constantPool)
Returns a reference to a field, for use prior to the class being loaded.

Used for getstatic, putstatic, getfield, putfield

Returns:
field reference

getMethodReference

public final MethodReference getMethodReference()
Returns a reference to a field.

Used for invokevirtual, invokespecial, invokestatic, invokeinterface

Returns:
method reference

getMethodReference

public final MethodReference getMethodReference(int[] constantPool)
Returns a reference to a field, for use prior to the class being loaded.

Used for invokevirtual, invokespecial, invokestatic, invokeinterface

Returns:
method reference

alignInvokeInterface

public final void alignInvokeInterface()
Skips the extra stuff after an invokeinterface instruction.

Used for invokeinterface


getTypeReference

public final TypeReference getTypeReference()
Returns the type reference (as a RVMType).

Used for new, anewarray, checkcast, instanceof, multianewarray

Returns:
type reference

getArrayElementType

public final int getArrayElementType()
Returns the element type (primitive) of the array (as an unsigned byte).

Used for newarray

Returns:
array element type
See Also:
getPrimitiveArrayType(), getPrimitiveArrayType(int)

getPrimitiveArrayType

public final RVMArray getPrimitiveArrayType(int etype)
Returns the type of the array of given primitive type (as a RVMType).

Used for newarray

Parameters:
etype - element type
Returns:
array type
See Also:
getArrayElementType(), getPrimitiveArrayType()

getPrimitiveArrayType

public final RVMType getPrimitiveArrayType()
Returns the type of the primitive array (as a RVMType).

Used for newarray

Returns:
array type
See Also:
getArrayElementType(), getPrimitiveArrayType(int)

getObjectArrayType

public final RVMType getObjectArrayType(RVMType klass)
Returns the type of the array of given object type (as a RVMType).

Used for anewarray

Parameters:
klass - element type
Returns:
array type
See Also:
getTypeReference(), getObjectArrayType()

getObjectArrayType

public final TypeReference getObjectArrayType()
Returns the type of the object array (as a RVMType).

Used for anewarray

Returns:
array type
See Also:
getObjectArrayType(RVMType)

getArrayDimension

public final int getArrayDimension()
Returns the dimension of the array (as an unsigned byte).

Used for multianewarray

Returns:
array dimension

getWideOpcode

public final int getWideOpcode()
Returns the opcode of the wide instruction.

Used for wide.

Can be one of iload, lload, fload, dload, aload, istore, lstore, fstore, dstore, astore, iinc

Returns:
the opcode of the wide instruction

getConstantIndex

public final int getConstantIndex()
Returns the constant pool index of a constant (as an unsigned byte).

Used for ldc

Returns:
constant index
See Also:
getWideConstantIndex(), getConstantType(int), getIntConstant(int), getLongConstant(int), getFloatConstant(int), getDoubleConstant(int), getStringConstant(int)

getWideConstantIndex

public final int getWideConstantIndex()
Returns the wide constant pool index of a constant (as an unsigned short).

Used for ldc_w, ldc2_w

Returns:
wide constant index
See Also:
getConstantIndex(), getConstantType(int), getIntConstant(int), getLongConstant(int), getFloatConstant(int), getDoubleConstant(int), getStringConstant(int)

getConstantType

public final byte getConstantType(int index)
Returns the type of a constant at a given constant pool index (as a byte).

Used for ldc, ldc_w, ldc2_w

Returns:
constant type
See Also:
getConstantIndex(), getWideConstantIndex(), getIntConstant(int), getLongConstant(int), getFloatConstant(int), getDoubleConstant(int), getStringConstant(int)

getIntConstant

public final int getIntConstant(int index)
Returns the constant at a given constant pool index (as an int).

Used for ldc, ldc_w

Returns:
int constant
See Also:
getConstantIndex(), getWideConstantIndex(), getConstantType(int), getLongConstant(int), getFloatConstant(int), getDoubleConstant(int), getStringConstant(int)

getLongConstant

public final long getLongConstant(int index)
Returns the constant at a given constant pool index (as a long).

Used for ldc2_w

Returns:
long constant
See Also:
getConstantIndex(), getWideConstantIndex(), getConstantType(int), getIntConstant(int), getFloatConstant(int), getDoubleConstant(int), getStringConstant(int)

getFloatConstant

public final float getFloatConstant(int index)
Returns the constant at a given constant pool index (as a float).

Used for ldc, ldc_w

Returns:
float constant
See Also:
getConstantIndex(), getWideConstantIndex(), getConstantType(int), getIntConstant(int), getLongConstant(int), getDoubleConstant(int), getStringConstant(int)

getDoubleConstant

public final double getDoubleConstant(int index)
Returns the constant at a given constant pool index (as a double).

Used for ldc2_w

Returns:
double constant
See Also:
getConstantIndex(), getWideConstantIndex(), getConstantType(int), getIntConstant(int), getLongConstant(int), getFloatConstant(int), getStringConstant(int)

getStringConstant

public final String getStringConstant(int index)
Returns the constant at a given constant pool index (as a String).

Used for ldc, ldc_w

Returns:
String constant
See Also:
getConstantIndex(), getWideConstantIndex(), getConstantType(int), getIntConstant(int), getLongConstant(int), getFloatConstant(int), getDoubleConstant(int)

skipSpecialInstruction

private void skipSpecialInstruction(int opcode)

nextPseudoInstruction

public final int nextPseudoInstruction()

readIntConst

public final int readIntConst()

readLongConst

public final long readLongConst()

readLong

private long readLong()

readSignedByte

private byte readSignedByte()

readUnsignedByte

private int readUnsignedByte()

getUnsignedByte

private int getUnsignedByte(int index)

readSignedShort

private int readSignedShort()

readUnsignedShort

private int readUnsignedShort()

readSignedInt

private int readSignedInt()

getSignedInt

private int getSignedInt(int index)