change in the multicore version runtime. now it is able to choose which cores to...
[IRC.git] / Robust / src / Main / Main.java
index 776542382c48d8f87f36e6b8aefff2f7f5126aa0..748c0027fa06bdfcf33a21ecfae53e671574d0e8 100644 (file)
@@ -41,9 +41,11 @@ import Analysis.Locality.GenerateConversions;
 import Analysis.Prefetch.PrefetchAnalysis;
 import Analysis.FlatIRGraph.FlatIRGraph;
 import Analysis.OwnershipAnalysis.OwnershipAnalysis;
+import Analysis.Disjoint.DisjointAnalysis;
 import Analysis.MLP.MLPAnalysis;
 import Analysis.Loops.*;
 import Analysis.Liveness;
+import Analysis.ArrayReferencees;
 import IR.MethodDescriptor;
 import IR.Flat.FlatMethod;
 import Interface.*;
@@ -90,6 +92,9 @@ public class Main {
       } else if(option.equals("-numcore")) {
        ++i;
        state.CORENUM = Integer.parseInt(args[i]);
+      } else if(option.equals("-numcore4gc")) {
+        ++i;
+        state.CORENUM4GC = Integer.parseInt(args[i]);
       } else if (option.equals("-mainclass"))
        state.main=args[++i];
       else if (option.equals("-trueprob")) {
@@ -120,8 +125,12 @@ public class Main {
        state.TAGSTATE=true;
       else if (option.equals("-stmarray"))
        state.STMARRAY=true;
+      else if (option.equals("-eventmonitor"))
+       state.EVENTMONITOR=true;
       else if (option.equals("-dualview"))
        state.DUALVIEW=true;
+      else if (option.equals("-hybrid"))
+       state.HYBRID=true;
       else if (option.equals("-flatirtasks")) {
        state.FLATIRGRAPH=true;
        state.FLATIRGRAPHTASKS=true;
@@ -156,6 +165,35 @@ public class Main {
       } else if (option.equals("-owndebugcallcount")) {
        state.OWNERSHIPDEBUGCALLCOUNT=Integer.parseInt(args[++i]);
       }
+      else if (option.equals("-disjoint"))
+       state.DISJOINT=true;
+      else if (option.equals("-disjoint-k")) {
+       state.DISJOINTALLOCDEPTH=Integer.parseInt(args[++i]);
+      } else if (option.equals("-disjoint-write-dots")) {
+       state.DISJOINTWRITEDOTS = true;
+        String arg = args[++i];
+       if( arg.equals("all") ) {
+         state.DISJOINTWRITEALL = true;
+       } else if( arg.equals("final") ) {
+          state.DISJOINTWRITEALL = false;
+        } else {
+          throw new Error("disjoint-write-dots requires argument <all/final>");
+        }
+      } else if (option.equals("-disjoint-alias-file")) {
+       state.DISJOINTALIASFILE = args[++i];
+        String arg = args[++i];
+       if( arg.equals("normal") ) {
+         state.DISJOINTALIASTAB = false;
+       } else if( arg.equals("tabbed") ) {
+          state.DISJOINTALIASTAB = true;
+        } else {
+          throw new Error("disjoint-alias-file requires arguments <filename> <normal/tabbed>");
+        }
+      } else if (option.equals("-disjoint-debug-callsite")) {
+       state.DISJOINTDEBUGCALLEE=args[++i];
+       state.DISJOINTDEBUGCALLER=args[++i];
+       state.DISJOINTDEBUGCALLCOUNT=Integer.parseInt(args[++i]);
+      }
       else if (option.equals("-optional"))
        state.OPTIONAL=true;
       else if (option.equals("-optimize"))
@@ -184,6 +222,8 @@ public class Main {
        state.THREAD=true;
       else if (option.equals("-dsm"))
        state.DSM=true;
+      else if (option.equals("-recoverystats"))
+  state.DSMRECOVERYSTATS=true;
       else if (option.equals("-dsmtask"))
   state.DSMTASK=true;
       else if (option.equals("-singleTM"))
@@ -257,7 +297,7 @@ public class Main {
        sourcefiles.add(args[i]);
       }
     }
-
+    
     //add default classpath
     if (state.classpath.size()==1)
       state.classpath.add(ClassLibraryPrefix);
@@ -351,10 +391,12 @@ public class Main {
     if (state.OWNERSHIP && !state.MLP) {
       CallGraph callGraph = new CallGraph(state);
       Liveness liveness = new Liveness();
+      ArrayReferencees ar = new ArrayReferencees(state);
       OwnershipAnalysis oa = new OwnershipAnalysis(state,
                                                    tu,
                                                    callGraph,
                                                   liveness,
+                                                   ar,
                                                    state.OWNERSHIPALLOCDEPTH,
                                                    state.OWNERSHIPWRITEDOTS,
                                                    state.OWNERSHIPWRITEALL,
@@ -365,10 +407,12 @@ public class Main {
     if (state.MLP) {
       CallGraph callGraph = new CallGraph(state);
       Liveness liveness = new Liveness();
+      ArrayReferencees ar = new ArrayReferencees(state);
       OwnershipAnalysis oa = new OwnershipAnalysis(state,
                                                    tu,
                                                    callGraph,
                                                   liveness,
+                                                   ar,
                                                   state.OWNERSHIPALLOCDEPTH,
                                                    state.OWNERSHIPWRITEDOTS,
                                                    state.OWNERSHIPWRITEALL,
@@ -380,6 +424,13 @@ public class Main {
                              oa);
     }    
 
+    if (state.DISJOINT) {
+      CallGraph        cg = new CallGraph(state);
+      Liveness         l  = new Liveness();
+      ArrayReferencees ar = new ArrayReferencees(state);
+      DisjointAnalysis oa = new DisjointAnalysis(state, tu, cg, l, ar);
+    }
+
     if (state.TAGSTATE) {
       CallGraph callgraph=new CallGraph(state);
       TagAnalysis taganalysis=new TagAnalysis(state, callgraph);
@@ -414,10 +465,12 @@ public class Main {
        // Use ownership analysis to get alias information
        CallGraph callGraph = new CallGraph(state);
        Liveness liveness = new Liveness();
+        ArrayReferencees ar = new ArrayReferencees(state);
        OwnershipAnalysis oa = new OwnershipAnalysis(state,
                                                     tu,
                                                     callGraph,
                                                     liveness,
+                                                     ar,
                                                     state.OWNERSHIPALLOCDEPTH,
                                                     state.OWNERSHIPWRITEDOTS,
                                                     state.OWNERSHIPWRITEALL,
@@ -449,6 +502,7 @@ public class Main {
                                                              sa,
                                                              scheduling,
                                                              mcImplSynthesis.getCoreNum(),
+                                                  state.CORENUM4GC,
                                                              pa);
                bcm.setOwnershipAnalysis(oa);
                bcm.buildCode();