From bc5be4d1d65be3f4564fcdc675f8b332553ce243 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Mon, 15 Jun 2009 23:49:31 +0000 Subject: [PATCH] changes --- Robust/src/IR/Flat/BuildCode.java | 11 +++++++++++ Robust/src/IR/State.java | 1 + Robust/src/IR/Tree/SemanticCheck.java | 9 ++++++--- Robust/src/IR/TypeDescriptor.java | 2 +- Robust/src/Main/Main.java | 4 +++- 5 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index 10845a51..0df10c51 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -19,9 +19,11 @@ import Analysis.TaskStateAnalysis.TaskIndex; import Analysis.Locality.LocalityAnalysis; import Analysis.Locality.LocalityBinding; import Analysis.Locality.DiscoverConflicts; +import Analysis.Locality.DelayComputation; import Analysis.CallGraph.CallGraph; import Analysis.Prefetch.*; import Analysis.Loops.WriteBarrier; +import Analysis.Loops.GlobalFieldType; import Analysis.Locality.TypeAnalysis; import Analysis.MLP.MLPAnalysis; @@ -62,6 +64,7 @@ public class BuildCode { boolean nonSESEpass=true; WriteBarrier wb; DiscoverConflicts dc; + DelayComputation delaycomp; CallGraph callgraph; public BuildCode(State st, Hashtable temptovar, TypeUtil typeutil, SafetyAnalysis sa, PrefetchAnalysis pa) { @@ -102,6 +105,14 @@ public class BuildCode { this.dc=new DiscoverConflicts(locality, st, typeanalysis); dc.doAnalysis(); } + if (state.SINGLETM&&state.DELAYCOMP) { + TypeAnalysis typeanalysis=new TypeAnalysis(locality, st, typeutil,callgraph); + GlobalFieldType gft=new GlobalFieldType(callgraph, st, typeutil.getMain()); + delaycomp=new DelayComputation(locality, st, typeanalysis, gft); + delaycomp.doAnalysis(); + } + + if(state.MLP) { sese2bogusFlatMeth = new Hashtable(); } diff --git a/Robust/src/IR/State.java b/Robust/src/IR/State.java index 011a1756..e739dd88 100644 --- a/Robust/src/IR/State.java +++ b/Robust/src/IR/State.java @@ -101,6 +101,7 @@ public class State { private int arraycount=0; public boolean OPTIMIZE=false; public boolean DCOPTS=false; + public boolean DELAYCOMP=false; private Hashtable> optionaltaskdescriptors; diff --git a/Robust/src/IR/Tree/SemanticCheck.java b/Robust/src/IR/Tree/SemanticCheck.java index 389fc208..731ffd4a 100644 --- a/Robust/src/IR/Tree/SemanticCheck.java +++ b/Robust/src/IR/Tree/SemanticCheck.java @@ -524,7 +524,6 @@ public class SemanticCheck { checkExpressionNode(md,nametable,aan.getIndex(),new TypeDescriptor(TypeDescriptor.INT)); TypeDescriptor ltd=left.getType(); - if (ltd.dereference().iswrapper()) { aan.wrappertype=((FieldDescriptor)ltd.dereference().getClassDesc().getFieldTable().get("value")).getType(); } @@ -1042,8 +1041,12 @@ NextMethod: case Operation.GTE: // 5.6.2 Binary Numeric Promotion //TODO unboxing of reference objects - if (!ltd.isNumber()||!rtd.isNumber()) - throw new Error(); + if (!ltd.isNumber()||!rtd.isNumber()) { + if (!ltd.isNumber()) + throw new Error("Leftside is not number"+on.printNode(0)+"type="+ltd.toPrettyString()); + if (!rtd.isNumber()) + throw new Error("Rightside is not number"+on.printNode(0)); + } if (ltd.isDouble()||rtd.isDouble()) lefttype=new TypeDescriptor(TypeDescriptor.DOUBLE); diff --git a/Robust/src/IR/TypeDescriptor.java b/Robust/src/IR/TypeDescriptor.java index 4ee68570..7725f610 100644 --- a/Robust/src/IR/TypeDescriptor.java +++ b/Robust/src/IR/TypeDescriptor.java @@ -58,7 +58,7 @@ public class TypeDescriptor extends Descriptor { } public boolean iswrapper() { - if (arraycount!=0||isClass()) + if (arraycount!=0||!isClass()) return false; return (name.equals("bytewrapper")|| name.equals("booleanwrapper")|| diff --git a/Robust/src/Main/Main.java b/Robust/src/Main/Main.java index 45625edf..a2ae4294 100644 --- a/Robust/src/Main/Main.java +++ b/Robust/src/Main/Main.java @@ -135,7 +135,9 @@ public class Main { state.OPTIMIZE=true; else if (option.equals("-dcopts")) state.DCOPTS=true; - else if (option.equals("-raw")) + else if (option.equals("-delaycomp")) + state.DELAYCOMP=true; + else if (option.equals("-raw")) state.RAW=true; else if (option.equals("-scheduling")) state.SCHEDULING=true; -- 2.34.1