changes
authorbdemsky <bdemsky>
Fri, 15 Apr 2011 04:51:48 +0000 (04:51 +0000)
committerbdemsky <bdemsky>
Fri, 15 Apr 2011 04:51:48 +0000 (04:51 +0000)
Robust/src/IR/Flat/BuildCode.java
Robust/src/IR/State.java
Robust/src/Main/Main.java
Robust/src/TODO
Robust/src/buildscript

index cd514fe4d5823276546a43f715f9e91c6df132bb..a981d9de67fe5a810ddf04c87f6a1e5feb9daeb7 100644 (file)
@@ -143,20 +143,7 @@ public class BuildCode {
     /* Output Structures */
     outputStructs(outstructs);
 
-    // Output the C class declarations
-    // These could mutually reference each other
-
-    outglobaldefs.println("#ifndef __GLOBALDEF_H_");
-    outglobaldefs.println("#define __GLOBALDEF_H_");
-    outglobaldefs.println("");
-    outglobaldefs.println("struct global_defs_t {");
-    outglobaldefs.println("  int size;");
-    outglobaldefs.println("  void * next;");
-    outglobaldefs.println("  struct ArrayObject * classobjs;");
-    outglobaldefsprim.println("#ifndef __GLOBALDEFPRIM_H_");
-    outglobaldefsprim.println("#define __GLOBALDEFPRIM_H_");
-    outglobaldefsprim.println("");
-    outglobaldefsprim.println("struct global_defsprim_t {");
+    initOutputGlobals(outglobaldefs, outglobaldefsprim);
 
     outclassdefs.println("#ifndef __CLASSDEF_H_");
     outclassdefs.println("#define __CLASSDEF_H_");
@@ -172,20 +159,8 @@ public class BuildCode {
     outclassdefs.println("#include \"globaldefsprim.h\"");
     outclassdefs.println("#endif");
     outclassdefs.close();
-    
-    outglobaldefs.println("};");
-    outglobaldefs.println("");
-    outglobaldefs.println("extern struct global_defs_t * global_defs_p;");
-    outglobaldefs.println("#endif");
-    outglobaldefs.flush();
-    outglobaldefs.close();
 
-    outglobaldefsprim.println("};");
-    outglobaldefsprim.println("");
-    outglobaldefsprim.println("extern struct global_defsprim_t * global_defsprim_p;");
-    outglobaldefsprim.println("#endif");
-    outglobaldefsprim.flush();
-    outglobaldefsprim.close();
+    finalOutputGlobals(outglobaldefs, outglobaldefsprim);
 
     if (state.TASK) {
       /* Map flags to integers */
@@ -203,7 +178,6 @@ public class BuildCode {
       outputTaskTypes(outtask);
     }
 
-
     // an opportunity for subclasses to do extra
     // initialization
     preCodeGenInitialization();
@@ -214,10 +188,7 @@ public class BuildCode {
     State.logEvent("End outputMethods");
 
     // opportunity for subclasses to gen extra code
-    additionalCodeGen(outmethodheader,
-                      outstructs,
-                      outmethod);
-
+    additionalCodeGen(outmethodheader, outstructs, outmethod);
 
     if (state.TASK) {
       /* Output code for tasks */
@@ -249,12 +220,42 @@ public class BuildCode {
     outstructs.println("#endif");
     outstructs.close();
 
-
-
     postCodeGenCleanUp();
     State.logEvent("End of buildCode");
   }
 
+  protected void initOutputGlobals(PrintWriter outglobaldefs, PrintWriter outglobaldefsprim) {
+    // Output the C class declarations
+    // These could mutually reference each other
+    outglobaldefs.println("#ifndef __GLOBALDEF_H_");
+    outglobaldefs.println("#define __GLOBALDEF_H_");
+    outglobaldefs.println("");
+    outglobaldefs.println("struct global_defs_t {");
+    outglobaldefs.println("  int size;");
+    outglobaldefs.println("  void * next;");
+    outglobaldefs.println("  struct ArrayObject * classobjs;");
+    outglobaldefsprim.println("#ifndef __GLOBALDEFPRIM_H_");
+    outglobaldefsprim.println("#define __GLOBALDEFPRIM_H_");
+    outglobaldefsprim.println("");
+    outglobaldefsprim.println("struct global_defsprim_t {");
+  }
+
+  protected void finalOutputGlobals(PrintWriter outglobaldefs, PrintWriter outglobaldefsprim) {
+    outglobaldefs.println("};");
+    outglobaldefs.println("");
+    outglobaldefs.println("extern struct global_defs_t * global_defs_p;");
+    outglobaldefs.println("#endif");
+    outglobaldefs.flush();
+    outglobaldefs.close();
+
+    outglobaldefsprim.println("};");
+    outglobaldefsprim.println("");
+    outglobaldefsprim.println("extern struct global_defsprim_t * global_defsprim_p;");
+    outglobaldefsprim.println("#endif");
+    outglobaldefsprim.flush();
+    outglobaldefsprim.close();
+  }
+
   /* This method goes though the call graph and tag those methods that are
    * invoked inside static blocks
    */
@@ -1428,25 +1429,20 @@ public class BuildCode {
       fieldorder.put(cn,fields);
 
       Vector fieldvec=cn.getFieldVec();
+      fldloop:
       for(int i=0; i<fieldvec.size(); i++) {
        FieldDescriptor fd=(FieldDescriptor)fieldvec.get(i);
        if((sp != null) && sp.getFieldTable().contains(fd.getSymbol())) {
          // a shadow field
        } else {
          it_sifs = sitbl.getDescriptorsIterator();
-         boolean hasprinted = false;
          while(it_sifs.hasNext()) {
            ClassDescriptor si = (ClassDescriptor)it_sifs.next();
            if(si.getFieldTable().contains(fd.getSymbol())) {
-             hasprinted = true;
-             break;
+             continue fldloop;
            }
          }
-         if(hasprinted) {
-           // this field has been defined in the super class
-         } else {
-           fields.add(fd);
-         }
+         fields.add(fd);
        }
       }
     }
index 22f31a272201a8ea7de20c015f07a4087fd98773..93072f1ae692e53ab108487cd029f46968b9cdce 100644 (file)
@@ -68,6 +68,7 @@ public class State {
 
   /** Boolean flag which indicates whether compiler is compiling a task-based
    * program. */
+  public boolean JNI=false;
   public boolean POINTER=false;
   public boolean COREPROF=false;
   public boolean WEBINTERFACE=false;
index 57581a9c5d6bb59f2030360bfe4925855fb41838..ba31b33f16debbee86788d25c480bbe4a3bc733f 100644 (file)
@@ -80,6 +80,8 @@ public class Main {
       String option=args[i];
       if (option.equals("-precise"))
        IR.Flat.BuildCode.GENERATEPRECISEGC=true;
+      else if (option.equals("-jni"))
+       state.JNI=true;
       else if (option.equals("-prefetch"))
        state.PREFETCH=true;
       else if (option.equals("-dir"))
index e7649ce635fec40a1e4c4f60ef63c8f96f7f35b8..744c6a3b12cd8bc4d73326578573e3cac8570bd9 100644 (file)
@@ -1,2 +1,4 @@
-1) Make typecasts really work
-2) Logical xor's
\ No newline at end of file
+1) Compile of OOO raytracer sometimes problematic
+2) Tracking --- seg fault with OOO
+3) Speedup variable analysis --- don't analyze methods w/o seses...
+4) SOR -- validation failure for OOO (SOR had same bug...stall site for validation...first access is just to read length...)
index 5b3a68762d16a771ebd77de394e399078aff6f21..e328f0c8b1151fba926894e591df7f1c67530529 100755 (executable)
@@ -107,6 +107,7 @@ echo SSJava options
 echo -ssjava enables SSJava
 echo
 echo Other options
+echo -jni enable jni
 echo -abcclose turnoff array boundary checks
 echo -builddir setup different build directory
 echo -robustroot set up the ROBUSTROOT to directory other than default one
@@ -154,6 +155,7 @@ echo -help help
 }
 
 tmpbuilddirectory="tmpbuilddirectory"
+JNI=false
 SRCAFTERPP=false;
 COREPROF=false;
 NUMA=false;
@@ -252,7 +254,10 @@ if [[ $1 = '-help' ]]
 then
 printhelp
 exit
-
+elif [[ $1 = '-jni' ]]
+then
+JNI=true
+JAVAOPTS="$JAVAOPTS -jni"
 elif [[ $1 = '-justanalyze' ]]
 then
 EXITAFTERANALYSIS=true