All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class BIT.highBIT.Routine

java.lang.Object
   |
   +----BIT.highBIT.Routine

public class Routine
extends Object
Contains information about a method within a Java .class file.

See Also:
ClassInfo, Method_Info

Variable Index

 o basic_blocks
Bytecodes (code) broken into a number of basic blocks in an array.
 o classinfo
 o code
Actual array containing the bytecodes.
 o code_length
Length of the code in bytes of this method.
 o constant_pool
 o descriptor
Descriptor for this method.
 o instructions
Bytecodes (code) broken into a number of instructions in an array.
 o max_locals
Maximum number of locals for this method.
 o max_stack
Maximum stack size for this method.
 o method
Method information in classFile package.
 o method_name
Name of this method.
 o modified_basic_blocks
 o modified_instructions
This is the Vector to hold the modified code.

Constructor Index

 o Routine(Method_Info, Cp_Info[], ClassInfo)
Creates a new Routine class which breaks down methods into more easily manageble entities.

Method Index

 o addAfter(String, String, Object)
 o addBefore(String, String, Object)
 o addConstantPoolEntry(Cp_Info)
 o adjInstrOffsets(int, int, boolean)
 o adjModifiedBasicBlocks(int, int, boolean)
Modifies the modified_basic_block array so that it reflects changes in the modified_instructions array.
 o adjOffsets(int, int, boolean)
 o existBasicBlockStart(int)
 o getAccessFlags()
Returns this method's access flags.
 o getBasicBlockCount()
Returns the number of basic blocks in this method.
 o getBasicBlocks()
Returns the array of basic blocks.
 o getClassName()
 o getCode()
Returns code buffer (actual bytecode) uninterpreted.
 o getCodeLength()
Returns the length of the code array (actual bytecode).
 o getConstantPool()
 o getDescriptor()
Returns the descriptor of this method.
 o getInstruction(int)
 o getInstructionArray()
Returns the InstructionArray.
 o getInstructionCount()
Returns the number of instuctions in this method.
 o getInstructions()
Returns the array of instructions.
 o getLineNumber(int)
 o getMaxLocals()
Returns maximum number of locals for this method.
 o getMaxStack()
Returns maximum stack size for this method.
 o getMethodName()
Returns the name of this method.
 o getTempBasicBlock(int)
 o getTempBasicBlocks()
Returns the vector of basic blocks.
 o getTempBasicBlockStart()
 o inBasicBlock(int)
Returns index of basic block that contains (between start and end address) the specified address.
 o indexInConstantPool(Cp_Info)
 o indexOfBasicBlock(int)
Returns index of basic block that starts at specified start_address.
 o indexOfInstruction(int)
Returns the index of instruction that starts at specified offset in code buffer.
 o isAbstract()
Returns true if this method was declared to be abstract.
 o isFinal()
Returns true if this method was declared to be final.
 o isNative()
Returns true if this method was declared to be native.
 o isPrivate()
Returns true if this method was declared to be private.
 o isProtected()
Returns true if this method was declared to be protected.
 o isPublic()
Returns true if this method was declared to be public.
 o isStatic()
Returns true if this method was declared to be static.
 o isSynchronized()
Returns true if this method was declared to be synchronized.
 o setConstantPool(Cp_Info[])
 o writeReady()

Variables

 o method
 protected Method_Info method
Method information in classFile package.

See Also:
Method_Info
 o classinfo
 protected ClassInfo classinfo
 o method_name
 protected String method_name
Name of this method. It gets filled in when the constructor is called.
One can read this value by calling getMethodName() method.

See Also:
getMethodName
 o descriptor
 protected String descriptor
Descriptor for this method. It gets filled in when the constructor is called.
One can read this value calling getDescriptor() method.

See Also:
getDescriptor
 o max_stack
 protected short max_stack
Maximum stack size for this method. It gets filled in when the constructor is called.
One can read this value by calling getMaxStack() method.

See Also:
getMaxStack
 o max_locals
 protected short max_locals
Maximum number of locals for this method. It gets filled in when the constructor is called.
One can read this value by calling getMaxLocals() method.

See Also:
getMaxLocals
 o code_length
 protected int code_length
Length of the code in bytes of this method.
One can read this value by calling getCodeLength() method.

See Also:
getCodeLength
 o code
 public byte code[]
Actual array containing the bytecodes.
This is an array of byte that represent the bytecodes of this method. One can read this value by calling getCode() method.

See Also:
getCode
 o instructions
 public InstructionArray instructions
Bytecodes (code) broken into a number of instructions in an array.
Each element in this array is a valid Java Virtual Machine instruction. Each instruction contains the opcode and any operands.

See Also:
Instruction, getInstructions, InstructionArray
 o modified_instructions
 public Vector modified_instructions
