Make SPECjbb compile again
authorjzhou <jzhou>
Tue, 10 May 2011 18:52:57 +0000 (18:52 +0000)
committerjzhou <jzhou>
Tue, 10 May 2011 18:52:57 +0000 (18:52 +0000)
Robust/src/ClassLibrary/MGC/Vector.java
Robust/src/IR/Tree/BuildIR.java
Robust/src/IR/TypeUtil.java
Robust/src/Runtime/bamboo/gcqueue.h
Robust/src/Runtime/bamboo/multicoregarbage.c
Robust/src/Runtime/bamboo/multicoregcflush.c
Robust/src/Runtime/bamboo/multicoregcmark.c
Robust/src/Runtime/bamboo/multicoremsg.c
Robust/src/Runtime/bamboo/multicoreruntime.c
Robust/src/Runtime/runtime.h

index 738b78a68f4e643bfdc2f97acaae3e8b4c5e9721..5d729f2c127f7cfaed9a03dc3a474f0ea6e4bb52 100644 (file)
@@ -79,7 +79,7 @@ public class Vector implements Set {
     }
   }
 
-  private ensureCapacity(int minCapacity) {
+  private void ensureCapacity(int minCapacity) {
     if (minCapacity>array.length) {
       int newsize;
       if (capacityIncrement<=0)
index ca20689fe18fd3fcf6032f3ae1c4b541cffbc2df..8b7d2585a4dd197c26e13a59ea6df9a8ac382edd 100644 (file)
@@ -49,7 +49,7 @@ public class BuildIR {
     }
 
     ParseNode ipn = pn.getChild("imports").getChild("import_decls_list");
-    if (ipn != null) {
+    if ((ipn != null) && !state.MGC) {
       ParseNodeVector pnv = ipn.getChildren();
       for (int i = 0; i < pnv.size(); i++) {
         ParseNode pnimport = pnv.elementAt(i);
@@ -71,7 +71,7 @@ public class BuildIR {
 
     ParseNode ppn=pn.getChild("packages").getChild("package");
     String packageName = null;
-    if (ppn!=null) {
+    if ((ppn!=null) && !state.MGC){
       NameDescriptor nd = parseClassName(ppn.getChild("name"));
       packageName = nd.getPathFromRootToHere();
       //Trick -> import the package directory as a multi-import and it'll
index 9467e09cc93d50ff92e72b6fd91bcde5ba8534f6..8170472080016cfa6f5cdcccaffb6399cfee04ef 100644 (file)
@@ -44,6 +44,10 @@ public class TypeUtil {
 
   public void addNewClass(String cl, Set todo) {
     //search through the default locations for the file.
+    if(state.MGC) {
+      // do not consider package or import when compiling MGC version
+      cl = (cl.lastIndexOf('.')==-1)?cl:cl.substring(cl.lastIndexOf('.')+1);
+    }
     for (int i = 0; i < state.classpath.size(); i++) {
       String path = (String) state.classpath.get(i);
       File f = new File(path, cl.replace('.', '/') + ".java");
@@ -63,16 +67,26 @@ public class TypeUtil {
 
 
   public ClassDescriptor getClass(String classname) {
-    ClassDescriptor cd=(ClassDescriptor)state.getClassSymbolTable().get(classname);
+    String cl = classname;
+    if(state.MGC) {
+      // do not consider package or import when compiling MGC version
+      cl = (cl.lastIndexOf('.')==-1)?cl:cl.substring(cl.lastIndexOf('.')+1);
+    }
+    ClassDescriptor cd=(ClassDescriptor)state.getClassSymbolTable().get(cl);
     return cd;
   }
 
   public ClassDescriptor getClass(String classname, HashSet todo) {
-    ClassDescriptor cd=(ClassDescriptor)state.getClassSymbolTable().get(classname);
+    String cl = classname;
+    if(state.MGC) {
+      // do not consider package or import when compiling MGC version
+      cl = (cl.lastIndexOf('.')==-1)?cl:cl.substring(cl.lastIndexOf('.')+1);
+    }
+    ClassDescriptor cd=(ClassDescriptor)state.getClassSymbolTable().get(cl);
     if (cd==null) {
       //have to find class
-      addNewClass(classname, todo);
-      cd=(ClassDescriptor)state.getClassSymbolTable().get(classname);
+      addNewClass(cl, todo);
+      cd=(ClassDescriptor)state.getClassSymbolTable().get(cl);
 
       System.out.println("Build class:"+cd);
       todo.add(cd);
index 22353795571a2530051b94a9f2fd1a4511333ac6..83ff136eb404f4d4c6fadb144f5b7a2a08b01434 100644 (file)
@@ -1,8 +1,11 @@
 #ifndef GCQUEUE_H
 #define GCQUEUE_H
-
 #include "stdio.h"
 
+#ifdef MGC
+#include "interrupt.h"
+#endif
+
 #define NUMPTRS 120
 
 struct pointerblock {
index 8a42ae66ccc4593e650c1f46e08253f67438cf1f..6fbbc6d2ee5d00f17ab5b8f95e61d2c35af3e28c 100644 (file)
@@ -9,6 +9,11 @@
 #include "multicoreruntime.h"
 #include "multicoregcprofile.h"
 #include "gcqueue.h"
+#ifdef MGC
+#include "runtime_arch.h"
+
+extern int corenum;
+#endif
 
 #ifdef SMEMM
 extern unsigned int gcmem_mixed_threshold;
index 8a5e96d3bda3f19a989426435c951dbc2b51aa59..d2578ecfa63b85dbe54702b3d748f99e9e11e5fe 100644 (file)
@@ -4,6 +4,11 @@
 #include "ObjectHash.h"
 #include "GenericHashtable.h"
 #include "gcqueue.h"
+#ifdef MGC
+#include "runtime_arch.h"
+
+extern int corenum;
+#endif
 
 /* Task specific includes */
 
index 849916962caf91a548c164362d57ab49a6057ccb..08f69d5aa20fd2ca1d0d623b53c52ea33ba1230c 100644 (file)
@@ -4,6 +4,11 @@
 #include "multicoreruntime.h"
 #include "GenericHashtable.h"
 #include "gcqueue.h"
+#ifdef MGC
+#include "runtime_arch.h"
+
+extern int corenum;
+#endif
 
 extern int corenum;
 #ifdef TASK
index 5d6ffb4f7e9153b9d8cbfd7bd791ad3a39de4e0f..67459fc58a0d15364b61855f2a7c1231d8d047a5 100644 (file)
@@ -4,6 +4,12 @@
 #include "multicoreruntime.h"
 #include "multicoretaskprofile.h"
 #include "gcqueue.h"
+#ifdef MGC
+#include "structdefs.h"
+#include "runtime_arch.h"
+
+extern int corenum;
+#endif
 
 int msgsizearray[] = {
   0, //MSGSTART,
@@ -80,6 +86,7 @@ INLINE unsigned int checkMsgLength_I(unsigned int * type) {
   return msgsizearray[*type];
 }
 
+#ifdef TASK
 INLINE void processmsg_transobj_I(int msglength) {
   struct transObjInfo * transObj=RUNMALLOC_I(sizeof(struct transObjInfo));
   BAMBOO_ASSERT(BAMBOO_NUM_OF_CORE <= NUMCORESACTIVE - 1);
@@ -128,6 +135,7 @@ INLINE void processmsg_transobj_I(int msglength) {
   }
 #endif 
 }
+#endif
 
 INLINE void processmsg_transtall_I() {
   BAMBOO_ASSERT(BAMBOO_NUM_OF_CORE == STARTUPCORE);
index 2f1d5c221853e2f5e6aed9bda8993d24e1f3bc3e..86a33bfbef3717202da2557f98eb1b304b3ec3d8 100644 (file)
@@ -3,6 +3,9 @@
 #include "runtime.h"
 #include "multicoreruntime.h"
 #include "methodheaders.h"
+#ifdef MGC
+#include "runtime_arch.h"
+#endif
 
 extern int classsize[];
 extern int typearray[];
index 620440cd2ab8f95ff97150b44506a64d934a8835..8f82131624b57b48553f38449390c123191d86f2 100644 (file)
@@ -157,7 +157,7 @@ inline void setupsmemmode(void);
 #endif
 #endif
 
-#ifdef THREADS
+#if (defined(THREADS)||defined(MGC))
 #define MAXLOCKS 256
 
 struct lockpair {