public class Subroutines extends Object
getTopLevel()
Modifier and Type | Class and Description |
---|---|
private class |
Subroutines.SubroutineImpl
This inner class implements the Subroutine interface.
|
Modifier and Type | Field and Description |
---|---|
private static Integer |
BLACK |
private static Integer |
GRAY |
private Hashtable |
subroutines
The Hashtable containing the subroutines found.
|
Subroutine |
TOPLEVEL
This is referring to a special subroutine, namely the
top level.
|
private static Integer |
WHITE |
Constructor and Description |
---|
Subroutines(MethodGen mg)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Subroutine |
getSubroutine(InstructionHandle leader)
Returns the Subroutine object associated with the given
leader (that is, the first instruction of the subroutine).
|
private static InstructionHandle[] |
getSuccessors(InstructionHandle instruction)
A utility method that calculates the successors of a given InstructionHandle
in the same subroutine.
|
Subroutine |
getTopLevel()
For easy handling, the piece of code that is not a
subroutine, the top-level, is also modeled as a Subroutine
object.
|
private void |
noRecursiveCalls(Subroutine sub,
Set set)
This (recursive) utility method makes sure that
no subroutine is calling a subroutine
that uses the same local variable for the RET as themselves
(recursively).
|
Subroutine |
subroutineOf(InstructionHandle any)
Returns the subroutine object associated with the
given instruction.
|
String |
toString()
Returns a String representation of this object; merely for debugging puposes.
|
private static final Integer WHITE
private static final Integer GRAY
private static final Integer BLACK
private Hashtable subroutines
public final Subroutine TOPLEVEL
public Subroutines(MethodGen mg)
mg
- A MethodGen object representing method to
create the Subroutine objects of.private void noRecursiveCalls(Subroutine sub, Set set)
StructuralCodeConstraintException
- if the above constraint is not satisfied.public Subroutine getSubroutine(InstructionHandle leader)
getTopLevel()
public Subroutine subroutineOf(InstructionHandle any)
getSubroutine(InstructionHandle)
,
getTopLevel()
public Subroutine getTopLevel()
private static InstructionHandle[] getSuccessors(InstructionHandle instruction)