add options to close array boundary check in Bamboo
authorjzhou <jzhou>
Thu, 5 Feb 2009 22:51:39 +0000 (22:51 +0000)
committerjzhou <jzhou>
Thu, 5 Feb 2009 22:51:39 +0000 (22:51 +0000)
Robust/src/IR/Flat/BuildCode.java
Robust/src/IR/State.java
Robust/src/Main/Main.java

index c1e4b6b8fe6463c105df4a4c2f6dc8ea0fafb26e..6cc1e6c906f7b70227ad4ad72ad29ac8dda8b072 100644 (file)
@@ -2100,7 +2100,7 @@ public class BuildCode {
     else
       type=elementtype.getSafeSymbol()+" ";
 
-    if (fen.needsBoundsCheck()) {
+    if (this.state.ARRAYBOUNDARYCHECK && fen.needsBoundsCheck()) {
       output.println("if ("+generateTemp(fm, fen.getIndex(),lb)+"< 0 || "+generateTemp(fm, fen.getIndex(),lb)+" >= "+generateTemp(fm,fen.getSrc(),lb) + "->___length___)");
       output.println("failedboundschk();");
     }
@@ -2144,8 +2144,7 @@ public class BuildCode {
     else
       type=elementtype.getSafeSymbol()+" ";
 
-
-    if (fsen.needsBoundsCheck()) {
+    if (this.state.ARRAYBOUNDARYCHECK && fsen.needsBoundsCheck()) {
       output.println("if ("+generateTemp(fm, fsen.getIndex(),lb)+"< 0 || "+generateTemp(fm, fsen.getIndex(),lb)+" >= "+generateTemp(fm,fsen.getDst(),lb) + "->___length___)");
       output.println("failedboundschk();");
     }
index 5ceca0f87adce4f8333e1456e49eb49c2138cb85..3094fc21541d757eb418665ec180f84370bb59fe 100644 (file)
@@ -61,6 +61,7 @@ public class State {
   public boolean OWNERSHIPWRITEALL=false;
   public String OWNERSHIPALIASFILE=null;
   public boolean OPTIONAL=false;
+  public boolean ARRAYBOUNDARYCHECK=true;
   public boolean RAW=false;
   public boolean SCHEDULING=false;
   public boolean USEPROFILE=false;
index b228cd9fcbc0da282ad4f418f4f60e5a654d7722..e976f9e4a00ab3aac5988060efbf7999aedf32cb 100644 (file)
@@ -129,6 +129,8 @@ public class Main {
        state.WEBINTERFACE=true;
       else if (option.equals("-instructionfailures"))
        state.INSTRUCTIONFAILURE=true;
+      else if (option.equals("-abcclose"))
+         state.ARRAYBOUNDARYCHECK=false;
       else if (option.equals("-help")) {
        System.out.println("-classlibrary classlibrarydirectory -- directory where classlibrary is located");
        System.out.println("-selfloop task -- this task doesn't self loop its parameters forever");
@@ -154,6 +156,7 @@ public class Main {
        System.out.println("-ownwritedots <all/final> -- write ownership graphs; can be all results or just final results");
        System.out.println("-ownaliasfile <filename> -- write a text file showing all detected aliases in program tasks");
        System.out.println("-optional -- enable optional arguments");
+       System.out.println("-abcclose close the array boundary check");
        System.out.println("-scheduling do task scheduling");
        System.out.println("-multicore generate multi-core version binary");
        System.out.println("-numcore set the number of cores (should be used together with -multicore), defaultly set as 1");
@@ -317,6 +320,7 @@ public class Main {
          bcm.buildCode();
          scheduling = null;
        }
+       schedulings = null;
        selectedScheduling = null;
       }