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

InstructionList Class Reference

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

Public Methods

 InstructionList ()
 InstructionList (byte[] code)
 InstructionList (BranchInstruction i)
 InstructionList (CompoundInstruction c)
 InstructionList (Instruction i)
BranchHandle append (BranchInstruction i)
InstructionHandle append (CompoundInstruction c)
InstructionHandle append (Instruction i)
InstructionHandle append (Instruction i, CompoundInstruction c)
InstructionHandle append (Instruction i, Instruction j)
InstructionHandle append (Instruction i, InstructionList il)
BranchHandle append (InstructionHandle ih, BranchInstruction i)
InstructionHandle append (InstructionHandle ih, CompoundInstruction c)
InstructionHandle append (InstructionHandle ih, Instruction i)
InstructionHandle append (InstructionHandle ih, InstructionList il)
InstructionHandle append (InstructionList il)
boolean contains (Instruction i)
boolean contains (InstructionHandle i)
InstructionList copy ()
void delete (Instruction i) throws TargetLostException
void delete (Instruction from, Instruction to) throws TargetLostException
void delete (InstructionHandle ih) throws TargetLostException
void delete (InstructionHandle from, InstructionHandle to) throws TargetLostException
void dispose ()
Enumeration elements ()
InstructionHandle findHandle (int pos)
byte[] getByteCode ()
InstructionHandle getEnd ()
InstructionHandle[] getInstructionHandles ()
int[] getInstructionPositions ()
int getLength ()
InstructionHandle getStart ()
BranchHandle insert (BranchInstruction i)
InstructionHandle insert (CompoundInstruction c)
InstructionHandle insert (Instruction i)
InstructionHandle insert (Instruction i, CompoundInstruction c)
InstructionHandle insert (Instruction i, Instruction j)
InstructionHandle insert (Instruction i, InstructionList il)
BranchHandle insert (InstructionHandle ih, BranchInstruction i)
InstructionHandle insert (InstructionHandle ih, CompoundInstruction c)
InstructionHandle insert (InstructionHandle ih, Instruction i)
InstructionHandle insert (InstructionHandle ih, InstructionList il)
InstructionHandle insert (InstructionList il)
boolean isEmpty ()
void redirectBranches (InstructionHandle old_target, InstructionHandle new_target)
void redirectExceptionHandlers (CodeExceptionGen[] exceptions, InstructionHandle old_target, InstructionHandle new_target)
void redirectLocalVariables (LocalVariableGen[] lg, InstructionHandle old_target, InstructionHandle new_target)
void setPositions ()
void setPositions (boolean check)
int size ()
String toString ()
String toString (boolean verbose)
 InstructionList ()
 InstructionList (byte[] code)
 InstructionList (BranchInstruction i)
 InstructionList (CompoundInstruction c)
 InstructionList (Instruction i)
void addObserver (InstructionListObserver o)
BranchHandle append (BranchInstruction i)
InstructionHandle append (CompoundInstruction c)
InstructionHandle append (Instruction i)
InstructionHandle append (Instruction i, CompoundInstruction c)
InstructionHandle append (Instruction i, Instruction j)
InstructionHandle append (Instruction i, InstructionList il)
BranchHandle append (InstructionHandle ih, BranchInstruction i)
InstructionHandle append (InstructionHandle ih, CompoundInstruction c)
InstructionHandle append (InstructionHandle ih, Instruction i)
InstructionHandle append (InstructionHandle ih, InstructionList il)
InstructionHandle append (InstructionList il)
boolean contains (Instruction i)
boolean contains (InstructionHandle i)
InstructionList copy ()
void delete (Instruction i) throws TargetLostException
void delete (Instruction from, Instruction to) throws TargetLostException
void delete (InstructionHandle ih) throws TargetLostException
void delete (InstructionHandle from, InstructionHandle to) throws TargetLostException
void dispose ()
Enumeration elements ()
InstructionHandle findHandle (int pos)
byte[] getByteCode ()
InstructionHandle getEnd ()
InstructionHandle[] getInstructionHandles ()
int[] getInstructionPositions ()
Instruction[] getInstructions ()
int getLength ()
InstructionHandle getStart ()
BranchHandle insert (BranchInstruction i)
InstructionHandle insert (CompoundInstruction c)
InstructionHandle insert (Instruction i)
InstructionHandle insert (Instruction i, CompoundInstruction c)
InstructionHandle insert (Instruction i, Instruction j)
InstructionHandle insert (Instruction i, InstructionList il)
BranchHandle insert (InstructionHandle ih, BranchInstruction i)
InstructionHandle insert (InstructionHandle ih, CompoundInstruction c)
InstructionHandle insert (InstructionHandle ih, Instruction i)
InstructionHandle insert (InstructionHandle ih, InstructionList il)
InstructionHandle insert (InstructionList il)
boolean isEmpty ()
void move (InstructionHandle ih, InstructionHandle target)
void move (InstructionHandle start, InstructionHandle end, InstructionHandle target)
void redirectBranches (InstructionHandle old_target, InstructionHandle new_target)
void redirectExceptionHandlers (CodeExceptionGen[] exceptions, InstructionHandle old_target, InstructionHandle new_target)
void redirectLocalVariables (LocalVariableGen[] lg, InstructionHandle old_target, InstructionHandle new_target)
void removeObserver (InstructionListObserver o)
void setPositions ()
void setPositions (boolean check)
int size ()
String toString ()
String toString (boolean verbose)
void update ()

