Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

ByteCode Class Reference

List of all members.

Public Methods

void build (Instruction insts)
Instruction disassemble_bytecode (byte bc[], int index)
Instruction locateInst (int index)

Static Public Methods

void showCode (Instruction inst, cp_info constant_pool[])
void showCode (Instruction inst, int startinst, cp_info constant_pool[])

Static Public Attributes

final int NOP = 0
final int ACONST_NULL = 1
final int ICONST_M1 = 2
final int ICONST_0 = 3
final int ICONST_1 = 4
final int ICONST_2 = 5
final int ICONST_3 = 6
final int ICONST_4 = 7
final int ICONST_5 = 8
final int LCONST_0 = 9
final int LCONST_1 = 10
final int FCONST_0 = 11
final int FCONST_1 = 12
final int FCONST_2 = 13
final int DCONST_0 = 14
final int DCONST_1 = 15
final int BIPUSH = 16
final int SIPUSH = 17
final int LDC1 = 18
final int LDC2 = 19
final int LDC2W = 20
final int ILOAD = 21
final int LLOAD = 22
final int FLOAD = 23
final int DLOAD = 24
final int ALOAD = 25
final int ILOAD_0 = 26
final int ILOAD_1 = 27
final int ILOAD_2 = 28
final int ILOAD_3 = 29
final int LLOAD_0 = 30
final int LLOAD_1 = 31
final int LLOAD_2 = 32
final int LLOAD_3 = 33
final int FLOAD_0 = 34
final int FLOAD_1 = 35
final int FLOAD_2 = 36
final int FLOAD_3 = 37
final int DLOAD_0 = 38
final int DLOAD_1 = 39
final int DLOAD_2 = 40
final int DLOAD_3 = 41
final int ALOAD_0 = 42
final int ALOAD_1 = 43
final int ALOAD_2 = 44
final int ALOAD_3 = 45
final int IALOAD = 46
final int LALOAD = 47
final int FALOAD = 48
final int DALOAD = 49
final int AALOAD = 50
final int BALOAD = 51
final int CALOAD = 52
final int SALOAD = 53
final int ISTORE = 54
final int LSTORE = 55
final int FSTORE = 56
final int DSTORE = 57
final int ASTORE = 58
final int ISTORE_0 = 59
final int ISTORE_1 = 60
final int ISTORE_2 = 61
final int ISTORE_3 = 62
final int LSTORE_0 = 63
final int LSTORE_1 = 64
final int LSTORE_2 = 65
final int LSTORE_3 = 66
final int FSTORE_0 = 67
final int FSTORE_1 = 68
final int FSTORE_2 = 69
final int FSTORE_3 = 70
final int DSTORE_0 = 71
final int DSTORE_1 = 72
final int DSTORE_2 = 73
final int DSTORE_3 = 74
final int ASTORE_0 = 75
final int ASTORE_1 = 76
final int ASTORE_2 = 77
final int ASTORE_3 = 78
final int IASTORE = 79
final int LASTORE = 80
final int FASTORE = 81
final int DASTORE = 82
final int AASTORE = 83
final int BASTORE = 84
final int CASTORE = 85
final int SASTORE = 86
final int POP = 87
final int POP2 = 88
final int DUP = 89
final int DUP_X1 = 90
final int DUP_X2 = 91
final int DUP2 = 92
final int DUP2_X1 = 93
final int DUP2_X2 = 94
final int SWAP = 95
final int IADD = 96
final int LADD = 97
final int FADD = 98
final int DADD = 99
final int ISUB = 100
final int LSUB = 101
final int FSUB = 102
final int DSUB = 103
final int IMUL = 104
final int LMUL = 105
final int FMUL = 106
final int DMUL = 107
final int IDIV = 108
final int LDIV = 109
final int FDIV = 110
final int DDIV = 111
final int IREM = 112
final int LREM = 113
final int FREM = 114
final int DREM = 115
final int INEG = 116
final int LNEG = 117
final int FNEG = 118
final int DNEG = 119
final int ISHL = 120
final int LSHL = 121
final int ISHR = 122
final int LSHR = 123
final int IUSHR = 124
final int LUSHR = 125
final int IAND = 126
final int LAND = 127
final int IOR = 128
final int LOR = 129
final int IXOR = 130
final int LXOR = 131
final int IINC = 132
final int I2L = 133
final int I2F = 134
final int I2D = 135
final int L2I = 136
final int L2F = 137
final int L2D = 138
final int F2I = 139
final int F2L = 140
final int F2D = 141
final int D2I = 142
final int D2L = 143
final int D2F = 144
final int INT2BYTE = 145
final int INT2CHAR = 146
final int INT2SHORT = 147
final int LCMP = 148
final int FCMPL = 149
final int FCMPG = 150
final int DCMPL = 151
final int DCMPG = 152
final int IFEQ = 153
final int IFNE = 154
final int IFLT = 155
final int IFGE = 156
final int IFGT = 157
final int IFLE = 158
final int IF_ICMPEQ = 159
final int IF_ICMPNE = 160
final int IF_ICMPLT = 161
final int IF_ICMPGE = 162
final int IF_ICMPGT = 163
final int IF_ICMPLE = 164
final int IF_ACMPEQ = 165
final int IF_ACMPNE = 166
final int GOTO = 167
final int JSR = 168
final int RET = 169
final int TABLESWITCH = 170
final int LOOKUPSWITCH = 171
final int IRETURN = 172
final int LRETURN = 173
final int FRETURN = 174
final int DRETURN = 175
final int ARETURN = 176
final int RETURN = 177
final int GETSTATIC = 178
final int PUTSTATIC = 179
final int GETFIELD = 180
final int PUTFIELD = 181
final int INVOKEVIRTUAL = 182
final int INVOKENONVIRTUAL = 183
final int INVOKESTATIC = 184
final int INVOKEINTERFACE = 185
final int NEW = 187
final int NEWARRAY = 188
final int ANEWARRAY = 189
final int ARRAYLENGTH = 190
final int ATHROW = 191
final int CHECKCAST = 192
final int INSTANCEOF = 193
final int MONITORENTER = 194
final int MONITOREXIT = 195
final int WIDE = 196
final int MULTIANEWARRAY = 197
final int IFNULL = 198
final int IFNONNULL = 199
final int GOTO_W = 200
final int JSR_W = 201
final int BREAKPOINT = 202
final int RET_W = 209

