From 407ebb3a9bb7ce10ad41f7a8532e3f8a245fa64c Mon Sep 17 00:00:00 2001 From: yeom Date: Wed, 16 Dec 2009 02:19:24 +0000 Subject: [PATCH] small change. now it works fine with regression. --- Robust/src/Analysis/MLP/MLPAnalysis.java | 137 ++++++++++++----------- 1 file changed, 70 insertions(+), 67 deletions(-) diff --git a/Robust/src/Analysis/MLP/MLPAnalysis.java b/Robust/src/Analysis/MLP/MLPAnalysis.java index 24517637..00c01c0f 100644 --- a/Robust/src/Analysis/MLP/MLPAnalysis.java +++ b/Robust/src/Analysis/MLP/MLPAnalysis.java @@ -247,74 +247,77 @@ public class MLPAnalysis { // point, in a forward fixed-point pass notAvailableForward( fm ); } - - // new pass, sese effects analysis - methItr = ownAnalysis.descriptorsToAnalyze.iterator(); - JavaCallGraph javaCallGraph = new JavaCallGraph(state,tu); - while( methItr.hasNext() ) { - Descriptor d = methItr.next(); - FlatMethod fm = state.getMethodFlat( d ); - methodEffects(fm,javaCallGraph); + + if(state.METHODEFFECTS){ + // new pass, sese effects analysis + methItr = ownAnalysis.descriptorsToAnalyze.iterator(); + JavaCallGraph javaCallGraph = new JavaCallGraph(state,tu); + while( methItr.hasNext() ) { + Descriptor d = methItr.next(); + FlatMethod fm = state.getMethodFlat( d ); + methodEffects(fm,javaCallGraph); + } + + // Parent/child memory conflicts analysis + seseConflictsForward(javaCallGraph); + + Set keySet=mapMethodContextToLiveInAllocationSiteSet.keySet(); + for (Iterator iterator = keySet.iterator(); iterator.hasNext();) { + MethodContext methodContext = (MethodContext) iterator.next(); + HashSet asSet=mapMethodContextToLiveInAllocationSiteSet.get(methodContext); + for (Iterator iterator2 = asSet.iterator(); iterator2.hasNext();) { + AllocationSite allocationSite = (AllocationSite) iterator2.next(); + } + } + + // disjoint analysis with a set of flagged allocation sites of live-in variables & stall sites + try { + ownAnalysisForSESEConflicts = new OwnershipAnalysis(state, + tu, + callGraph, + ownAnalysis.liveness, + ownAnalysis.arrayReferencees, + state.OWNERSHIPALLOCDEPTH, false, + false, state.OWNERSHIPALIASFILE, + state.METHODEFFECTS, + mapMethodContextToLiveInAllocationSiteSet); + // debug + methItr = ownAnalysisForSESEConflicts.descriptorsToAnalyze.iterator(); + while (methItr.hasNext()) { + Descriptor d = methItr.next(); + FlatMethod fm = state.getMethodFlat(d); + debugFunction(ownAnalysisForSESEConflicts, fm); + } + // + } catch (IOException e) { + System.err.println(e); + } + + // postSESEConflictsForward(javaCallGraph); + // another pass for making graph + methItr = ownAnalysis.descriptorsToAnalyze.iterator(); + while (methItr.hasNext()) { + Descriptor d = methItr.next(); + FlatMethod fm = state.getMethodFlat(d); + makeConflictGraph(fm); + } + methItr = ownAnalysis.descriptorsToAnalyze.iterator(); + while(methItr.hasNext()){ + Descriptor d = methItr.next(); + FlatMethod fm = state.getMethodFlat(d); + if (fm.toString().indexOf("SomeWork") > 0) { + ConflictGraph conflictGraph=conflictGraphResults.get(fm); + try { + conflictGraph.writeGraph("ConflictGraphForSomeWork", false); + } catch (IOException e) { + System.out.println("Error writing"); + System.exit(0); + } + } + } + //////////////// } - - // Parent/child memory conflicts analysis - seseConflictsForward(javaCallGraph); - - Set keySet=mapMethodContextToLiveInAllocationSiteSet.keySet(); - for (Iterator iterator = keySet.iterator(); iterator.hasNext();) { - MethodContext methodContext = (MethodContext) iterator.next(); - HashSet asSet=mapMethodContextToLiveInAllocationSiteSet.get(methodContext); - for (Iterator iterator2 = asSet.iterator(); iterator2.hasNext();) { - AllocationSite allocationSite = (AllocationSite) iterator2.next(); - } - } - - // disjoint analysis with a set of flagged allocation sites of live-in variables & stall sites - try { - ownAnalysisForSESEConflicts = new OwnershipAnalysis(state, - tu, - callGraph, - ownAnalysis.liveness, - ownAnalysis.arrayReferencees, - state.OWNERSHIPALLOCDEPTH, false, - false, state.OWNERSHIPALIASFILE, - state.METHODEFFECTS, - mapMethodContextToLiveInAllocationSiteSet); - // debug - methItr = ownAnalysisForSESEConflicts.descriptorsToAnalyze.iterator(); - while (methItr.hasNext()) { - Descriptor d = methItr.next(); - FlatMethod fm = state.getMethodFlat(d); - debugFunction(ownAnalysisForSESEConflicts, fm); - } - // - } catch (IOException e) { - System.err.println(e); - } - - // postSESEConflictsForward(javaCallGraph); - // another pass for making graph - methItr = ownAnalysis.descriptorsToAnalyze.iterator(); - while (methItr.hasNext()) { - Descriptor d = methItr.next(); - FlatMethod fm = state.getMethodFlat(d); - makeConflictGraph(fm); - } - methItr = ownAnalysis.descriptorsToAnalyze.iterator(); - while(methItr.hasNext()){ - Descriptor d = methItr.next(); - FlatMethod fm = state.getMethodFlat(d); - if (fm.toString().indexOf("SomeWork") > 0) { - ConflictGraph conflictGraph=conflictGraphResults.get(fm); - try { - conflictGraph.writeGraph("ConflictGraphForSomeWork", false); - } catch (IOException e) { - System.out.println("Error writing"); - System.exit(0); - } - } - } - //////////////// + // 7th pass methItr = ownAnalysis.descriptorsToAnalyze.iterator(); -- 2.34.1