Static Public Methods

InstructionHandle findHandle (InstructionHandle[] ihs, int[] pos, int count, int target)
InstructionHandle findHandle (InstructionHandle[] ihs, int[] pos, int count, int target)

Private Methods

void append (InstructionHandle ih)
void clear ()
InstructionHandle findInstruction1 (Instruction i)
InstructionHandle findInstruction2 (Instruction i)
void insert (InstructionHandle ih)
void remove (InstructionHandle prev, InstructionHandle next) throws TargetLostException
void append (InstructionHandle ih)
void clear ()
InstructionHandle findInstruction1 (Instruction i)
InstructionHandle findInstruction2 (Instruction i)
void insert (InstructionHandle ih)
void remove (InstructionHandle prev, InstructionHandle next) throws TargetLostException

Private Attributes

InstructionHandle start = null
InstructionHandle end = null
int length = 0
int[] byte_positions
int[] byte_positions
Vector observers

Detailed Description

This class is a container for a list of `Instruction's, instructions can be appended, inserted, deleted, etc.. Instructions are being wrapped into InstructionHandle objects that are returned upon append/insert operations. They give the user (read only) access to the list structure, it can be traversed and manipulated in a controlled way.

A list is finally dumped to a byte code array with `getByteCode'.

Version:
Id:
InstructionList.java,v 1.1.1.1 2002/01/24 03:44:06 pserver Exp
Author:
M. Dahm
See also:
Instruction , InstructionHandle , BranchHandle

Definition at line 25 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.


Constructor & Destructor Documentation

InstructionList::InstructionList   [inline]
 

Create (empty) instruction list.

Definition at line 32 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

InstructionList::InstructionList byte   code[] [inline]
 

Initialize instruction list from byte array.

Parameters:
code   byte array containing the instructions

Definition at line 38 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

InstructionList::InstructionList BranchInstruction   i [inline]
 

Create instruction list containing one instruction.

Parameters:
i   initial instruction

Definition at line 110 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

InstructionList::InstructionList CompoundInstruction   c [inline]
 

Initialize list with (nonnull) compound instruction. Consumes argument list, i.e. it becomes empty.

Parameters:
c   compound instruction (list)

Definition at line 119 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

InstructionList::InstructionList Instruction   i [inline]
 

Create instruction list containing one instruction.

Parameters:
i   initial instruction

Definition at line 126 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

InstructionList::InstructionList   [inline]
 

Create (empty) instruction list.

Definition at line 39 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionList::InstructionList byte   code[] [inline]
 

Initialize instruction list from byte array.

Parameters:
code   byte array containing the instructions

Definition at line 45 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionList::InstructionList BranchInstruction   i [inline]
 

Create instruction list containing one instruction.

Parameters:
i   initial instruction

Definition at line 118 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionList::InstructionList CompoundInstruction   c [inline]
 

Initialize list with (nonnull) compound instruction. Consumes argument list, i.e., it becomes empty.

Parameters:
c   compound instruction (list)

Definition at line 127 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionList::InstructionList Instruction   i [inline]
 

Create instruction list containing one instruction.

Parameters:
i   initial instruction

Definition at line 134 of file src/de/fub/bytecode/generic/InstructionList.java.


Member Function Documentation

void InstructionList::addObserver InstructionListObserver   o [inline]
 

Add observer for this object.

Definition at line 139 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::append InstructionList   il [inline]
 

Append another list to this one. Consumes argument list, i.e., it becomes empty.

