Initialize class objects first as in the staic blocks there might be references to...
authorjzhou <jzhou>
Tue, 5 Jun 2012 02:23:17 +0000 (02:23 +0000)
committerjzhou <jzhou>
Tue, 5 Jun 2012 02:23:17 +0000 (02:23 +0000)
Robust/src/IR/Flat/BuildCode.java
Robust/src/IR/Flat/BuildCodeMGC.java
Robust/src/IR/Flat/BuildCodeMultiCore.java
Robust/src/IR/Flat/BuildCodeTran.java

index c18d65f..11e4b0c 100644 (file)
@@ -428,9 +428,8 @@ public class BuildCode {
       outmethod.println("    ((struct garbagelist *)global_defs_p)->array[i]=NULL;");
       outmethod.println("  }");
     }
-    outputStaticBlocks(outmethod);
     outputClassObjects(outmethod);
-
+    outputStaticBlocks(outmethod);
 
     additionalCodeAtTopOfMain(outmethod);
     for(BuildCodeExtension bcx: extensions) {
index a88e0cb..7c81c3d 100644 (file)
@@ -162,8 +162,8 @@ public class BuildCodeMGC extends BuildCode {
       outmethod.println("  }");
     }
 
-    outputStaticBlocks(outmethod);
     outputClassObjects(outmethod);
+    outputStaticBlocks(outmethod);
 
     if ((GENERATEPRECISEGC) || state.MULTICOREGC || state.PMC) {
       outmethod.println("  struct ArrayObject * stringarray=allocate_newarray(NULL, STRINGARRAYTYPE, argc-1);");
index 16dc93b..1ca9978 100644 (file)
@@ -386,8 +386,8 @@ public class BuildCodeMultiCore extends BuildCode {
       outmethod.println("  }");
     }
 
-    outputStaticBlocks(outmethod);
     outputClassObjects(outmethod);
+    outputStaticBlocks(outmethod);
 
     outmethod.println("}");
   }
index 7be13a5..13214b7 100644 (file)
@@ -127,8 +127,8 @@ public class BuildCodeTran extends BuildCode {
       outmethod.println("  }");
     }
 
-    outputStaticBlocks(outmethod);
     outputClassObjects(outmethod);
+    outputStaticBlocks(outmethod);
     additionalCodeAtTopOfMain(outmethod);
 
     if (state.DSM) {