}
}
- private ensureCapacity(int minCapacity) {
+ private void ensureCapacity(int minCapacity) {
if (minCapacity>array.length) {
int newsize;
if (capacityIncrement<=0)
}
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);
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
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");
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);
#ifndef GCQUEUE_H
#define GCQUEUE_H
-
#include "stdio.h"
+#ifdef MGC
+#include "interrupt.h"
+#endif
+
#define NUMPTRS 120
struct pointerblock {
#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;
#include "ObjectHash.h"
#include "GenericHashtable.h"
#include "gcqueue.h"
+#ifdef MGC
+#include "runtime_arch.h"
+
+extern int corenum;
+#endif
/* Task specific includes */
#include "multicoreruntime.h"
#include "GenericHashtable.h"
#include "gcqueue.h"
+#ifdef MGC
+#include "runtime_arch.h"
+
+extern int corenum;
+#endif
extern int corenum;
#ifdef TASK
#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,
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);
}
#endif
}
+#endif
INLINE void processmsg_transtall_I() {
BAMBOO_ASSERT(BAMBOO_NUM_OF_CORE == STARTUPCORE);
#include "runtime.h"
#include "multicoreruntime.h"
#include "methodheaders.h"
+#ifdef MGC
+#include "runtime_arch.h"
+#endif
extern int classsize[];
extern int typearray[];
#endif
#endif
-#ifdef THREADS
+#if (defined(THREADS)||defined(MGC))
#define MAXLOCKS 256
struct lockpair {