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

BranchInstruction Class Reference

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

Public Methods

boolean containsTarget (InstructionHandle ih)
void dump (DataOutputStream out) throws IOException
InstructionHandle getTarget ()
void setTarget (InstructionHandle target)
String toString (boolean verbose)
void updateTarget (InstructionHandle old_ih, InstructionHandle new_ih)
boolean containsTarget (InstructionHandle ih)
void dump (DataOutputStream out) throws IOException
final int getIndex ()
InstructionHandle getTarget ()
void setTarget (InstructionHandle target)
String toString (boolean verbose)
void updateTarget (InstructionHandle old_ih, InstructionHandle new_ih)

Protected Methods

 BranchInstruction (short tag, InstructionHandle target)
int getTargetOffset ()
int getTargetOffset (InstructionHandle target)
void initFromFile (ByteSequence bytes, boolean wide) throws IOException
int updatePosition (int offset, int max_offset)
 BranchInstruction (short tag, InstructionHandle target)
int getTargetOffset ()
int getTargetOffset (InstructionHandle target)
void initFromFile (ByteSequence bytes, boolean wide) throws IOException
int updatePosition (int offset, int max_offset)

Protected Attributes

int index
InstructionHandle target
int position

Private Methods

 BranchInstruction ()
void dispose ()
final int getIndex ()
 BranchInstruction ()
void dispose ()

Static Private Methods

final void notifyTarget (InstructionHandle old_ih, InstructionHandle new_ih, InstructionTargeter t)
final void notifyTarget (InstructionHandle old_ih, InstructionHandle new_ih, InstructionTargeter t)

Detailed Description

Abstract super class for branching instructions like GOTO, IFEQ, etc.. Branch instructions may have a variable length, namely GOTO, JSR, LOOKUPSWITCH and TABLESWITCH.

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

Definition at line 15 of file lib/jpf/de/fub/bytecode/generic/BranchInstruction.java.


Constructor & Destructor Documentation

BranchInstruction::BranchInstruction   [inline, private]
 

Empty constructor needed for the Class.newInstance() statement in Instruction.readInstruction(). Not to be used otherwise.

Definition at line 23 of file lib/jpf/de/fub/bytecode/generic/BranchInstruction.java.

BranchInstruction::BranchInstruction short   tag,
InstructionHandle   target
[inline, protected]
 

Parameters:
instruction   Target instruction to branch to

Definition at line 27 of file lib/jpf/de/fub/bytecode/generic/BranchInstruction.java.

BranchInstruction::BranchInstruction   [inline, private]
 

Empty constructor needed for the Class.newInstance() statement in Instruction.readInstruction(). Not to be used otherwise.

Definition at line 24 of file src/de/fub/bytecode/generic/BranchInstruction.java.

BranchInstruction::BranchInstruction short   tag,
InstructionHandle   target
[inline, protected]
 

Common super constructor

Parameters:
tag   Instruction opcode
target   instruction to branch to

Definition at line 29 of file src/de/fub/bytecode/generic/BranchInstruction.java.


Member Function Documentation

boolean BranchInstruction::containsTarget InstructionHandle   ih [inline]
 

Returns:
true, if ih is target of this instruction

Reimplemented from InstructionTargeter.

Reimplemented in Select, and Select.

Definition at line 36 of file src/de/fub/bytecode/generic/BranchInstruction.java.

boolean BranchInstruction::containsTarget InstructionHandle   ih [inline]
 

Returns:
true, if ih is target of this instruction

Reimplemented from InstructionTargeter.

Reimplemented in Select, and Select.

Definition at line 34 of file lib/jpf/de/fub/bytecode/generic/BranchInstruction.java.

void BranchInstruction::dispose   [inline, private]
 

Inform target that it's not targeted anymore.

Reimplemented from Instruction.

Reimplemented in Select, and Select.

Definition at line 42 of file src/de/fub/bytecode/generic/BranchInstruction.java.

void BranchInstruction::dispose   [inline, private]
 

Inform target that it's not targeted anymore.

Reimplemented from Instruction.

Reimplemented in Select, and Select.

Definition at line 40 of file lib/jpf/de/fub/bytecode/generic/BranchInstruction.java.