This is the Vector to hold the modified code.

 o basic_blocks
 public BasicBlockArray basic_blocks
Bytecodes (code) broken into a number of basic blocks in an array.
Each element in this array is a basic block having one entry point and one exit point.

See Also:
BasicBlockArray, getBasicBlocks
 o modified_basic_blocks
 public BasicBlockArray modified_basic_blocks
 o constant_pool
 public Cp_Info constant_pool[]

Constructors

 o Routine
 public Routine(Method_Info method,
                Cp_Info constant_pool[],
                ClassInfo classinfo)
Creates a new Routine class which breaks down methods into more easily manageble entities.
The only attribute that it looks at is the "Code" attribute.

Parameters:
method - the method to be analyzed
constant_pool - the constant pool for the .class file
See Also:
Method_Info, Cp_Info

Methods

 o getLineNumber
 public int getLineNumber(int pc)
 o addBefore
 public void addBefore(String classname,
                       String methodname,
                       Object arg)
 o addAfter
 public void addAfter(String classname,
                      String methodname,
                      Object arg)
 o adjInstrOffsets
 public void adjInstrOffsets(int start,
                             int size,
                             boolean before)
 o adjOffsets
 public void adjOffsets(int start,
                        int size,
                        boolean before)
 o adjModifiedBasicBlocks
 public void adjModifiedBasicBlocks(int affected_start,
                                    int offset,
                                    boolean before)
Modifies the modified_basic_block array so that it reflects changes in the modified_instructions array.

 o indexOfInstruction
 public int indexOfInstruction(int offset)
Returns the index of instruction that starts at specified offset in code buffer. If not found, return -1.

 o existBasicBlockStart
 public boolean existBasicBlockStart(int address)
 o indexOfBasicBlock
 public int indexOfBasicBlock(int start_address)
Returns index of basic block that starts at specified start_address. If not found, return -1.

 o inBasicBlock
 public int inBasicBlock(int address)
Returns index of basic block that contains (between start and end address) the specified address. Otherwise, return -1.

 o getInstruction
 public Instruction getInstruction(int index)
 o getTempBasicBlock
 public BasicBlock getTempBasicBlock(int index)
 o writeReady
 public void writeReady()
 o getAccessFlags
 public short getAccessFlags()
Returns this method's access flags.

 o isPublic
 public boolean isPublic()
Returns true if this method was declared to be public.

 o isPrivate
 public boolean isPrivate()
Returns true if this method was declared to be private.

 o isProtected
 public boolean isProtected()
Returns true if this method was declared to be protected.

 o isStatic
 public boolean isStatic()
Returns true if this method was declared to be static.

 o isFinal
 public boolean isFinal()
Returns true if this method was declared to be final.

 o isSynchronized
 public boolean isSynchronized()
Returns true if this method was declared to be synchronized.

 o isNative
 public boolean isNative()
Returns true if this method was declared to be native.

 o isAbstract
 public boolean isAbstract()
Returns true if this method was declared to be abstract.

 o getMethodName
 public String getMethodName()
Returns the name of this method.

 o getDescriptor
 public String getDescriptor()
Returns the descriptor of this method.

 o getCodeLength
 public int getCodeLength()
Returns the length of the code array (actual bytecode).

 o getCode
 public byte[] getCode()
Returns code buffer (actual bytecode) uninterpreted.

 o getMaxStack
 public short getMaxStack()
Returns maximum stack size for this method.

 o getMaxLocals
 public short getMaxLocals()
Returns maximum number of locals for this method.

 o getInstructions
 public Instruction[] getInstructions()
Returns the array of instructions.

See Also:
Instruction
 o getInstructionArray
 public InstructionArray getInstructionArray()
Returns the InstructionArray.

See Also:
InstructionArray
 o getInstructionCount
 public int getInstructionCount()
Returns the number of instuctions in this method.

 o getBasicBlocks
 public BasicBlockArray getBasicBlocks()
Returns the array of basic blocks.

See Also:
BasicBlockArray
 o getTempBasicBlocks
 public Vector getTempBasicBlocks()
Returns the vector of basic blocks.

See Also:
Vector
 o getTempBasicBlockStart
 public Vector getTempBasicBlockStart()
 o getBasicBlockCount
 public int getBasicBlockCount()
Returns the number of basic blocks in this method.

 o indexInConstantPool
 public short indexInConstantPool(Cp_Info cp)
 o addConstantPoolEntry
 public short addConstantPoolEntry(Cp_Info entry)
 o setConstantPool
 public void setConstantPool(Cp_Info cps[])
 o getConstantPool
 public Cp_Info[] getConstantPool()
 o getClassName
 public String getClassName()

All Packages  Class Hierarchy  This Package  Previous  Next  Index