Stack<LocalityBinding> lbstack=new Stack<LocalityBinding>();
lbstack.add(lbmain);
lbstack.add(lbrun);
- lbstack.add(lbexecute);
+
lbset.add(lbmain);
lbset.add(lbrun);
- lbset.add(lbexecute);
+
+ if(state.DSMTASK) { // when Task.java is used
+ lbstack.add(lbexecute);
+ lbset.add(lbexecute);
+ }
while(!lbstack.isEmpty()) {
LocalityBinding lb=lbstack.pop();
if (calldep.containsKey(lb)) {
methodtolb.put(lbrun.getMethod(), new HashSet<LocalityBinding>());
methodtolb.get(lbrun.getMethod()).add(lbrun);
- lbexecute = new LocalityBinding(typeutil.getExecute(), false);
- lbexecute.setGlobalReturn(EITHER);
- lbexecute.setGlobalThis(GLOBAL);
- lbtovisit.add(lbexecute);
- discovered.put(lbexecute, lbexecute);
- if (!classtolb.containsKey(lbexecute.getMethod().getClassDesc()))
- classtolb.put(lbexecute.getMethod().getClassDesc(), new HashSet<LocalityBinding>());
- classtolb.get(lbexecute.getMethod().getClassDesc()).add(lbexecute);
-
- if (!methodtolb.containsKey(lbexecute.getMethod()))
- methodtolb.put(lbexecute.getMethod(), new HashSet<LocalityBinding>());
- methodtolb.get(lbexecute.getMethod()).add(lbexecute);
+ if(state.DSMTASK) {
+ lbexecute = new LocalityBinding(typeutil.getExecute(), false);
+ lbexecute.setGlobalReturn(EITHER);
+ lbexecute.setGlobalThis(GLOBAL);
+ lbtovisit.add(lbexecute);
+ discovered.put(lbexecute, lbexecute);
+ if (!classtolb.containsKey(lbexecute.getMethod().getClassDesc()))
+ classtolb.put(lbexecute.getMethod().getClassDesc(), new HashSet<LocalityBinding>());
+ classtolb.get(lbexecute.getMethod().getClassDesc()).add(lbexecute);
+
+ if (!methodtolb.containsKey(lbexecute.getMethod()))
+ methodtolb.put(lbexecute.getMethod(), new HashSet<LocalityBinding>());
+ methodtolb.get(lbexecute.getMethod()).add(lbexecute);
+ }
while(!lbtovisit.isEmpty()) {
LocalityBinding lb=(LocalityBinding) lbtovisit.iterator().next();
methodset.addAll(runmethodset);
} else throw new Error("Can't find run method");
}
-
- if (nodemd.getClassDesc().getSymbol().equals(TypeUtil.TaskClass) &&
+
+ if(state.DSMTASK) {
+ if (nodemd.getClassDesc().getSymbol().equals(TypeUtil.TaskClass) &&
nodemd.getSymbol().equals("execution") && !nodemd.getModifiers().isStatic() &&
nodemd.numParameters() == 0) {
- assert(nodemd.getModifiers().isNative());
-
- MethodDescriptor exemd = null;
-
- for(Iterator methodit=nodemd.getClassDesc().getMethodTable().getSet("execute").iterator(); methodit.hasNext();) {
- MethodDescriptor md = (MethodDescriptor) methodit.next();
-
- if (md.numParameters() != 0 || md.getModifiers().isStatic())
- continue;
- exemd = md;
- break;
+
+ assert(nodemd.getModifiers().isNative());
+ MethodDescriptor exemd = null;
+
+ for(Iterator methodit=nodemd.getClassDesc().getMethodTable().getSet("execute").iterator(); methodit.hasNext();) {
+ MethodDescriptor md = (MethodDescriptor) methodit.next();
+
+ if (md.numParameters() != 0 || md.getModifiers().isStatic())
+ continue;
+ exemd = md;
+ break;
+ }
+
+ if (exemd != null) {
+ executemethodset = callgraph.getMethods(exemd, fc.getThis().getType());
+ methodset.addAll(executemethodset);
+ } else throw new Error("Can't find execute method");
}
-
- if (exemd != null) {
- executemethodset = callgraph.getMethods(exemd, fc.getThis().getType());
- methodset.addAll(executemethodset);
- } else throw new Error("Can't find execute method");
}
}
outstructs.println("#define MAXCOUNT "+maxcount);
if (state.DSM||state.SINGLETM) {
LocalityBinding lbrun=new LocalityBinding(typeutil.getRun(), false);
- LocalityBinding lbexecute = new LocalityBinding(typeutil.getExecute(), false);
if (state.DSM) {
lbrun.setGlobalThis(LocalityAnalysis.GLOBAL);
- lbexecute.setGlobalThis(LocalityAnalysis.GLOBAL);
}
else if (state.SINGLETM) {
lbrun.setGlobalThis(LocalityAnalysis.NORMAL);
- lbexecute.setGlobalThis(LocalityAnalysis.NORMAL);
}
- outstructs.println("#define EXECUTEMETHOD " + virtualcalls.getLocalityNumber(lbexecute));
outstructs.println("#define RUNMETHOD "+virtualcalls.getLocalityNumber(lbrun));
}
+ if (state.DSMTASK) {
+ LocalityBinding lbexecute = new LocalityBinding(typeutil.getExecute(), false);
+ if(state.DSM)
+ lbexecute.setGlobalThis(LocalityAnalysis.GLOBAL);
+ else if( state.SINGLETM)
+ lbexecute.setGlobalThis(LocalityAnalysis.NORMAL);
+ outstructs.println("#define EXECUTEMETHOD " + virtualcalls.getLocalityNumber(lbexecute));
+ }
+
outstructs.println("#define STRINGARRAYTYPE "+
(state.getArrayNumber(
(new TypeDescriptor(typeutil.getClass(TypeUtil.StringClass))).makeArray(state))+state.numClasses()));