Private Methods

 ByteCode ()
Instruction locateInstr (int index, int mini, int maxi)

Private Attributes

int icount
Instruction instructions []

Detailed Description

Procedural code for parsing and otherwise handling bytecode.
Author:
Clark Verbrugge

Definition at line 115 of file ByteCode.java.


Constructor & Destructor Documentation

ByteCode::ByteCode   [inline, private]
 

Constructor---does nothing.

Definition at line 378 of file ByteCode.java.


Member Function Documentation

void ByteCode::build Instruction   insts [inline]
 

Given a list of Instructions, this method converts all offsets to pointers.

Parameters:
insts   list of instructions; labels must be accurate.
See also:
Instruction::offsetToPointer , ClassFile::parseMethod , ClassFile::relabel

Definition at line 386 of file ByteCode.java.

Referenced by ClassFile::parseMethod().

Instruction ByteCode::disassemble_bytecode byte   bc[],
int   index
[inline]
 

Main entry point for disassembling bytecode into Instructions; this method converts the given single bytecode into an Instruction (with label set to index).

Parameters:
bc   complete array of bytecode.
index   offset within bc of the bytecode to parse.
Returns:
a single Instruction object; note that Instruction references will not be filled in (use build to post-process).
See also:
ClassFile::parseMethod , Instruction::parse , ByteCode::build

Definition at line 433 of file ByteCode.java.

Referenced by ClassFile::parseMethod().

Instruction ByteCode::locateInst int   index [inline]
 

Locates the Instruction in the list with the given label.

Parameters:
index   label of desired instruction
Returns:
Instruction object wiht that label, or null if not found.

Definition at line 1129 of file ByteCode.java.

Referenced by Instruction_Tableswitch::offsetToPointer(), Instruction_Lookupswitch::offsetToPointer(), Instruction_longbranch::offsetToPointer(), Instruction_intbranch::offsetToPointer(), and ClassFile::parseMethod().

Instruction ByteCode::locateInstr int   index,
int   mini,
int   maxi
[inline, private]
 

Performs a binary search of the instructions[] array.

Definition at line 1133 of file ByteCode.java.

Referenced by locateInst().

void ByteCode::showCode Instruction   inst,
int   startinst,
cp_info   constant_pool[]
[inline, static]
 

Displays the code (in the form of Instructions) for the given list of Instructions.

Parameters:
inst   input list of instructions.
startinst   index of the label of the instruction at which to begin.
constant_pool   constant pool of the ClassFile object.
See also:
ByteCode::showCode(Instruction, cp_info)

Definition at line 1159 of file ByteCode.java.

void ByteCode::showCode Instruction   inst,
cp_info   constant_pool[]
[inline, static]
 

Displays the code (in the form of Instructions) for the given list of Instructions.

Parameters:
inst   input list of instructions.
constant_pool   constant pool of the ClassFile object.
See also:
ByteCode::showCode(Instruction, int, cp_info)

Definition at line 1149 of file ByteCode.java.


The documentation for this class was generated from the following file:
Generated at Thu Feb 7 07:05:49 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001