edu.uci.eecs.doc.clepsydra.loop
Class AnnotationLoopBoundStrategy
java.lang.Object
edu.uci.eecs.doc.clepsydra.loop.AnnotationLoopBoundStrategy
- All Implemented Interfaces:
- LoopBoundStrategy
public class AnnotationLoopBoundStrategy
- extends Object
- implements LoopBoundStrategy
This strategy determines the maximum number of iterations of a loop by reading
annotation data that has been inserted manually by the author of the loop. The
annotation is assumed to be of type
edu.uci.eecs.doc.clepsydra.loop.LoopBound
and stored in the
RuntimeInvisibleStatementAnnotations
attribute in the loop's class
file.
For more information, see the JSR-308
Statements document and Toward a Unified Standard for Worst-Case
Execution Time Annotations in Real-Time Java by Trevor Harmon and Raymond
Klefstad.
- Author:
- Trevor Harmon
- See Also:
LoopBound
Method Summary |
int |
getBound(Loop loop)
Determines the maximum number of iterations for the loop (for, while, or
do-while) located at the given bytecode address. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AnnotationLoopBoundStrategy
public AnnotationLoopBoundStrategy()
- Creates a new AnnotationLoopBoundStrategy object.
getBound
public int getBound(Loop loop)
throws UnknownLoopBoundException
- Determines the maximum number of iterations for the loop (for, while, or
do-while) located at the given bytecode address.
- Specified by:
getBound
in interface LoopBoundStrategy
- Parameters:
loop
- the loop node whose bound is to be determined
- Returns:
- the maximum number of iterations of the loop
- Throws:
UnknownLoopBoundException
- if the loop bound cannot be determined