|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectDynamicConstants
public class DynamicConstants
Class that implements dynamic constants optimization. This optimization doesn't instantiate invariants over constant variables (i.e., that that have only seen one value). When the variable receives a second value, invariants are instantiated and are given the sample representing the previous constant value. Each DynamicConstants object is associated with a single program point, ppt.
| Nested Class Summary | |
|---|---|
static class |
DynamicConstants.ConIndexComparator
Compares two constants based on the vi_index of their variable. |
static class |
DynamicConstants.Constant
Class used to indicate, for each variable, whether it is constant (see boolean field "constant"). |
| Field Summary | |
|---|---|
static Logger |
debug
Debug tracer. |
static boolean |
dkconfig_OneOf_only
Boolean. |
| Constructor Summary | |
|---|---|
DynamicConstants(PptTopLevel ppt)
Create an initial list of constants and missing variables for the specified ppt. |
|
| Method Summary | |
|---|---|
void |
add(ValueTuple vt,
int count)
Checks each current constant to see if it is still a constant. |
int |
constant_leader_cnt()
Returns the number of constants that are leaders. |
Object |
constant_value(VarInfo vi)
Returns the constant value of the specified variable, or null if the variable is not constant or prev_constant. |
List<PptSlice> |
create_constant_invs()
Create unary and binary constant invariants. |
DynamicConstants.Constant |
getConstant(VarInfo vi)
Returns the Constant for the specified variable. |
void |
instantiate_constant_suppressions(List<DynamicConstants.Constant> new_noncons,
List<DynamicConstants.Constant> all)
|
void |
instantiate_new_views(List<DynamicConstants.Constant> noncons,
List<DynamicConstants.Constant> non_missing)
Creates all new views required for the newly non constants (noncons) and the newly non-missing (non_missing). |
void |
instantiate_oneof(DynamicConstants.Constant con)
Creates OneOf invariants for each constant |
boolean |
is_constant(VarInfo vi)
Returns whether the specified variable is currently a constant. |
boolean |
is_missing(VarInfo vi)
Returns whether the specified variable missing for all values so far. |
boolean |
is_prev_constant(VarInfo vi)
returns whether the specified variable is currently a constant OR was a constant at the beginning of constants processing. |
boolean |
is_prev_missing(VarInfo vi)
returns whether the specified variable is currently missing OR was missing at the beginning of constants processing. |
void |
merge()
Merge dynamic constants from the children of this ppt. |
void |
post_process()
Create invariants for any remaining constants. |
void |
print_missing(PrintWriter out)
|
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static boolean dkconfig_OneOf_only
public static final Logger debug
| Constructor Detail |
|---|
public DynamicConstants(PptTopLevel ppt)
| Method Detail |
|---|
public void add(ValueTuple vt,
int count)
public DynamicConstants.Constant getConstant(VarInfo vi)
public boolean is_constant(VarInfo vi)
public boolean is_prev_constant(VarInfo vi)
public Object constant_value(VarInfo vi)
public boolean is_missing(VarInfo vi)
public boolean is_prev_missing(VarInfo vi)
public int constant_leader_cnt()
public void instantiate_new_views(List<DynamicConstants.Constant> noncons,
List<DynamicConstants.Constant> non_missing)
public void instantiate_constant_suppressions(List<DynamicConstants.Constant> new_noncons,
List<DynamicConstants.Constant> all)
public void post_process()
public List<PptSlice> create_constant_invs()
public void print_missing(PrintWriter out)
public void merge()
public void instantiate_oneof(DynamicConstants.Constant con)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||