Parameters:
il   list to append to end of this list
Returns:
instruction handle of the first appended instruction

Definition at line 311 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::append InstructionHandle   ih,
InstructionList   il
[inline]
 

Append another list after instruction (handle) ih contained in this list. Consumes argument list, i.e., it becomes empty.

Parameters:
ih   where to append the instruction list
il   Instruction list to append to this one
Returns:
instruction handle pointing to the first appended instruction

Definition at line 279 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::append InstructionHandle   ih,
Instruction   i
[inline]
 

Append an instruction after instruction (handle) ih contained in this list.

Parameters:
ih   where to append the instruction list
i   Instruction to append
Returns:
instruction handle pointing to the first appended instruction

Definition at line 268 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::append InstructionHandle   ih,
CompoundInstruction   c
[inline]
 

Append a compound instruction.

Parameters:
ih   where to append the instruction list
c   The composite instruction (containing an InstructionList)
Returns:
instruction handle of the first appended instruction

Definition at line 258 of file src/de/fub/bytecode/generic/InstructionList.java.

BranchHandle InstructionList::append InstructionHandle   ih,
BranchInstruction   i
[inline]
 

Append an instruction after instruction (handle) ih contained in this list.

Parameters:
ih   where to append the instruction list
i   Instruction to append
Returns:
instruction handle pointing to the first appended instruction

Definition at line 242 of file src/de/fub/bytecode/generic/InstructionList.java.

void InstructionList::append InstructionHandle   ih [inline, private]
 

Append an instruction to the end of this list.

Parameters:
ih   instruction to append

Definition at line 221 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::append Instruction   i,
InstructionList   il
[inline]
 

Append another list after instruction i contained in this list. Consumes argument list, i.e., it becomes empty.

Parameters:
i   where to append the instruction list
il   Instruction list to append to this one
Returns:
instruction handle pointing to the first appended instruction

Definition at line 207 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::append Instruction   i,
Instruction   j
[inline]
 

Append a single instruction j after another instruction i, which must be in this list of course!

Parameters:
i   Instruction in list
j   Instruction to append after i in list
Returns:
instruction handle of the first appended instruction

Definition at line 196 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::append Instruction   i,
CompoundInstruction   c
[inline]
 

Append a compound instruction, after instruction i.

Parameters:
i   Instruction in list
c   The composite instruction (containing an InstructionList)
Returns:
instruction handle of the first appended instruction

Definition at line 185 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::append Instruction   i [inline]
 

Append an instruction to the end of this list.

Parameters:
i   instruction to append
Returns:
instruction handle of the appended instruction

Definition at line 172 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::append CompoundInstruction   c [inline]
 

Append a compound instruction.

Parameters:
c   The composite instruction (containing an InstructionList)
Returns:
instruction handle of the first appended instruction

Definition at line 163 of file src/de/fub/bytecode/generic/InstructionList.java.

BranchHandle InstructionList::append BranchInstruction   i [inline]
 

Append a branch instruction to the end of this list.

Parameters:
i   branch instruction to append
Returns:
branch instruction handle of the appended instruction

Definition at line 151 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::append InstructionList   il [inline]
 

Append another list to this one.

Parameters:
il   list to append to end of this list
Returns:
instruction handle of the first appended instruction

Definition at line 295 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::append InstructionHandle   ih,
InstructionList   il
[inline]
 

Append another list after instruction (handle) ih contained in this list. Consumes argument list, i.e. it becomes empty.

Parameters:
ih   where to append the instruction list
il   Instruction list to append to this one
Returns:
instruction handle pointing to the first appended instruction

Definition at line 263 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::append InstructionHandle   ih,
Instruction   i
[inline]
 

Append an instruction after instruction (handle) ih contained in this list.

Parameters:
ih   where to append the instruction list
i   Instruction to append
Returns:
instruction handle pointing to the first appended instruction

Definition at line 252 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::append InstructionHandle   ih,
CompoundInstruction   c
[inline]
 

Append a compound instruction.

Parameters:
ih   where to append the instruction list
c   The composite instruction (containing an InstructionList)
Returns:
instruction handle of the first appended instruction

Definition at line 242 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

BranchHandle InstructionList::append InstructionHandle   ih,
BranchInstruction   i
[inline]
 

Append an instruction after instruction (handle) ih contained in this list.

Parameters:
ih   where to append the instruction list
i   Instruction to append
Returns:
instruction handle pointing to the first appended instruction

Definition at line 226 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

void InstructionList::append InstructionHandle   ih [inline, private]
 

