import java.util.Hashtable;
import java.util.Set;
import java.util.Vector;
+import java.util.Iterator;
+import java.util.Collection;
import Analysis.MLP.SESEEffectsKey;
import Analysis.MLP.SESEEffectsSet;
protected Integer oldestAgeToTrack;
protected boolean isCallerSESEplaceholder;
+ protected static final int ISLEAF_UNINIT = 1;
+ protected static final int ISLEAF_FALSE = 2;
+ protected static final int ISLEAF_TRUE = 3;
+ protected int isLeafSESE;
+
protected Set<FlatSESEEnterNode> children;
- protected Set<TempDescriptor> inVars;
+ protected Vector<TempDescriptor> inVars;
protected Set<TempDescriptor> outVars;
protected Set<SESEandAgePair> needStaticNameInCode;
private SESEEffectsSet seseEffectsSet;
+ // a subset of the in-set variables that shouuld be traversed during
+ // the dynamic coarse grained conflict strategy, remember them here so
+ // buildcode can be dumb and just gen the traversals
+ protected Set<TempDescriptor> inVarsForDynamicCoarseConflictResolution;
// scope info for this SESE
protected FlatMethod fmEnclosing;
oldestAgeToTrack = new Integer( 0 );
children = new HashSet<FlatSESEEnterNode>();
- inVars = new HashSet<TempDescriptor>();
+ inVars = new Vector<TempDescriptor>();
outVars = new HashSet<TempDescriptor>();
needStaticNameInCode = new HashSet<SESEandAgePair>();
staticInVarSrcs = new HashSet<SESEandAgePair>();
dynamicInVars = new HashSet<TempDescriptor>();
dynamicVars = new HashSet<TempDescriptor>();
+ inVarsForDynamicCoarseConflictResolution = new HashSet<TempDescriptor>();
+
staticInVar2src = new Hashtable<TempDescriptor, VariableSourceToken>();
seseEffectsSet = new SESEEffectsSet();
isCallerSESEplaceholder = false;
+ isLeafSESE = ISLEAF_UNINIT;
+
firstDepRecField = null;
numDepRecs = 0;
}
}
public void addInVar( TempDescriptor td ) {
- inVars.add( td );
+ if (!inVars.contains(td))
+ inVars.add( td );
}
public void addOutVar( TempDescriptor td ) {
}
public void addInVarSet( Set<TempDescriptor> s ) {
- inVars.addAll( s );
+ for(Iterator<TempDescriptor> sit=s.iterator();sit.hasNext();) {
+ TempDescriptor tmp=sit.next();
+ if (!inVars.contains(tmp))
+ inVars.add(tmp);
+ }
}
public void addOutVarSet( Set<TempDescriptor> s ) {
outVars.addAll( s );
}
- public Set<TempDescriptor> getInVarSet() {
+ public Collection<TempDescriptor> getInVarSet() {
+ return inVars;
+ }
+
+ public Vector<TempDescriptor> getInVarVector() {
return inVars;
}
public int getNumDepRecs() {
return numDepRecs;
}
+
+ public Set<TempDescriptor> getInVarsForDynamicCoarseConflictResolution() {
+ return inVarsForDynamicCoarseConflictResolution;
+ }
+
+ public void addInVarForDynamicCoarseConflictResolution(TempDescriptor inVar) {
+ inVarsForDynamicCoarseConflictResolution.add(inVar);
+ }
+
+
+ public void setIsLeafSESE( boolean isLeaf ) {
+ if( isLeaf ) {
+ isLeafSESE = ISLEAF_TRUE;
+ } else {
+ isLeafSESE = ISLEAF_FALSE;
+ }
+ }
+
+ public boolean getIsLeafSESE() {
+ if( isLeafSESE == ISLEAF_UNINIT ) {
+ throw new Error( "isLeafSESE uninitialized" );
+ }
+
+ return isLeafSESE == ISLEAF_TRUE;
+ }
}