void BranchInstruction::dump DataOutputStream   out [inline]
 

Dump instruction as byte code to stream out.

Parameters:
out   Output stream

Reimplemented from Instruction.

Reimplemented in GOTO, GOTO_W, JSR, JSR_W, LOOKUPSWITCH, Select, TABLESWITCH, GOTO, GOTO_W, JSR, JSR_W, LOOKUPSWITCH, Select, and TABLESWITCH.

Definition at line 51 of file src/de/fub/bytecode/generic/BranchInstruction.java.

void BranchInstruction::dump DataOutputStream   out [inline]
 

Dump instruction as byte code to stream out.

Parameters:
out   Output stream

Reimplemented from Instruction.

Reimplemented in GOTO, GOTO_W, JSR, JSR_W, LOOKUPSWITCH, Select, TABLESWITCH, GOTO, GOTO_W, JSR, JSR_W, LOOKUPSWITCH, Select, and TABLESWITCH.

Definition at line 49 of file lib/jpf/de/fub/bytecode/generic/BranchInstruction.java.

final int BranchInstruction::getIndex   [inline]
 

Returns:
target offset in byte code

Definition at line 64 of file src/de/fub/bytecode/generic/BranchInstruction.java.

final int BranchInstruction::getIndex   [inline, private]
 

Returns:
target offset

Definition at line 62 of file lib/jpf/de/fub/bytecode/generic/BranchInstruction.java.

Referenced by InstructionList::InstructionList().

InstructionHandle BranchInstruction::getTarget   [inline]
 

Returns:
target of branch instruction

Definition at line 68 of file src/de/fub/bytecode/generic/BranchInstruction.java.

InstructionHandle BranchInstruction::getTarget   [inline]
 

Returns:
target of branch instruction

Definition at line 66 of file lib/jpf/de/fub/bytecode/generic/BranchInstruction.java.

Referenced by InstructionList::copy(), MethodGen::getMaxStack(), and InstructionList::redirectBranches().

int BranchInstruction::getTargetOffset InstructionHandle   target [inline, protected]
 

Parameters:
target   branch target
Returns:
the offset to `target' relative to this instruction

Definition at line 77 of file src/de/fub/bytecode/generic/BranchInstruction.java.

int BranchInstruction::getTargetOffset   [inline, protected]
 

Returns:
the offset to this instruction's target

Definition at line 72 of file src/de/fub/bytecode/generic/BranchInstruction.java.

int BranchInstruction::getTargetOffset InstructionHandle   target [inline, protected]
 

Parameters:
target   branch target
Returns:
the offset to `target' relative to this instruction

Definition at line 75 of file lib/jpf/de/fub/bytecode/generic/BranchInstruction.java.

int BranchInstruction::getTargetOffset   [inline, protected]
 

Returns:
the offset to this instruction's target

Definition at line 70 of file lib/jpf/de/fub/bytecode/generic/BranchInstruction.java.

Referenced by TABLESWITCH::dump(), LOOKUPSWITCH::dump(), and JSR_W::dump().

void BranchInstruction::initFromFile ByteSequence   bytes,
boolean   wide
[inline, protected]
 

Read needed data (e.g. index) from file. Conversion to a InstructionHandle is done in InstructionList(byte[]).

Parameters:
bytes   input stream
wide   wide prefix?
See also:
InstructionList

Reimplemented from Instruction.

Reimplemented in GOTO_W, JSR_W, LOOKUPSWITCH, Select, TABLESWITCH, GOTO_W, JSR_W, LOOKUPSWITCH, Select, and TABLESWITCH.

Definition at line 98 of file src/de/fub/bytecode/generic/BranchInstruction.java.

void BranchInstruction::initFromFile ByteSequence   bytes,
boolean   wide
[inline, protected]
 

Read needed data (e.g. index) from file. Conversion to a InstructionHandle is done in InstructionList(byte[]).

See also:
InstructionList

Reimplemented from Instruction.

Reimplemented in GOTO_W, JSR_W, LOOKUPSWITCH, Select, TABLESWITCH, GOTO_W, JSR_W, LOOKUPSWITCH, Select, and TABLESWITCH.