Append an instruction to the end of this list.

Parameters:
ih   instruction to append

Definition at line 205 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::append Instruction   i,
InstructionList   il
[inline]
 

Append another list after instruction i contained in this list. Consumes argument list, i.e. it becomes empty.

Parameters:
i   where to append the instruction list
il   Instruction list to append to this one
Returns:
instruction handle pointing to the first appended instruction

Definition at line 191 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::append Instruction   i,
Instruction   j
[inline]
 

Append a single instruction j after another instruction i, which must be in this list of course!

Parameters:
i   Instruction in list
j   Instruction to append after i in list
Returns:
instruction handle of the first appended instruction

Definition at line 180 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::append Instruction   i,
CompoundInstruction   c
[inline]
 

Append a compound instruction, after instruction i.

Parameters:
i   Instruction in list
c   The composite instruction (containing an InstructionList)
Returns:
instruction handle of the first appended instruction

Definition at line 169 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::append Instruction   i [inline]
 

Append an instruction to the end of this list.

Parameters:
i   instruction to append
Returns:
instruction handle of the appended instruction

Definition at line 156 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::append CompoundInstruction   c [inline]
 

Append a compound instruction.

Parameters:
c   The composite instruction (containing an InstructionList)
Returns:
instruction handle of the first appended instruction

Definition at line 147 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

BranchHandle InstructionList::append BranchInstruction   i [inline]
 

Append a branch instruction to the end of this list.

Parameters:
i   branch instruction to append
Returns:
branch instruction handle of the appended instruction

Definition at line 135 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

Referenced by ClassGen::addEmptyConstructor(), append(), copy(), and insert().

InstructionList InstructionList::copy   [inline]
 

Returns:
complete, i.e., deep copy of this list

Definition at line 349 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionList InstructionList::copy   [inline]
 

Returns:
complete, i.e. deep copy of this list

Definition at line 331 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

void InstructionList::delete InstructionHandle   from,
InstructionHandle   to
[inline]
 

Remove instructions from instruction `from' to instruction `to' contained in this list. The user must ensure that `from' is an instruction before `to', or risk havoc. The corresponding Instruction handles must not be reused!

Parameters:
from   where to start deleting (inclusive)
to   where to end deleting (inclusive)

Definition at line 448 of file src/de/fub/bytecode/generic/InstructionList.java.

void InstructionList::delete InstructionHandle   ih [inline]
 

Remove instruction from this list. The corresponding Instruction handles must not be reused!

Parameters:
ih   instruction (handle) to remove

Definition at line 437 of file src/de/fub/bytecode/generic/InstructionList.java.

void InstructionList::delete Instruction   from,
Instruction   to
[inline]
 

Remove instructions from instruction `from' to instruction `to' contained in this list. The user must ensure that `from' is an instruction before `to', or risk havoc. The corresponding Instruction handles must not be reused!

Parameters:
from   where to start deleting (inclusive)
to   where to end deleting (inclusive)

Definition at line 419 of file src/de/fub/bytecode/generic/InstructionList.java.

void InstructionList::delete Instruction   i [inline]
 

Remove instruction from this list. The corresponding Instruction handles must not be reused!

Parameters:
i   instruction to remove

Definition at line 403 of file src/de/fub/bytecode/generic/InstructionList.java.

void InstructionList::delete InstructionHandle   from,
InstructionHandle   to
[inline]
 

Remove instructions from instruction `from' to instruction `to' contained in this list. The user must ensure that `from' is an instruction before `to', or risk havoc. The coresponding Instruction handles must not be reused!

Parameters:
from   where to start deleting (inclusive)
to   where to end deleting (inclusive)

Definition at line 430 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

void InstructionList::delete InstructionHandle   ih [inline]
 

Remove instruction from this list. The coresponding Instruction handles must not be reused!

Parameters:
ih   instruction (handle) to remove

Definition at line 419 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

void InstructionList::delete Instruction   from,
Instruction   to
[inline]
 

Remove instructions from instruction `from' to instruction `to' contained in this list. The user must ensure that `from' is an instruction before `to', or risk havoc. The coresponding Instruction handles must not be reused!

Parameters:
from   where to start deleting (inclusive)
to   where to end deleting (inclusive)

Definition at line 401 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

void InstructionList::delete Instruction   i [inline]
 

Remove instruction from this list. The coresponding Instruction handles must not be reused!

Parameters:
i   instruction to remove

Definition at line 385 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

Referenced by MethodGen::removeNOPs().

