Top Description Methods
org.apache.bcel.verifier.structurals

public Interface Subroutine

Known Direct Implementers
org.apache.bcel.verifier.structurals.Subroutines.SubroutineImpl
Imports
org.apache.bcel.generic.InstructionHandle

This interface defines properties of JVM bytecode subroutines. Note that it is 'abused' to maintain the top-level code in a consistent fashion, too.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

Whether the given InstructionHandle refers to an instruction that is part of this subroutine.
contains
(InstructionHandle
The InstructionHandle to test.
inst
)

Returns if the given InstructionHandle refers to an instruction that is part of this subroutine.

public int[]

Returns:

An int[] containing the indices of the local variable slots.
getAccessedLocalsIndices
()

Returns an int[] containing the indices of the local variable slots accessed by this Subroutine (read-accessed, write-accessed or both); local variables referenced by subroutines of this subroutine are not included.

public InstructionHandle[]

Returns:

The JsrInstructions that have the first instruction of this subroutine as their target.
getEnteringJsrInstructions
()

Returns all the JsrInstructions that have the first instruction of this subroutine as their target.

public InstructionHandle[]

Returns:

All instructions that together form this subroutine.
getInstructions
()

Returns all instructions that together form this subroutine.

public InstructionHandle

Returns:

The one and only RET that leaves the subroutine.
getLeavingRET
()

Returns the one and only RET that leaves the subroutine.

public int[]

Returns:

An int[] containing the indices of the local variable slots.
getRecursivelyAccessedLocalsIndices
()

Returns an int[] containing the indices of the local variable slots accessed by this Subroutine (read-accessed, write-accessed or both); local variables referenced by subroutines of this subroutine are included.

public Subroutine[]

Returns:

The subroutines that are directly called from this subroutine.
subSubs
()

Returns the subroutines that are directly called from this subroutine.

Method Detail

containsback to summary
public boolean contains(InstructionHandle inst)

Returns if the given InstructionHandle refers to an instruction that is part of this subroutine. This is a convenience method that saves iteration over the InstructionHandle objects returned by getInstructions().

Parameters
inst:InstructionHandle

The InstructionHandle to test.

Returns:boolean

Whether the given InstructionHandle refers to an instruction that is part of this subroutine.

See Also
getInstructions()
getAccessedLocalsIndicesback to summary
public int[] getAccessedLocalsIndices()

Returns an int[] containing the indices of the local variable slots accessed by this Subroutine (read-accessed, write-accessed or both); local variables referenced by subroutines of this subroutine are not included.

Returns:int[]

An int[] containing the indices of the local variable slots.

See Also
getRecursivelyAccessedLocalsIndices()
getEnteringJsrInstructionsback to summary
public InstructionHandle[] getEnteringJsrInstructions()

Returns all the JsrInstructions that have the first instruction of this subroutine as their target. Must not be invoked on the 'top-level subroutine'.

Returns:InstructionHandle[]

The JsrInstructions that have the first instruction of this subroutine as their target.

getInstructionsback to summary
public InstructionHandle[] getInstructions()

Returns all instructions that together form this subroutine. Note that an instruction is part of exactly one subroutine (the top-level code is considered to be a special subroutine) - else it is not reachable at all (dead code).

Returns:InstructionHandle[]

All instructions that together form this subroutine.

getLeavingRETback to summary
public InstructionHandle getLeavingRET()

Returns the one and only RET that leaves the subroutine. Note that JustIce has a pretty rigid notion of a subroutine. Must not be invoked on the 'top-level subroutine'.

Returns:InstructionHandle

The one and only RET that leaves the subroutine.

See Also
Subroutines
getRecursivelyAccessedLocalsIndicesback to summary
public int[] getRecursivelyAccessedLocalsIndices()

Returns an int[] containing the indices of the local variable slots accessed by this Subroutine (read-accessed, write-accessed or both); local variables referenced by subroutines of this subroutine are included.

Returns:int[]

An int[] containing the indices of the local variable slots.

See Also
getAccessedLocalsIndices()
subSubsback to summary
public Subroutine[] subSubs()

Returns the subroutines that are directly called from this subroutine.

Returns:Subroutine[]

The subroutines that are directly called from this subroutine.