From 22ac06fd2c9346ffa91dfa5b2dacb351632b750f Mon Sep 17 00:00:00 2001 From: jjenista Date: Thu, 5 Nov 2009 21:31:47 +0000 Subject: [PATCH] edge type improvement bug fixes, have to deal with null, runs on all available benchmarks --- .../OwnershipAnalysis/OwnershipGraph.java | 23 ++++++++++++++++- .../Benchmarks/mlp/directto/mlp-java/makefile | 25 ++++++++++++++++--- 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java b/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java index 6bf0fb84..9da346f7 100644 --- a/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java +++ b/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java @@ -3116,6 +3116,16 @@ public class OwnershipGraph { continue; } + if( !isSuperiorType( returnTemp.getType(), hrnChildCallee.getType() ) ) { + // prune + continue; + } + + if( !isSuperiorType( edgeCallee.getType(), hrnCaller.getType() ) ) { + // prune + continue; + } + TypeDescriptor tdNewEdge = mostSpecificType( edgeCallee.getType(), hrnChildCallee.getType(), @@ -5009,6 +5019,12 @@ public class OwnershipGraph { if( td2 == null ) { return td1; } + if( td1.isNull() ) { + return td2; + } + if( td2.isNull() ) { + return td1; + } return typeUtil.mostSpecific( td1, td2 ); } @@ -5038,7 +5054,12 @@ public class OwnershipGraph { possibleChild == null ) { return true; } - + + if( possibleSuper.isNull() || + possibleChild.isNull() ) { + return true; + } + return typeUtil.isSuperorType( possibleSuper, possibleChild ); } diff --git a/Robust/src/Benchmarks/mlp/directto/mlp-java/makefile b/Robust/src/Benchmarks/mlp/directto/mlp-java/makefile index 6892efc2..fdae38b2 100644 --- a/Robust/src/Benchmarks/mlp/directto/mlp-java/makefile +++ b/Robust/src/Benchmarks/mlp/directto/mlp-java/makefile @@ -1,10 +1,26 @@ -MAIN_CLASS=D2 #smalltest +MAIN_CLASS=D2 PROGRAM=test -SOURCE_FILES=D2.java #smalltest.java +SOURCE_FILES=D2.java BUILDSCRIPT=~/research/Robust/src/buildscript -BSFLAGS= -debug -nooptimize -mainclass $(MAIN_CLASS) -justanalyze -ownership -ownallocdepth 1 -ownwritedots final -ownaliasfile aliases.txt -enable-assertions +BSFLAGS= -debug -mainclass $(MAIN_CLASS) -joptimize -flatirusermethods #-flatirlibmethods + +#DBCALLFLAGS= -owndebugcaller main -owndebugcallee executeAll +#DBCALLFLAGS= -owndebugcaller executeAll -owndebugcallee executeMessage -owndebugcallcount 0 +#DBCALLFLAGS= -owndebugcaller executeAll -owndebugcallee next -owndebugcallcount 0 +#DBCALLFLAGS= -owndebugcaller executeAll -owndebugcallee hasNext -owndebugcallcount 0 +#DBCALLFLAGS= -owndebugcaller executeAll -owndebugcallee size -owndebugcallcount 0 +#DBCALLFLAGS= -owndebugcaller executeMessage -owndebugcallee getFlightList -owndebugcallcount 0 +#DBCALLFLAGS= -owndebugcaller executeMessage -owndebugcallee amendFlightPlan -owndebugcallcount 0 +#DBCALLFLAGS= -owndebugcaller amendFlightPlan -owndebugcallee getFlight -owndebugcallcount 0 +#DBCALLFLAGS= -owndebugcaller amendFlightPlan -owndebugcallee addFix -owndebugcallcount 0 +#DBCALLFLAGS= -owndebugcaller addFix -owndebugcallee addFix -owndebugcallcount 0 +#DBCALLFLAGS= -owndebugcaller addFix -owndebugcallee insertElementAt -owndebugcallcount 0 +#DBCALLFLAGS= -owndebugcaller insertElementAt -owndebugcallee ensureCapacity -owndebugcallcount 0 +#DBCALLFLAGS= -owndebugcaller anyPlanesAlive -owndebugcallee elementAt + +ANALYZEFLAGS= -justanalyze $(DBCALLFLAGS) -ownership -ownallocdepth 1 -ownwritedots final -ownaliasfile aliases.txt -enable-assertions all: $(PROGRAM).bin @@ -19,6 +35,9 @@ DOTs: $(PROGRAM).bin $(PROGRAM).bin: $(SOURCE_FILES) $(BUILDSCRIPT) $(BSFLAGS) -o $(PROGRAM) $(SOURCE_FILES) +analyze: $(SOURCE_FILES) + $(BUILDSCRIPT) $(BSFLAGS) $(ANALYZEFLAGS) -o $(PROGRAM) $(SOURCE_FILES) + clean: rm -f $(PROGRAM).bin rm -fr tmpbuilddirectory -- 2.34.1