void InstructionList::dispose   [inline]
 

Delete contents of list. Provides besser memory utilization, because the system then may reuse the instruction handles. This method is typically called right after <href="MethodGen.htmlgetMethod()">MethodGen.getMethod().

Definition at line 459 of file src/de/fub/bytecode/generic/InstructionList.java.

void InstructionList::dispose   [inline]
 

Delete contents of list. Provides besser memory utilization, because the system then reuses the instruction handles. This method is typically called right after MethodGen.getMethod().

Definition at line 440 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

Enumeration InstructionList::elements   [inline]
 

Returns:
Enumeration that lists all instructions (handles)

Definition at line 472 of file src/de/fub/bytecode/generic/InstructionList.java.

Enumeration InstructionList::elements   [inline]
 

Returns:
Enumeration that lists all instructions (handles)

Definition at line 453 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::findHandle int   pos [inline]
 

Get instruction handle for instruction at byte code position pos. This only works properly, if the list is freshly initialized from a byte array or setPositions() has been called before this method.

Parameters:
pos   byte code position to search for
Returns:
target position's instruction handle if available

Definition at line 524 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::findHandle InstructionHandle   ihs[],
int   pos[],
int   count,
int   target
[inline, static]
 

Find the target instruction (handle) that corresponds to the given target position (byte code offset).

Parameters:
ihs   array of instruction handles, i.e. il.getInstructionHandles()
pos   array of positions corresponding to ihs, i.e. il.getInstructionPositions()
count   length of arrays
target   target position to search for
Returns:
target position's instruction handle if available

Definition at line 495 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::findHandle int   pos [inline]
 

Get instruction handle for instruction at byte code position pos. This only works, if the list is freshly initialized from a byte array or setPositions() has been called before this method.

Parameters:
pos   byte code position to search for
Returns:
target position's instruction handle if available

Definition at line 505 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::findHandle InstructionHandle   ihs[],
int   pos[],
int   count,
int   target
[inline, static]
 

Find the target instruction (handle) that corresponds to the given target position (byte code offset).

Parameters:
ihs   array of instruction handles
pos   array of positions corresponding to ihs
count   length of arrays
target   target position to search for
Returns:
target position's instruction handle if available

Definition at line 476 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

Referenced by MethodGen::MethodGen().

InstructionHandle InstructionList::findInstruction1 Instruction   i [inline, private]
 

Search for given Instruction reference, start at beginning of list.

Parameters:
i   instruction to search for
Returns:
instruction found on success, null otherwise

Definition at line 534 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::findInstruction1 Instruction   i [inline, private]
 

Search for given Instruction reference, start at beginning of list.

Parameters:
i   instruction to search for
Returns:
instruction found on success, null otherwise

Definition at line 515 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::findInstruction2 Instruction   i [inline, private]
 

Search for given Instruction reference, start at end of list

Parameters:
i   instruction to search for
Returns:
instruction found on success, null otherwise

Definition at line 547 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::findInstruction2 Instruction   i [inline, private]
 

Search for given Instruction reference, start at end of list

Parameters:
i   instruction to search for
Returns:
instruction found on success, null otherwise

Definition at line 528 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

byte [] InstructionList::getByteCode   [inline]
 

When everything is finished, use this method to convert the instruction list into an array of bytes.

Returns:
the byte code ready to be dumped

Definition at line 560 of file src/de/fub/bytecode/generic/InstructionList.java.

byte [] InstructionList::getByteCode   [inline]
 

Returns:
The byte code!

Definition at line 538 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

Referenced by MethodGen::getMethod().

InstructionHandle InstructionList::getEnd   [inline]
 

Returns:
end of list

Definition at line 582 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::getEnd   [inline]
 

Returns:
end of list

Definition at line 560 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

Referenced by MethodGen::MethodGen().

InstructionHandle [] InstructionList::getInstructionHandles   [inline]
 

Returns:
array containing all instructions (handles)

Definition at line 586 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle [] InstructionList::getInstructionHandles   [inline]
 

Returns:
array containing all instructions (handles)

Definition at line 564 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

Referenced by MethodInfo::loadCode(), and FindPattern::reread().

int [] InstructionList::getInstructionPositions   [inline]
 

Get positions (offsets) of all instructions in the list. This relies on that the list has been freshly created from an byte code array, or that setPositions() has been called. Otherwise this may be inaccurate.

Returns:
array containing all instruction's offset in byte code

Definition at line 604 of file src/de/fub/bytecode/generic/InstructionList.java.

