From: yeom Date: Tue, 6 Apr 2010 02:24:26 +0000 (+0000) Subject: bug fix. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7e464a36094642b65d9fc33ffd20730557814207;p=IRC.git bug fix. --- diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index a38b7a10..a5c4c9e3 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -3398,49 +3398,73 @@ public class BuildCode { graph = mlpa.getConflictGraphResults().get(parent); } } - if (graph != null && graph.hasConflictEdge()) { - HashSet seseLockSet = mlpa.getConflictGraphLockMap().get( - graph); - output.println(); - output.println(" //add memory queue element"); - Set waitingQueueSet = graph - .getWaitingElementSetBySESEID(fsen.getIdentifier(), - seseLockSet); - if (waitingQueueSet.size() > 0) { - output.println(" {"); - output.println(" REntry* rentry=NULL;"); - output.println(" seseToIssue->common.rentryIdx=0;"); - for (Iterator iterator = waitingQueueSet.iterator(); iterator - .hasNext();) { - WaitingElement waitingElement = (WaitingElement) iterator - .next(); - - if( waitingElement.getStatus() >= ConflictNode.COARSE ){ - output.println(" rentry=mlpCreateREntry("+ waitingElement.getStatus()+ ", seseToIssue);"); - }else{ - TempDescriptor td=waitingElement.getTempDesc(); - VariableSourceToken vst=fsen.getStaticInVarSrc(td); - String srcId="SESE_"+vst.getSESE().getPrettyIdentifier()+vst.getSESE().getIdentifier()+"_"+vst.getAge(); - output.println(" rentry=mlpCreateFineREntry("+ waitingElement.getStatus()+ ", seseToIssue, seseToIssue->"+ waitingElement.getDynID() + ");"); - output.println(" if(seseToIssue->"+ waitingElement.getDynID()+" == NULL) {"); - output.println(" rentry->pointer=(void*)&seseToIssue->"+srcId+"->"+waitingElement.getDynID()+";"); - output.println(" seseToIssue->common.unresolvedRentryArray[seseToIssue->common.unresolvedRentryIdx++]=rentry;"); - output.println(" }"); - } - output.println(" rentry->queue=parentCommon->memoryQueueArray["+ waitingElement.getQueueID()+ "];"); - output.println(" seseToIssue->common.rentryArray[seseToIssue->common.rentryIdx++]=rentry;"); - output - .println(" if(ADDRENTRY(parentCommon->memoryQueueArray[" - + waitingElement.getQueueID() - + "],rentry)==NOTREADY){"); - output.println(" ++(localCount);"); - output.println(" } "); - output.println(); - } - output.println(" }"); - } - output.println(); - } + if (graph != null && graph.hasConflictEdge()) { + HashSet seseLockSet = mlpa.getConflictGraphLockMap() + .get(graph); + output.println(); + output.println(" //add memory queue element"); + Set waitingQueueSet = graph + .getWaitingElementSetBySESEID(fsen.getIdentifier(), + seseLockSet); + if (waitingQueueSet.size() > 0) { + output.println(" {"); + output.println(" REntry* rentry=NULL;"); + output.println(" seseToIssue->common.rentryIdx=0;"); + for (Iterator iterator = waitingQueueSet.iterator(); iterator + .hasNext();) { + WaitingElement waitingElement = (WaitingElement) iterator + .next(); + + if (waitingElement.getStatus() >= ConflictNode.COARSE) { + output.println(" rentry=mlpCreateREntry(" + + waitingElement.getStatus() + + ", seseToIssue);"); + } else { + TempDescriptor td = waitingElement.getTempDesc(); + if (td != null) { + VariableSourceToken vst = fsen + .getStaticInVarSrc(td); + String srcId = "SESE_" + + vst.getSESE().getPrettyIdentifier() + + vst.getSESE().getIdentifier() + "_" + + vst.getAge(); + output + .println(" rentry=mlpCreateFineREntry(" + + waitingElement.getStatus() + + ", seseToIssue, seseToIssue->" + + waitingElement.getDynID() + + ");"); + output.println(" if(seseToIssue->" + + waitingElement.getDynID() + + " == NULL) {"); + output + .println(" rentry->pointer=(void*)&seseToIssue->" + + srcId + + "->" + + waitingElement.getDynID() + + ";"); + output + .println(" seseToIssue->common.unresolvedRentryArray[seseToIssue->common.unresolvedRentryIdx++]=rentry;"); + output.println(" }"); + } + } + output + .println(" rentry->queue=parentCommon->memoryQueueArray[" + + waitingElement.getQueueID() + "];"); + output + .println(" seseToIssue->common.rentryArray[seseToIssue->common.rentryIdx++]=rentry;"); + output + .println(" if(ADDRENTRY(parentCommon->memoryQueueArray[" + + waitingElement.getQueueID() + + "],rentry)==NOTREADY){"); + output.println(" ++(localCount);"); + output.println(" } "); + output.println(); + } + output.println(" }"); + } + output.println(); + } ////////////////