protected Vector<Integer> ithOldest;
protected Integer summary;
protected FlatNew flatNew;
- protected boolean forceAnalyze;
+ protected String disjointId;
public static final int AGE_notInThisSite = 100;
public static final int AGE_in_I = 101;
public static final int SHADOWAGE_summary = -103;
- public AllocationSite(int allocationDepth, FlatNew flatNew, boolean forceAnalyze) {
+ public AllocationSite(int allocationDepth, FlatNew flatNew, String disjointId) {
assert allocationDepth >= 1;
this.allocationDepth = allocationDepth;
this.flatNew = flatNew;
- this.forceAnalyze = forceAnalyze;
+ this.disjointId = disjointId;
ithOldest = new Vector<Integer>(allocationDepth);
id = generateUniqueAllocationSiteID();
}
- public boolean doForceAnalyze() {
- return forceAnalyze;
+ public String getDisjointId() {
+ return disjointId;
}
public String toStringVerbose() {
return "allocSite" + id + " "+flatNew.getType().toPrettyString();
}
+
+ public String toStringForDOT() {
+ return "disjoint "+disjointId+"\\n"+toString()+"\\n"+getType();
+ }
}
private AllocationSite getAllocationSiteFromFlatNewPRIVATE(FlatNew fn) {
if( !mapFlatNewToAllocationSite.containsKey(fn) ) {
- AllocationSite as = new AllocationSite(allocationDepth, fn, fn.isDisjoint());
+ AllocationSite as = new AllocationSite(allocationDepth, fn, fn.getDisjointId());
// the newest nodes are single objects
for( int i = 0; i < allocationDepth; ++i ) {
boolean markForAnalysis = isFlagged || isParameter;
- if( allocSite != null && allocSite.doForceAnalyze() ) {
+ if( allocSite != null && allocSite.getDisjointId() != null ) {
markForAnalysis = true;
}
false,
as,
null,
- as + "\\n" + as.getType() + "\\nsummary");
+ as.toStringForDOT() + "\\nsummary");
for( int i = 0; i < as.getAllocationDepth(); ++i ) {
Integer idIth = as.getIthOldest(i);
false,
as,
null,
- as + "\\n" + as.getType() + "\\n" + i + " oldest");
+ as.toStringForDOT() + "\\n" + i + " oldest");
}
}
private NodePair flattenCreateObjectNode(CreateObjectNode con,TempDescriptor out_temp) {
TypeDescriptor td=con.getType();
if (!td.isArray()) {
- FlatNew fn=new FlatNew(td, out_temp, con.isGlobal(), con.isDisjoint());
+ FlatNew fn=new FlatNew(td, out_temp, con.isGlobal(), con.getDisjointId());
TempDescriptor[] temps=new TempDescriptor[con.numArgs()];
FlatNode last=fn;
// Build arguments
out_temp :
TempDescriptor.tempFactory("arg",en.getType());
}
- FlatNew fn=new FlatNew(td, out_temp, temps[0], con.isGlobal(), con.isDisjoint());
+ FlatNew fn=new FlatNew(td, out_temp, temps[0], con.isGlobal(), con.getDisjointId());
last.addNext(fn);
if (temps.length>1) {
NodePair np=generateNewArrayLoop(temps, td.dereference(), out_temp, 0, con.isGlobal());
TypeDescriptor type;
TempDescriptor size;
boolean isglobal;
- boolean isdisjoint;
+ String disjointId;
public FlatNew(TypeDescriptor type, TempDescriptor dst, boolean isglobal) {
this.type=type;
this.dst=dst;
this.size=null;
this.isglobal=isglobal;
- this.isdisjoint=false;
+ this.disjointId=null;
}
- public FlatNew(TypeDescriptor type, TempDescriptor dst, boolean isglobal, boolean isdisjoint) {
+ public FlatNew(TypeDescriptor type, TempDescriptor dst, boolean isglobal, String disjointId) {
this.type=type;
this.dst=dst;
this.size=null;
this.isglobal=isglobal;
- this.isdisjoint=isdisjoint;
+ this.disjointId=disjointId;
}
public FlatNew(TypeDescriptor type, TempDescriptor dst, TempDescriptor size, boolean isglobal) {
this.dst=dst;
this.size=size;
this.isglobal=isglobal;
- this.isdisjoint=false;
+ this.disjointId=null;
}
- public FlatNew(TypeDescriptor type, TempDescriptor dst, TempDescriptor size, boolean isglobal, boolean isdisjoint) {
+ public FlatNew(TypeDescriptor type, TempDescriptor dst, TempDescriptor size, boolean isglobal, String disjointId) {
this.type=type;
this.dst=dst;
this.size=size;
this.isglobal=isglobal;
- this.isdisjoint=isdisjoint;
+ this.disjointId=disjointId;
}
public boolean isGlobal() {
return isglobal;
}
- public boolean isDisjoint() {
- return isdisjoint;
+ public String getDisjointId() {
+ return disjointId;
}
public String toString() {
TypeDescriptor td=parseTypeDescriptor(pn);
Vector args=parseArgumentList(pn);
boolean isglobal=pn.getChild("global")!=null;
- boolean isdisjoint=pn.getChild("disjoint")!=null;
- CreateObjectNode con=new CreateObjectNode(td, isglobal, isdisjoint);
+ String disjointId=null;
+ if( pn.getChild("disjoint") != null) {
+ disjointId = pn.getChild("disjoint").getTerminal();
+ }
+ CreateObjectNode con=new CreateObjectNode(td, isglobal, disjointId);
for(int i=0; i<args.size(); i++) {
con.addArgument((ExpressionNode)args.get(i));
}
} else if (isNode(pn,"createarray")) {
//System.out.println(pn.PPrint(3,true));
boolean isglobal=pn.getChild("global")!=null;
- boolean isdisjoint=pn.getChild("disjoint")!=null;
+ String disjointId=null;
+ if( pn.getChild("disjoint") != null) {
+ disjointId = pn.getChild("disjoint").getTerminal();
+ }
TypeDescriptor td=parseTypeDescriptor(pn);
Vector args=parseDimExprs(pn);
int num=0;
num=((Integer)pn.getChild("dims_opt").getLiteral()).intValue();
for(int i=0; i<(args.size()+num); i++)
td=td.makeArray(state);
- CreateObjectNode con=new CreateObjectNode(td, isglobal, isdisjoint);
+ CreateObjectNode con=new CreateObjectNode(td, isglobal, disjointId);
for(int i=0; i<args.size(); i++) {
con.addArgument((ExpressionNode)args.get(i));
}
MethodDescriptor md;
FlagEffects fe;
boolean isglobal;
- boolean isdisjoint;
+ String disjointId;
- public CreateObjectNode(TypeDescriptor type, boolean isglobal, boolean isdisjoint) {
+ public CreateObjectNode(TypeDescriptor type, boolean isglobal, String disjointId) {
td=type;
argumentlist=new Vector();
this.isglobal=isglobal;
- this.isdisjoint=isdisjoint;
+ this.disjointId=disjointId;
}
public boolean isGlobal() {
return isglobal;
}
- public boolean isDisjoint() {
- return isdisjoint;
+ public String getDisjointId() {
+ return disjointId;
}
public void addFlagEffects(FlagEffects fe) {
pn.addChild(type);
pn.addChild(args);
pn.addChild(feo);
- pn.addChild("disjoint");
- pn.addChild(id);
+ pn.addChild("disjoint").addChild(id);
RESULT=pn;
:}
| NEW class_or_interface_type:type LPAREN argument_list_opt:args RPAREN LBRACE RBRACE LBRACE tag_list:tl RBRACE {:
pn.addChild(type);
pn.addChild(dimexpr);
pn.addChild("dims_opt").setLiteral(dims);
- pn.addChild("disjoint");
- pn.addChild(id);
+ pn.addChild("disjoint").addChild(id);
RESULT=pn;
:}
| GLOBAL NEW class_or_interface_type:type dim_exprs:dimexpr dims_opt:dims {:
pn.addChild(type);
pn.addChild(dimexpr);
pn.addChild("dims_opt").setLiteral(dims);
- pn.addChild("disjoint");
- pn.addChild(id);
+ pn.addChild("disjoint").addChild(id);
RESULT=pn;
:}
;