int [] InstructionList::getInstructionPositions   [inline]
 

Get positions (offsets) of all instructions in the list. This relies on that the list has been freshly created from an byte code array, or that setPositions() has been called. Otherwise this may be inaccurate.

Returns:
array containing all instruction's offset in byte code

Definition at line 582 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

Instruction [] InstructionList::getInstructions   [inline]
 

Returns:
an array of instructions without target information for branch instructions.

Definition at line 608 of file src/de/fub/bytecode/generic/InstructionList.java.

int InstructionList::getLength   [inline]
 

Returns:
length of list (Number of instructions, not bytes)

Definition at line 624 of file src/de/fub/bytecode/generic/InstructionList.java.

int InstructionList::getLength   [inline]
 

Returns:
length of list (Number of instructions, not bytes)

Definition at line 586 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

Referenced by FindPattern::reread().

InstructionHandle InstructionList::getStart   [inline]
 

Returns:
start of list

Definition at line 628 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::getStart   [inline]
 

Returns:
start of list

Definition at line 597 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

Referenced by MethodGen::MethodGen(), MethodGen::getMaxStack(), MethodGen::removeNOPs(), FindPattern::search(), and MethodGen::setMaxLocals().

InstructionHandle InstructionList::insert InstructionList   il [inline]
 

Insert another list.

Parameters:
il   list to insert before start of this list
Returns:
instruction handle of the first inserted instruction

Definition at line 793 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::insert InstructionHandle   ih,
InstructionList   il
[inline]
 

Insert another list before Instruction handle ih contained in this list. Consumes argument list, i.e., it becomes empty.

Parameters:
i   where to append the instruction list
il   Instruction list to insert
Returns:
instruction handle of the first inserted instruction

Definition at line 762 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::insert InstructionHandle   ih,
Instruction   i
[inline]
 

Insert an instruction before instruction (handle) ih contained in this list.

Parameters:
ih   where to insert to the instruction list
i   Instruction to insert
Returns:
instruction handle of the first inserted instruction

Definition at line 751 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::insert InstructionHandle   ih,
CompoundInstruction   c
[inline]
 

Insert a compound instruction.

Parameters:
ih   where to insert the instruction list
c   The composite instruction (containing an InstructionList)
Returns:
instruction handle of the first inserted instruction

Definition at line 741 of file src/de/fub/bytecode/generic/InstructionList.java.

BranchHandle InstructionList::insert InstructionHandle   ih,
BranchInstruction   i
[inline]
 

Insert an instruction before instruction (handle) ih contained in this list.

Parameters:
ih   where to insert to the instruction list
i   Instruction to insert
Returns:
instruction handle of the first inserted instruction

Definition at line 725 of file src/de/fub/bytecode/generic/InstructionList.java.

void InstructionList::insert InstructionHandle   ih [inline, private]
 

Insert an instruction at start of this list.

Parameters:
ih   instruction to insert

Definition at line 705 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::insert Instruction   i,
InstructionList   il
[inline]
 

Insert another list before Instruction i contained in this list. Consumes argument list, i.e., it becomes empty.

Parameters:
i   where to append the instruction list
il   Instruction list to insert
Returns:
instruction handle pointing to the first inserted instruction, i.e., il.getStart()

Definition at line 691 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::insert Instruction   i,
Instruction   j
[inline]
 

Insert a single instruction j before another instruction i, which must be in this list of course!

Parameters:
i   Instruction in list
j   Instruction to insert before i in list
Returns:
instruction handle of the first inserted instruction

Definition at line 679 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::insert Instruction   i,
CompoundInstruction   c
[inline]
 

Insert a compound instruction before instruction i.

Parameters:
i   Instruction in list
c   The composite instruction (containing an InstructionList)
Returns:
instruction handle of the first inserted instruction

Definition at line 668 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::insert Instruction   i [inline]
 

Insert an instruction at start of this list.

Parameters:
i   instruction to insert
Returns:
instruction handle of the inserted instruction

Definition at line 655 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::insert CompoundInstruction   c [inline]
 

Insert a compound instruction.

Parameters:
c   The composite instruction (containing an InstructionList)
Returns:
instruction handle of the first inserted instruction

Definition at line 646 of file src/de/fub/bytecode/generic/InstructionList.java.

BranchHandle InstructionList::insert BranchInstruction   i [inline]
 

Insert a branch instruction at start of this list.

Parameters:
i   branch instruction to insert
Returns:
branch instruction handle of the appended instruction

