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

Instruction_byteindex Class Reference

Inheritance diagram for Instruction_byteindex:
[legend]
Collaboration diagram for Instruction_byteindex:
[legend]
List of all members.

Public Methods

 Instruction_byteindex (byte c)
int compile (byte bc[], int index)
void markCPRefs (boolean[] refs)
int nextOffset (int curr)
int parse (byte bc[], int index)
void redirectCPRefs (short redirect[])
String toString (cp_info constant_pool[])

Public Attributes

short arg_b

Detailed Description

Instruction subclasses are used to represent parsed bytecode; each bytecode operation has a corresponding subclass of Instruction.

Each subclass is derived from one of

Author:
Clark Verbrugge
See also:
Instruction , Instruction_noargs , Instruction_byte , Instruction_bytevar , Instruction_byteindex , Instruction_int , Instruction_intvar , Instruction_intindex , Instruction_intbranch , Instruction_longbranch , Instruction_Unknown

Definition at line 138 of file Instruction_byteindex.java.


Member Function Documentation

int Instruction_byteindex::compile byte   bc[],
int   index
[inline, virtual]
 

Writes out the sequence of bytecodes represented by this instruction, including any arguments.

Parameters:
bc   complete array of bytecode.
index   offset of remaining bytecode at which to start writing.
Returns:
offset of the next available bytecode.
See also:
ClassFile::unparseMethod , Instruction::parse

Reimplemented from Instruction.

Definition at line 144 of file Instruction_byteindex.java.

void Instruction_byteindex::markCPRefs boolean   refs[] [inline]
 

Marks the appropriate spot if that constant_pool entry is used by this instr. For every constant pool entry used (referenced) by this instruction, the corresponding boolean in the given array is set to true.

Parameters:
refs   array of booleans the same size as the constant pool array.
See also:
ClassFile::constant_pool

Reimplemented from Instruction.

Definition at line 145 of file Instruction_byteindex.java.

int Instruction_byteindex::nextOffset int   curr [inline]
 

Returns the next available offset assuming this instruction begins on the indicated offset; default assumes no arguments.

Parameters:
curr   offset this instruction would be on.
Returns:
next available offset.
See also:
ClassFile::relabel

Reimplemented from Instruction.

Definition at line 146 of file Instruction_byteindex.java.

int Instruction_byteindex::parse byte   bc[],
int   index
[inline, virtual]
 

Assuming the actual bytecode for this instruction has been extracted already, and index is the offset of the next byte, this method parses whatever arguments the instruction requires and return the offset of the next available byte.

Parameters:
bc   complete array of bytecode.
index   offset of remaining bytecode after this instruction's bytecode was parsed.
Returns:
offset of the next available bytecode.
See also:
ByteCode::disassemble_bytecode , Instruction::compile

Reimplemented from Instruction.

Definition at line 147 of file Instruction_byteindex.java.

void Instruction_byteindex::redirectCPRefs short   redirect[] [inline]
 

Updates all constant pool references within this instruction to use new indices, based on the given redirection array.

Parameters:
redirect   array of new indices of constant pool entries.
See also:
ClassFile::constant_pool

Reimplemented from Instruction.

Definition at line 154 of file Instruction_byteindex.java.

String Instruction_byteindex::toString cp_info   constant_pool[] [inline]
 

For displaying instructions.

Parameters:
constant_pool   constant pool of associated ClassFile
Returns:
String representation of this instruction.

Reimplemented from Instruction.

Definition at line 155 of file Instruction_byteindex.java.


Member Data Documentation

short Instruction_byteindex::arg_b
 

arg_b needs to be short in order to contain all the possible values for an unsigned byte

Definition at line 142 of file Instruction_byteindex.java.


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