outclassdefs.print("int numprefetchsites = " + pa.prefetchsiteid + ";\n");
if(this.state.MLP || state.OOOJAVA ){
outclassdefs.print("extern __thread int oid;\n");
- outclassdefs.print("extern int numWorkSchedWorkers;\n");
+ outclassdefs.print("extern int oidIncrement;\n");
}
Iterator it=state.getClassSymbolTable().getDescriptorsIterator();
} else if ((GENERATEPRECISEGC) || (this.state.MULTICOREGC)) {
if(this.state.MLP || state.OOOJAVA){
output.println(generateTemp(fm,fn.getDst(),lb)+"=allocate_newarray_mlp("+localsprefixaddr+", "+arrayid+", "+generateTemp(fm, fn.getSize(),lb)+", oid, "+oooa.getDisjointAnalysis().getAllocationSiteFromFlatNew(fn).getUniqueAllocSiteID()+");");
- output.println(" oid += numWorkSchedWorkers;");
+ output.println(" oid += oidIncrement;");
}else{
output.println(generateTemp(fm,fn.getDst(),lb)+"=allocate_newarray("+localsprefixaddr+", "+arrayid+", "+generateTemp(fm, fn.getSize(),lb)+");");
}
} else if ((GENERATEPRECISEGC) || (this.state.MULTICOREGC)) {
if (this.state.MLP || state.OOOJAVA){
output.println(generateTemp(fm,fn.getDst(),lb)+"=allocate_new_mlp("+localsprefixaddr+", "+fn.getType().getClassDesc().getId()+", oid, "+oooa.getDisjointAnalysis().getAllocationSiteFromFlatNew(fn).getUniqueAllocSiteID()+");");
- output.println(" oid += numWorkSchedWorkers;");
+ output.println(" oid += oidIncrement;");
} else {
output.println(generateTemp(fm,fn.getDst(),lb)+"=allocate_new("+localsprefixaddr+", "+fn.getType().getClassDesc().getId()+");");
}
const int workerID_NOTAWORKER = 0xffffff0;
+int oidIncrement;
volatile int numWorkSchedWorkers;
int realnumWorkSchedWorkers;
static WorkerData* workerDataArray;
numWorkSchedWorkers = numProcessors;
realnumWorkSchedWorkers=numProcessors;
+ oidIncrement=numProcessors;
+ while(1) {
+ int x=2;
+ //check primality
+ for(;x<oidIncrement;x++) {
+ //not prime
+ if (oidIncrement%x==0) {
+ oidIncrement++;
+ break;
+ }
+ }
+ //have prime
+ if (x==oidIncrement)
+ break;
+ }
workFunc = func;