} else if (type.equals(GLOBAL)) {
if (!transaction)
throw new Error("Global access outside of a transaction in context:\n"+lb.getExplanation());
- if (ffn.getField().getType().isPrimitive())
+ if (ffn.getField().getType().isPrimitive()&&!ffn.getField().getType().isArray())
currtable.put(dst, LOCAL); // primitives are local
else
currtable.put(dst, GLOBAL);
} else if (type.equals(EITHER)) {
- if (ffn.getField().getType().isPrimitive())
+ if (ffn.getField().getType().isPrimitive()&&!ffn.getField().getType().isArray())
currtable.put(dst, LOCAL); // primitives are local
else if (ffn.getField().isGlobal())
currtable.put(dst, GLOBAL);
void processSetFieldNode(LocalityBinding lb, FlatSetFieldNode fsfn, boolean transaction, Hashtable<TempDescriptor, Integer> currtable) {
Integer srctype=currtable.get(fsfn.getSrc());
Integer dsttype=currtable.get(fsfn.getDst());
-
+
if (dsttype.equals(LOCAL)) {
if (fsfn.getField().isGlobal()) {
if (!(srctype.equals(GLOBAL)||srctype.equals(EITHER)))
if (!transaction)
throw new Error("Global access outside of a transaction in context:\n"+lb.getExplanation());
//okay to store primitives in global object
- if (srctype.equals(LOCAL) && fsfn.getField().getType().isPrimitive())
+ if (srctype.equals(LOCAL) && fsfn.getField().getType().isPrimitive() && ! fsfn.getField().getType().isArray())
return;
if (!(srctype.equals(GLOBAL)||srctype.equals(EITHER)))
throw new Error("Writing possible local reference to global object in context:\n"+lb.getExplanation()+" for FlatFieldNode "+fsfn);
public String toString() {
String st=md.toString()+" ";
+ if (isglobalthis==null) {
+ st+="[static] ";
+ } else {
+ if (isglobalthis.equals(LocalityAnalysis.LOCAL))
+ st+="[local] ";
+ else if (isglobalthis.equals(LocalityAnalysis.GLOBAL))
+ st+="[global] ";
+ else if (isglobalthis.equals(LocalityAnalysis.EITHER))
+ st+="[either] ";
+ else if (isglobalthis.equals(LocalityAnalysis.CONFLICT))
+ st+="[conflict] ";
+ }
for(int i=0;i<isglobal.length;i++)
if (isglobal[i].equals(LocalityAnalysis.LOCAL))
st+="local ";