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

SWITCH Class Reference

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

Public Methods

 SWITCH (int[] match, InstructionHandle[] targets, InstructionHandle target)
 SWITCH (int[] match, InstructionHandle[] targets, InstructionHandle target, int max_gap)
final Instruction getInstruction ()
final InstructionList getInstructionList ()
 SWITCH (int[] match, InstructionHandle[] targets, InstructionHandle target)
 SWITCH (int[] match, InstructionHandle[] targets, InstructionHandle target, int max_gap)
final Instruction getInstruction ()
final InstructionList getInstructionList ()

Private Methods

final void fillup (int max_gap, InstructionHandle target)
final boolean matchIsOrdered (int max_gap)
final void sort (int l, int r)
final void fillup (int max_gap, InstructionHandle target)
final boolean matchIsOrdered (int max_gap)
final void sort (int l, int r)

Private Attributes

int[] match
InstructionHandle[] targets
Select instruction
int match_length
int[] match
InstructionHandle[] targets

Detailed Description

SWITCH - Branch depending on int value, generates either LOOKUPSWITCH or TABLESWITCH instruction, depending on whether the match values (int[]) can be sorted with no gaps between the numbers.

Version:
Id:
SWITCH.java,v 1.1.1.1 2002/01/24 03:44:05 pserver Exp
Author:
M. Dahm

Definition at line 11 of file lib/jpf/de/fub/bytecode/generic/SWITCH.java.


Constructor & Destructor Documentation

SWITCH::SWITCH int   match[],
InstructionHandle   targets[],
InstructionHandle   target,
int   max_gap
[inline]
 

Template for switch() constructs. If the match array can be sorted in ascending order with gaps no larger than max_gap between the numbers, a TABLESWITCH instruction is generated, and a LOOKUPSWITCH otherwise. The former may be more efficient, but needs more space.

Note, that the key array always will be sorted, though we leave the original arrays unaltered.

Parameters:
match   array of match values (case 2: ... case 7: ..., etc.)
targets   the instructions to be branched to for each case
target   the default target
max_gap   maximum gap that may between case branches

Definition at line 36 of file lib/jpf/de/fub/bytecode/generic/SWITCH.java.

SWITCH::SWITCH int   match[],
InstructionHandle   targets[],
InstructionHandle   target,
int   max_gap
[inline]
 

Template for switch() constructs. If the match array can be sorted in ascending order with gaps no larger than max_gap between the numbers, a TABLESWITCH instruction is generated, and a LOOKUPSWITCH otherwise. The former may be more efficient, but needs more space.

Note, that the key array always will be sorted, though we leave the original arrays unaltered.

Parameters:
match   array of match values (case 2: ... case 7: ..., etc.)
targets   the instructions to be branched to for each case
target   the default target
max_gap   maximum gap that may between case branches

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


Member Function Documentation

final boolean SWITCH::matchIsOrdered int   max_gap [inline, private]
 

Returns:
match is sorted in ascending order with no gap bigger than max_gap?

Definition at line 94 of file src/de/fub/bytecode/generic/SWITCH.java.

final boolean SWITCH::matchIsOrdered int   max_gap [inline, private]
 

Returns:
match is sorted in ascending order with no gap bigger than max_gap?

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

final void SWITCH::sort int   l,
int   r
[inline, private]
 

Sort match and targets array with QuickSort.

Definition at line 104 of file src/de/fub/bytecode/generic/SWITCH.java.

final void SWITCH::sort int   l,
int   r
[inline, private]
 

Sort match and targets array with QuickSort.

Definition at line 104 of file lib/jpf/de/fub/bytecode/generic/SWITCH.java.


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