Definition at line 94 of file lib/jpf/de/fub/bytecode/generic/BranchInstruction.java.

final void BranchInstruction::notifyTarget InstructionHandle   old_ih,
InstructionHandle   new_ih,
InstructionTargeter   t
[inline, static, private]
 

Used by BranchInstruction, LocalVariableGen, CodeExceptionGen

Definition at line 106 of file src/de/fub/bytecode/generic/BranchInstruction.java.

final void BranchInstruction::notifyTarget InstructionHandle   old_ih,
InstructionHandle   new_ih,
InstructionTargeter   t
[inline, static, private]
 

Used by BranchInstruction, LocalVariableGen, CodeExceptionGen

Definition at line 102 of file lib/jpf/de/fub/bytecode/generic/BranchInstruction.java.

void BranchInstruction::setTarget InstructionHandle   target [inline]
 

Set branch target

Parameters:
target   branch target

Definition at line 117 of file src/de/fub/bytecode/generic/BranchInstruction.java.

void BranchInstruction::setTarget InstructionHandle   target [inline]
 

Set branch target

Definition at line 112 of file lib/jpf/de/fub/bytecode/generic/BranchInstruction.java.

Referenced by InstructionList::InstructionList(), InstructionList::copy(), and InstructionList::redirectBranches().

String BranchInstruction::toString boolean   verbose [inline]
 

Long output format:

<position in byte code> <name of opcode> "["<opcode number>"]" "("<length of instruction>")" "<"<target instruction>">" "@"<branch target offset>

Parameters:
verbose   long/short format switch
Returns:
mnemonic for instruction

Reimplemented from Instruction.

Reimplemented in Select, and Select.

Definition at line 132 of file src/de/fub/bytecode/generic/BranchInstruction.java.

String BranchInstruction::toString boolean   verbose [inline]
 

Long output format:

<position in byte code> <name of opcode> "["<opcode number>"]" "("<length of instruction>")" "<"<target instruction>">" "@"<branch target offset>

Parameters:
verbose   long/short format switch
Returns:
mnemonic for instruction

Reimplemented from Instruction.

Reimplemented in Select, and Select.

Definition at line 127 of file lib/jpf/de/fub/bytecode/generic/BranchInstruction.java.

int BranchInstruction::updatePosition int   offset,
int   max_offset
[inline, protected]
 

Called by InstructionList.setPositions when setting the position for every instruction. In the presence of variable length instructions `setPositions' performs multiple passes over the instruction list to calculate the correct (byte) positions and offsets by calling this function.

Parameters:
offset   additional offset caused by preceding (variable length) instructions
max_offset   the maximum offset that may be caused by these instructions
Returns:
additional offset caused by possible change of this instruction's length

Reimplemented in GOTO, JSR, Select, GOTO, JSR, and Select.

Definition at line 164 of file src/de/fub/bytecode/generic/BranchInstruction.java.

int BranchInstruction::updatePosition int   offset,
int   max_offset
[inline, protected]
 

Called by InstructionList.setPositions when setting the position for every instruction. In the presence of variable length instructions `setPositions' performs multiple passes over the instruction list to calculate the correct (byte) positions and offsets by calling this function.

Parameters:
offset   additional offset caused by preceding (variable length) instructions
max_offset   the maximum offset that may be caused by these instructions
Returns:
additional offset caused by possible change of this instruction's length

Reimplemented in GOTO, JSR, Select, GOTO, JSR, and Select.

Definition at line 157 of file lib/jpf/de/fub/bytecode/generic/BranchInstruction.java.

void BranchInstruction::updateTarget InstructionHandle   old_ih,
InstructionHandle   new_ih
[inline]
 

Parameters:
old_ih   old target
new_ih   new target

Reimplemented from InstructionTargeter.

Reimplemented in Select, and Select.

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

void BranchInstruction::updateTarget InstructionHandle   old_ih,
InstructionHandle   new_ih
[inline]
 

Parameters:
old_ih   old target
new_ih   new target

Reimplemented from InstructionTargeter.

Reimplemented in Select, and Select.

Definition at line 165 of file lib/jpf/de/fub/bytecode/generic/BranchInstruction.java.


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