|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.dms.kjc.sir.SIRDynamicRateManager
public class SIRDynamicRateManager
This class governs how dynamic rates are interpreted at a given point in the compiler. The idea is that compiler passes sometimes want to view dynamic rates in different ways -- for example, treating a dynamic rate as a fixed constant, as an upper bound, or as an exceptional case. This class basically encapsulates a dynamic variable, which indicates the current policy for interpreting dynamic rates everywhere in the compiler. The methods should be called (for example) from the main backend passes to specify how all dynamic rates should be interpreted for a given portion of the compiler. To make the calling convention more natural, the class exposes a stack paradigm where a stack of policies is maintained. The top-most element of the stack is always used for interpreting rates. One can change the policy by pushing on a new policy, or by popping off the old policy.
Constructor Summary | |
---|---|
SIRDynamicRateManager()
|
Method Summary | |
---|---|
static JExpression |
interpretRate(JExpression rate)
For use by the rate-determining functions of the compiler. |
static void |
popPolicy()
Pops a policy off the stack. |
static void |
pushConstantPolicy(int constant)
Sets the current policy to a constant policy (returns a given |
static void |
pushIdentityPolicy()
Sets the current policy to an identity policy (which returns all rates unaltered). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SIRDynamicRateManager()
Method Detail |
---|
public static JExpression interpretRate(JExpression rate)
public static void pushIdentityPolicy()
public static void pushConstantPolicy(int constant)
public static void popPolicy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |