Bug fixes for gc
[IRC.git] / Robust / src / IR / Flat / BuildCodeMGC.java
index d7b2accdf98500b46a16084bf7e6ef9f0ef5633b..e01fe00825636b11150b3b59df23054c5bc3b7ae 100644 (file)
@@ -154,6 +154,7 @@ public class BuildCodeMGC extends BuildCode {
     
     if (state.MULTICOREGC) {
       outmethod.println("  global_defs_p->size="+globaldefscount+";");
+      outmethod.println("  global_defs_p->next=NULL;");
       outmethod.println("  for(i=0;i<"+globaldefscount+";i++) {");
       outmethod.println("    ((struct garbagelist *)global_defs_p)->array[i]=NULL;");
       outmethod.println("  }");
@@ -192,26 +193,4 @@ public class BuildCodeMGC extends BuildCode {
 
     outmethod.println("}");
   }
-  
-  protected void outputClassObjects(PrintWriter outmethod) {
-    // for each class, initialize its Class object
-    if(state.MGC) {
-      SymbolTable ctbl = this.state.getClassSymbolTable();
-      Iterator it_classes = ctbl.getDescriptorsIterator();
-
-      while(it_classes.hasNext()) {
-        ClassDescriptor t_cd = (ClassDescriptor)it_classes.next();
-        // TODO initialize the Class object for this class  ++
-        outmethod.println(" {");
-        if ((GENERATEPRECISEGC) || (this.state.MULTICOREGC)) {
-          outmethod.println("    struct garbagelist dummy={0,NULL};");
-          outmethod.println("    global_defs_p->"+t_cd.getSafeSymbol()+"classobj = allocate_new(&dummy, " + typeutil.getClass(TypeUtil.ObjectClass).getId() + ");");
-        } else {
-          outmethod.println("    global_defs_p->"+t_cd.getSafeSymbol()+"classobj = allocate_new(" + typeutil.getClass(TypeUtil.ObjectClass).getId() + ");");
-        }
-        outmethod.println(" }");
-        
-      }
-    } // else TODO normal java version 
-  }
 }