Definition at line 635 of file src/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::insert InstructionList   il [inline]
 

Insert another list.

Parameters:
il   list to insert before start of this list
Returns:
instruction handle of the first inserted instruction

Definition at line 763 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::insert InstructionHandle   ih,
InstructionList   il
[inline]
 

Insert another list before Instruction handle ih contained in this list. Consumes argument list, i.e. it becomes empty.

Parameters:
i   where to append the instruction list
il   Instruction list to insert
Returns:
instruction handle of the first inserted instruction

Definition at line 732 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::insert InstructionHandle   ih,
Instruction   i
[inline]
 

Insert an instruction before instruction (handle) ih contained in this list.

Parameters:
ih   where to insert to the instruction list
i   Instruction to insert
Returns:
instruction handle of the first inserted instruction

Definition at line 721 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::insert InstructionHandle   ih,
CompoundInstruction   c
[inline]
 

Insert a compound instruction.

Parameters:
ih   where to insert the instruction list
c   The composite instruction (containing an InstructionList)
Returns:
instruction handle of the first inserted instruction

Definition at line 711 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

BranchHandle InstructionList::insert InstructionHandle   ih,
BranchInstruction   i
[inline]
 

Insert an instruction before instruction (handle) ih contained in this list.

Parameters:
ih   where to insert to the instruction list
i   Instruction to insert
Returns:
instruction handle of the first inserted instruction

Definition at line 695 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

void InstructionList::insert InstructionHandle   ih [inline, private]
 

Insert an instruction at start of this list.

Parameters:
ih   instruction to insert

Definition at line 674 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::insert Instruction   i,
InstructionList   il
[inline]
 

Insert another list before Instruction i contained in this list. Consumes argument list, i.e. it becomes empty.

Parameters:
i   where to append the instruction list
il   Instruction list to insert
Returns:
instruction handle pointing to the first inserted instruction, i.e. il.getStart()

Definition at line 660 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::insert Instruction   i,
Instruction   j
[inline]
 

Insert a single instruction j before another instruction i, which must be in this list of course!

Parameters:
i   Instruction in list
j   Instruction to insert before i in list
Returns:
instruction handle of the first inserted instruction

Definition at line 648 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::insert Instruction   i,
CompoundInstruction   c
[inline]
 

Insert a compound instruction before instruction i.

Parameters:
i   Instruction in list
c   The composite instruction (containing an InstructionList)
Returns:
instruction handle of the first inserted instruction

Definition at line 637 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::insert Instruction   i [inline]
 

Insert an instruction at start of this list.

Parameters:
i   instruction to insert
Returns:
instruction handle of the inserted instruction

Definition at line 624 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

InstructionHandle InstructionList::insert CompoundInstruction   c [inline]
 

Insert a compound instruction.

Parameters:
c   The composite instruction (containing an InstructionList)
Returns:
instruction handle of the first inserted instruction

Definition at line 615 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

BranchHandle InstructionList::insert BranchInstruction   i [inline]
 

Insert a branch instruction at start of this list.

Parameters:
i   branch instruction to insert
Returns:
branch instruction handle of the appended instruction

Definition at line 604 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

boolean InstructionList::isEmpty   [inline]
 

Test for empty list.

Definition at line 804 of file src/de/fub/bytecode/generic/InstructionList.java.

boolean InstructionList::isEmpty   [inline]
 

Test for empty list.

Definition at line 774 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

Referenced by append(), and insert().

void InstructionList::move InstructionHandle   start,
InstructionHandle   end,
InstructionHandle   target
[inline]
 

Take all instructions (handles) from "start" to "end" and append them after the new location "target". Of course, "end" must be after "start" and target must not be located withing this range. If you want to move something to the start of the list use null as value for target.
Any instruction targeters pointing to handles within the block, keep their targets.

Parameters:
start   of moved block
end   of moved block
target   of moved block

Definition at line 825 of file src/de/fub/bytecode/generic/InstructionList.java.

void InstructionList::move InstructionHandle   ih,
InstructionHandle   target
[inline]
 

Move a single instruction (handle) to a new location.

Parameters:
ih   moved instruction
target   new location of moved instruction

Definition at line 811 of file src/de/fub/bytecode/generic/InstructionList.java.

void InstructionList::redirectBranches InstructionHandle   old_target,
InstructionHandle   new_target
[inline]
 

Redirect all references from old_target to new_target, i.e., update targets of branch instructions.

Parameters:
old_target   the old target instruction handle
new_target   the new target instruction handle

