From 74c93a66056bf465f6bbb3a166c76a37c1c8ad76 Mon Sep 17 00:00:00 2001 From: yeom Date: Tue, 13 Oct 2009 00:04:32 +0000 Subject: [PATCH] changes. --- Robust/src/Analysis/MLP/MLPAnalysis.java | 78 +++++++++++++----------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/Robust/src/Analysis/MLP/MLPAnalysis.java b/Robust/src/Analysis/MLP/MLPAnalysis.java index 8b79cd9c..227354ab 100644 --- a/Robust/src/Analysis/MLP/MLPAnalysis.java +++ b/Robust/src/Analysis/MLP/MLPAnalysis.java @@ -938,54 +938,58 @@ public class MLPAnalysis { case FKind.FlatCall: { FlatCall fc = (FlatCall) fn; + + if(fc.numArgs()>0){ + MethodContext calleeMCfromOG = ownAnalysis.getCalleeMethodContext( + callerMC, fc); - MethodContext calleeMCfromOG = ownAnalysis.getCalleeMethodContext( - callerMC, fc); - - // disable below condition. currently collect all possible - // allocation sites without regarding method context - - // if (calleeMC.equals(calleeMCfromOG)) { // in this case, this - // method context calls corresponding callee. + // disable below condition. currently collect all possible + // allocation sites without regarding method context - int base; - if (((MethodDescriptor) calleeMC.getDescriptor()).isStatic()) { - base = 0; - } else { - base = 1; - } + // if (calleeMC.equals(calleeMCfromOG)) { // in this case, this + // method context calls corresponding callee. - for (Iterator iterator = paramIndexSet.iterator(); iterator - .hasNext();) { - Integer integer = (Integer) iterator.next(); + int base; + if (((MethodDescriptor) calleeMC.getDescriptor()).isStatic()) { + base = 0; + } else { + base = 1; + } - int paramIdx = integer - base; - if (paramIdx >= 0) { - // if paramIdx is less than 0, assumes that it is - // related with wrong method contexts. - TempDescriptor arg = fc.getArg(paramIdx); - LabelNode argLN = og.td2ln.get(arg); - if (argLN != null) { - Iterator iterEdge = argLN - .iteratorToReferencees(); - while (iterEdge.hasNext()) { - ReferenceEdge referenceEdge = (ReferenceEdge) iterEdge - .next(); + for (Iterator iterator = paramIndexSet.iterator(); iterator + .hasNext();) { + Integer integer = (Integer) iterator.next(); + + int paramIdx = integer - base; + if (paramIdx >= 0) { + // if paramIdx is less than 0, assumes that it is + // related with wrong method contexts. + TempDescriptor arg = fc.getArg(paramIdx); + LabelNode argLN = og.td2ln.get(arg); + if (argLN != null) { + Iterator iterEdge = argLN + .iteratorToReferencees(); + while (iterEdge.hasNext()) { + ReferenceEdge referenceEdge = (ReferenceEdge) iterEdge + .next(); - HeapRegionNode dstHRN = referenceEdge.getDst(); - if (dstHRN.isParameter()) { - if (!visitedHRN.contains(dstHRN)) { - setupRelatedAllocSiteAnalysis(og, callerMC, - dstHRN, visitedHRN); + HeapRegionNode dstHRN = referenceEdge.getDst(); + if (dstHRN.isParameter()) { + if (!visitedHRN.contains(dstHRN)) { + setupRelatedAllocSiteAnalysis(og, callerMC, + dstHRN, visitedHRN); + } + } else { + addLiveInAllocationSite(callerMC, dstHRN + .getAllocationSite()); } - } else { - addLiveInAllocationSite(callerMC, dstHRN - .getAllocationSite()); } } } } } + + // } } -- 2.34.1