EffectsAnalysis effectsAnalysis;
Accessible accessible;
- public Pointer(State state, TypeUtil typeUtil, CallGraph callGraph, RBlockRelationAnalysis taskAnalysis, Liveness liveness) {
+ public Pointer(State state, TypeUtil typeUtil, CallGraph callGraph, RBlockRelationAnalysis taskAnalysis, Liveness liveness, BuildStateMachines bsm) {
this(state, typeUtil);
this.callGraph=callGraph;
this.OoOJava=true;
this.taskAnalysis=taskAnalysis;
this.effectsAnalysis=new EffectsAnalysis();
effectsAnalysis.state=state;
- effectsAnalysis.buildStateMachines=new BuildStateMachines();
+ effectsAnalysis.buildStateMachines=bsm;
accessible=new Accessible(state, callGraph, taskAnalysis, liveness);
accessible.doAnalysis();
State.logEvent("Done Writing Accessible Analysis");
flatname = fn.toString();
}
- return "traverse___" + invar.getSafeSymbol() +
- removeInvalidChars(flatname) + "___("+varString+");";
+ return "traverse___" + invar.getSafeSymbol() + removeInvalidChars(flatname) + "___("+varString+");";
}
public String removeInvalidChars(String in) {
}
private void printMasterTraverserInvocation() {
- headerFile.println("\nint tasktraverse(SESEcommon * record);");
- cFile.println("\nint tasktraverse(SESEcommon * record) {");
+ headerFile.println("int tasktraverse(SESEcommon * record);");
+ cFile.println("int tasktraverse(SESEcommon * record) {");
cFile.println(" if(!CAS(&record->rcrstatus,1,2)) {");
//release traverser reference...no traversal necessary
for(int i=0;i<invars.size();i++) {
TempDescriptor tmp=invars.get(i);
- // TODO: Blame this on Jim.
- // what is a conflict node that is valid to prune? Prune what?
- // is it a conflict for which the traverser is never invoked?
- // let's assume NOTHING is valid to prune in order to get the system
- // running again.
- boolean isValidToPrune = false;
-
- // Jim again: this is what we might want to do...
- //boolean isValidToPrune = true;
- //for( FlatSESEEnterNode parentSESE: fsen.getParents() ) {
- // ConflictGraph graph = oooa.getConflictGraph(parentSESE);
- // String id = tmp + "_sese" + fsen.getPrettyIdentifier();
- // ConflictNode node = graph.getId2cn().get(id);
- //
- // isValidToPrune &= node.IsValidToPrune();
- //}
-
- if (i!=0) {
- cFile.println(" if (record->rcrstatus!=0)");
- }
-
- if(globalState.NOSTALLTR && isValidToPrune){
- cFile.println(" // " + this.getTraverserInvocation(tmp, "rec->"+tmp+", rec", fsen));
- }else{
- cFile.println(" " + this.getTraverserInvocation(tmp, "rec->"+tmp+", rec", fsen));
- }
+ /* In some cases we don't want to a dynamic traversal if it is
+ * unlikely to increase parallelism...these are cases where we
+ * are just enabling a stall site to possible clear faster*/
+
+ boolean isValidToPrune=true;
+ for( FlatSESEEnterNode parentSESE: fsen.getParents() ) {
+ ConflictGraph graph = oooa.getConflictGraph(parentSESE);
+ String id = tmp + "_sese" + fsen.getPrettyIdentifier();
+ ConflictNode node = graph.getId2cn().get(id);
+ isValidToPrune &= node.IsValidToPrune();
+ }
+ if (i!=0) {
+ cFile.println(" if (record->rcrstatus!=0)");
+ }
+
+ if(globalState.NOSTALLTR && isValidToPrune) {
+ cFile.println(" /* " + getTraverserInvocation(tmp, "rec->"+tmp+", rec", fsen)+"*/");
+ } else {
+ cFile.println(" " + getTraverserInvocation(tmp, "rec->"+tmp+", rec", fsen));
+ }
}
//release traverser reference...traversal finished...
//executing thread will clean bins for us
cFile.println( " case -" + getTraverserID(var, stallsite)+ ": {");
cFile.println( " SESEstall * rec=(SESEstall*) record;");
- cFile.println( " " + this.getTraverserInvocation(var, "rec->___obj___, rec", stallsite)+";");
+ cFile.println( " " + getTraverserInvocation(var, "rec->___obj___, rec", stallsite)+";");
cFile.println( " record->rcrstatus=0;");
cFile.println( " }");
cFile.println(" break;");
}
- cFile.println(" default:\n printf(\"Invalid SESE ID was passed in: %d.\\n\",record->classID);\n break;");
+ cFile.println(" default:");
+ cFile.println(" printf(\"Invalid SESE ID was passed in: %d.\\n\",record->classID);");
+ cFile.println(" break;");
cFile.println(" }");
cFile.println("}");
}