Definition at line 882 of file src/de/fub/bytecode/generic/InstructionList.java.

void InstructionList::redirectBranches InstructionHandle   old_target,
InstructionHandle   new_target
[inline]
 

Redirect all references from old_target to new_target, i.e. update targets of branch instructions.

@param old_target the old target instruction handle @param new_target the new target instruction handle

Definition at line 782 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

void InstructionList::redirectExceptionHandlers CodeExceptionGen   exceptions[],
InstructionHandle   old_target,
InstructionHandle   new_target
[inline]
 

Redirect all references of exception handlers from old_target to new_target.

@param exceptions array of exception handlers @param old_target the old target instruction handle @param new_target the new target instruction handle @see MethodGen

Definition at line 912 of file src/de/fub/bytecode/generic/InstructionList.java.

void InstructionList::redirectExceptionHandlers CodeExceptionGen   exceptions[],
InstructionHandle   old_target,
InstructionHandle   new_target
[inline]
 

Redirect all references of exception handlers from old_target to new_target.

@param exceptions array of exception handlers @param old_target the old target instruction handle @param new_target the new target instruction handle @see MethodGen

Definition at line 812 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

void InstructionList::redirectLocalVariables LocalVariableGen   lg[],
InstructionHandle   old_target,
InstructionHandle   new_target
[inline]
 

Redirect all references of local variables from old_target to new_target.

@param lg array of local variables @param old_target the old target instruction handle @param new_target the new target instruction handle @see MethodGen

Definition at line 934 of file src/de/fub/bytecode/generic/InstructionList.java.

void InstructionList::redirectLocalVariables LocalVariableGen   lg[],
InstructionHandle   old_target,
InstructionHandle   new_target
[inline]
 

Redirect all references of local variables from old_target to new_target.

@param lg array of local variables @param old_target the old target instruction handle @param new_target the new target instruction handle @see MethodGen

Definition at line 834 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

void InstructionList::remove InstructionHandle   prev,
InstructionHandle   next
[inline, private]
 

Remove from instruction `prev' to instruction `next' both contained in this list. Throws TargetLostException when one of the removed instruction handles is still being targeted.

Parameters:
prev   where to start deleting (predecessor, exclusive)
next   where to end deleting (successor, exclusive)

Definition at line 956 of file src/de/fub/bytecode/generic/InstructionList.java.

void InstructionList::remove InstructionHandle   prev,
InstructionHandle   next
[inline, private]
 

Remove from instruction `prev' to instruction `next' both contained in this list. Throws TargetLostException when one of the removed instruction handles is still being targeted.

Parameters:
prev   where to start deleting (predecessor, exclusive)
next   where to end deleting (successor, exclusive)

Definition at line 856 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

void InstructionList::removeObserver InstructionListObserver   o [inline]
 

Remove observer for this object.

Definition at line 1013 of file src/de/fub/bytecode/generic/InstructionList.java.

void InstructionList::setPositions boolean   check [inline]
 

Give all instructions their position number (offset in byte stream), i.e., make the list ready to be dumped.

Parameters:
check   Perform sanity checks, e.g. if all targeted instructions really belong to this list

Definition at line 1027 of file src/de/fub/bytecode/generic/InstructionList.java.

void InstructionList::setPositions boolean   check [inline]
 

Give all instructions their position number (offset in byte stream), i.e. make the list ready to be dumped.

Parameters:
check   Perform sanity checks, e.g. if all targeted instructions really belong to this list

Definition at line 921 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

int InstructionList::size   [inline]
 

Returns:
length of list (Number of instructions, not bytes)

Definition at line 1118 of file src/de/fub/bytecode/generic/InstructionList.java.

int InstructionList::size   [inline]
 

Returns:
length of list (Number of instructions, not bytes)

Definition at line 1003 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

String InstructionList::toString boolean   verbose [inline]
 

Parameters:
verbose   toggle output format
Returns:
String containing all instructions in this list.

Definition at line 1126 of file src/de/fub/bytecode/generic/InstructionList.java.

String InstructionList::toString boolean   verbose [inline]
 

Parameters:
verbose   toggle output format
Returns:
String containing all instructions in this list.

Definition at line 1011 of file lib/jpf/de/fub/bytecode/generic/InstructionList.java.

void InstructionList::update   [inline]
 

Call notify() method on all observers. This method is not called automatically whenever the state has changed, but has to be called by the user after he has finished editing the object.

Definition at line 1139 of file src/de/fub/bytecode/generic/InstructionList.java.


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