* @param state a flattened State object
* @see State
*/
- public TaskAnalysis(State state, TagAnalysis taganalysis) {
+ public TaskAnalysis(State state, TagAnalysis taganalysis, TypeUtil typeutil) {
this.state=state;
- this.typeutil=new TypeUtil(state);
+ this.typeutil=typeutil;
this.taganalysis=taganalysis;
}
* Class Constructor
*
*/
- public TaskTagAnalysis(State state, TagAnalysis taganalysis) {
+ public TaskTagAnalysis(State state, TagAnalysis taganalysis, TypeUtil typeutil) {
this.state=state;
- this.typeutil=new TypeUtil(state);
+ this.typeutil=typeutil;
this.taganalysis=taganalysis;
this.flaginfo=new FlagInfo(state);
this.toprocess=new HashSet<TagState>();
+++ /dev/null
-public class BarrierServer extends Thread {
- int numthreads;
- boolean done;
-
- public BarrierServer(int n) {
- numthreads=n;
- done=false;
- }
-
- public void run() {
- int n;
- ServerSocket ss=new ServerSocket(2000);
- atomic {
- n=numthreads;
- done=true;
- }
- Socket ar[]=new Socket[n];
- for(int i=0; i<n; i++) {
- ar[i]=ss.accept();
- }
-
- while(true) {
- for(int j=0; j<n; j++) {
- Socket s=ar[j];
- byte b[]=new byte[1];
- while(s.read(b)!=1) {
- ;
- }
- }
- byte b[]=new byte[1];
- b[0]= (byte) 'A';
- for(int j=0; j<n; j++)
- ar[j].write(b);
- }
- }
-}
-
-public class Barrier {
- Socket s;
- public Barrier(String name) {
- s=new Socket(name, 2000);
- }
-
- public static void enterBarrier(Barrier barr) {
- byte b[]=new byte[1];
- b[0]=(byte)'A';
- barr.s.write(b);
- while(barr.s.read(b)!=1) {
- ;
- }
- }
-}
--- /dev/null
+public class Object {
+ public native int nativehashCode();
+ private int cachedCode; //first field has to be a primitive
+ private boolean cachedHash;
+
+ /* DO NOT USE ANY OF THESE - THEY ARE FOR IMPLEMENTING TAGS */
+ private Object tags;
+
+ public int hashCode() {
+ if (!cachedHash) {
+ cachedCode=nativehashCode();
+ cachedHash=true;
+ }
+ return cachedCode;
+ }
+
+ /* DON'T USE THIS METHOD UNLESS NECESSARY */
+ /* WE WILL DEPRECATE IT AS SOON AS INSTANCEOF WORKS */
+ public native int getType();
+
+ public String toString() {
+ return "Object"+hashCode();
+ }
+
+ public boolean equals(Object o) {
+ if (o==this)
+ return true;
+ return false;
+ }
+}
--- /dev/null
+public class ServerSocket {
+ /* Socket pending flag */
+ external flag SocketPending;
+ /* File Descriptor */
+ int fd;
+
+ private native int createSocket(int port);
+
+ public ServerSocket(int port) {
+ this.fd=createSocket(port);
+ }
+
+ public Socket accept() {
+ Socket s=new Socket();
+ int newfd=nativeaccept(s);
+ s.setFD(newfd);
+ return s;
+ }
+
+ public Socket accept(tag td) {
+ Socket s=new Socket() {
+ } {td};
+ int newfd=nativeaccept(s);
+ s.setFD(newfd);
+ return s;
+ }
+
+ /* Lets caller pass in their own Socket object. */
+ public void accept(Socket s) {
+ int newfd=nativeaccept(s);
+ s.setFD(newfd);
+ }
+
+ private native int nativeaccept(Socket s);
+
+ public void close();
+
+}
--- /dev/null
+public class Socket {
+ /* Data pending flag */
+ external flag IOPending;
+ /* File Descriptor */
+ int fd;
+ private SocketInputStream sin;
+ private SocketOutputStream sout;
+
+ public Socket() {
+ sin=new SocketInputStream(this);
+ sout=new SocketOutputStream(this);
+ }
+
+ public InputStream getInputStream() {
+ return sin;
+ }
+
+ public OutputStream getOutputStream() {
+ return sout;
+ }
+
+ public Socket(String host, int port) {
+ InetAddress address=InetAddress.getByName(host);
+ fd=nativeBind(address.getAddress(), port);
+ nativeConnect(fd, address.getAddress(), port);
+ }
+
+ public Socket(InetAddress address, int port) {
+ fd=nativeBind(address.getAddress(), port);
+ nativeConnect(fd, address.getAddress(), port);
+ }
+
+ public void connect(String host, int port) {
+ InetAddress address=InetAddress.getByName(host);
+ fd=nativeBind(address.getAddress(), port);
+ nativeConnect(fd, address.getAddress(), port);
+ }
+
+ public void connect(InetAddress address, int port) {
+ fd=nativeBind(address.getAddress(), port);
+ nativeConnect(fd, address.getAddress(), port);
+ }
+
+ public static native int nativeBind(byte[] address, int port);
+
+ public native int nativeConnect(int fd, byte[] address, int port);
+
+ int setFD(int filed) {
+ fd=filed;
+ }
+
+ public int read(byte[] b) {
+ return nativeRead(b);
+ }
+ public void write(byte[] b) {
+ nativeWrite(b, 0, b.length);
+ }
+
+ public void write(byte[] b, int offset, int len) {
+ nativeWrite(b, offset, len);
+ }
+
+ private native void nativeBindFD(int fd);
+ private native int nativeRead(byte[] b);
+ private native void nativeWrite(byte[] b, int offset, int len);
+ private native void nativeClose();
+
+ public void close() {
+ nativeClose();
+ }
+}
--- /dev/null
+public class StartupObject {
+ flag initialstate;
+
+ String [] parameters;
+}
--- /dev/null
+/** This class is not to be used by the end user. It's intended for
+ * internal use to keep track of tags. */
+
+private class TagDescriptor {
+}
+++ /dev/null
-public class DistributedHashMap {
- DistributedHashEntry[] table;
- float loadFactor;
- int secondcapacity;
-
- public DistributedHashMap(int initialCapacity, int secondcapacity, float loadFactor) {
- init(initialCapacity, secondcapacity, loadFactor);
- }
-
- private void init(int initialCapacity, int secondcapacity, float loadFactor) {
- table=global new DistributedHashEntry[initialCapacity];
- this.loadFactor=loadFactor;
- this.secondcapacity=secondcapacity;
- }
-
- private static int hash1(int hashcode, int length) {
- int value=hashcode%length;
- if (value<0)
- return -value;
- else
- return value;
- }
-
- private static int hash2(int hashcode, int length1, int length2) {
- int value=(hashcode*31)%length2;
- if (value<0)
- return -value;
- else
- return value;
- }
-
- void resize(int index) {
- DHashEntry[] oldtable=table[index].array;
- int newCapacity=oldtable.length*2+1;
- DHashEntry [] newtable=global new DHashEntry[newCapacity];
- table[index].array=newtable;
-
- for(int i=0; i<oldtable.length; i++) {
- DHashEntry e=oldtable[i];
- while(e!=null) {
- DHashEntry next=e.next;
- int bin=hash2(e.hashval, table.length, newCapacity);
- e.next=newtable[bin];
- newtable[bin]=e;
- e=next;
- }
- }
- }
-
- Object remove(Object key) {
- int hashcode=key.hashCode();
- int index1=hash1(hashcode, table.length);
- DistributedHashEntry dhe=table[index1];
- if (dhe==null)
- return null;
- int index2=hash2(hashcode, table.length, dhe.array.length);
- DHashEntry ptr=dhe.array[index2];
-
- if (ptr!=null) {
- if (ptr.hashval==hashcode&&ptr.key.equals(key)) {
- dhe.array[index2]=ptr.next;
- dhe.count--;
- return ptr.value;
- }
- while(ptr.next!=null) {
- if (ptr.hashval==hashcode&&ptr.next.key.equals(key)) {
- Object oldvalue=ptr.value;
- ptr.next=ptr.next.next;
- dhe.count--;
- return oldvalue;
- }
- ptr=ptr.next;
- }
- }
- return null;
- }
-
- Object get(Object key) {
- int hashcode=key.hashCode();
- int index1=hash1(hashcode, table.length);
- DistributedHashEntry dhe=table[index1];
- if (dhe==null)
- return null;
-
- int index2=hash2(hashcode, table.length, dhe.array.length);
- DHashEntry ptr=dhe.array[index2];
-
- while(ptr!=null) {
- if (ptr.hashval==hashcode
- &&ptr.key.equals(key)) {
- return ptr.value;
- }
- ptr=ptr.next;
- }
- return null;
- }
-
- boolean containsKey(Object key) {
- int hashcode=key.hashCode();
- int index1=hash1(hashcode, table.length);
- DistributedHashEntry dhe=table[index1];
- if (dhe==null)
- return false;
- int index2=hash2(hashcode, table.length, dhe.array.length);
- DHashEntry ptr=dhe.array[index2];
-
- while(ptr!=null) {
- if (ptr.hashval==hashcode
- &&ptr.key.equals(key)) {
- return true;
- }
- ptr=ptr.next;
- }
- return false;
- }
-
- Object put(Object key, Object value) {
- int hashcode=key.hashCode();
- int index1=hash1(hashcode, table.length);
- DistributedHashEntry dhe=table[index1];
- if (dhe==null) {
- dhe=global new DistributedHashEntry(secondcapacity);
- table[index1]=dhe;
- }
- int index2=hash2(hashcode, table.length, dhe.array.length);
- DHashEntry ptr=dhe.array[index2];
-
- while(ptr!=null) {
- if (ptr.hashval==hashcode&&ptr.key.equals(key)) {
- Object oldvalue=ptr.value;
- ptr.value=value;
- return oldvalue;
- }
- ptr=ptr.next;
- }
-
- DHashEntry he=global new DHashEntry();
- he.value=value;
- he.key=key;
- he.hashval=hashcode;
- he.next=dhe.array[index2];
- dhe.array[index2]=he;
-
- dhe.count++;
- if (dhe.count>(loadFactor*dhe.array.length)) {
- //Resize the table
- resize(index1);
- }
- return null;
- }
-}
-
-
-class DistributedHashEntry {
- public DistributedHashEntry(int capacity) {
- array=global new DHashEntry[capacity];
- }
- int count;
- DHashEntry[] array;
-}
-
-
-class DHashEntry {
- public DHashEntry() {
- }
- int hashval;
- Object key;
- Object value;
- DHashEntry next;
-}
--- /dev/null
+public class Object {
+ public int cachedCode; //first field has to be a primitive
+ public boolean cachedHash;
+
+ public native int nativehashCode();
+
+ public int hashCode() {
+ if (!cachedHash) {
+ cachedCode=nativehashCode();
+ cachedHash=true;
+ }
+ return cachedCode;
+ }
+
+ /* DON'T USE THIS METHOD UNLESS NECESSARY */
+ /* WE WILL DEPRECATE IT AS SOON AS INSTANCEOF WORKS */
+ public native int getType();
+
+ public String toString() {
+ return "Object"+hashCode();
+ }
+
+ public boolean equals(Object o) {
+ if (o==this)
+ return true;
+ return false;
+ }
+}
--- /dev/null
+public class ServerSocket {
+ /* File Descriptor */
+ int fd;
+
+ private native int createSocket(int port);
+
+ public ServerSocket(int port) {
+ this.fd=createSocket(port);
+ }
+
+ public Socket accept() {
+ Socket s=new Socket();
+ int newfd=nativeaccept(s);
+ s.setFD(newfd);
+ return s;
+ }
+
+ /* Lets caller pass in their own Socket object. */
+ public void accept(Socket s) {
+ int newfd=nativeaccept(s);
+ s.setFD(newfd);
+ }
+
+ private native int nativeaccept(Socket s);
+
+ public void close();
+
+}
--- /dev/null
+public class Socket {
+ /* File Descriptor */
+ int fd;
+ SocketInputStream sin;
+ SocketOutputStream sout;
+
+ public Socket() {
+ sin=new SocketInputStream(this);
+ sout=new SocketOutputStream(this);
+ }
+
+ public InputStream getInputStream() {
+ return sin;
+ }
+
+ public OutputStream getOutputStream() {
+ return sout;
+ }
+
+ public Socket(String host, int port) {
+ InetAddress address=InetAddress.getByName(host);
+ fd=nativeBind(address.getAddress(), port);
+ nativeConnect(fd, address.getAddress(), port);
+ sin=new SocketInputStream(this);
+ sout=new SocketOutputStream(this);
+ }
+
+ public Socket(InetAddress address, int port) {
+ fd=nativeBind(address.getAddress(), port);
+ nativeConnect(fd, address.getAddress(), port);
+ sin=new SocketInputStream(this);
+ sout=new SocketOutputStream(this);
+ }
+
+ public static native int nativeBind(byte[] address, int port);
+
+ public static native int nativeConnect(int fd, byte[] address, int port);
+
+ int setFD(int filed) {
+ fd=filed;
+ }
+
+ public int read(byte[] b) {
+ return nativeRead(b);
+ }
+ public void write(byte[] b) {
+ nativeWrite(b, 0, b.length);
+ }
+
+ public void write(byte[] b, int offset, int len) {
+ nativeWrite(b, offset, len);
+ }
+
+ private native int nativeRead(byte[] b);
+ private native void nativeWrite(byte[] b, int offset, int len);
+ private native void nativeClose();
+
+ public void close() {
+ nativeClose();
+ }
+}
--- /dev/null
+public class BarrierServer extends Thread {
+ int numthreads;
+ boolean done;
+
+ public BarrierServer(int n) {
+ numthreads=n;
+ done=false;
+ }
+
+ public void run() {
+ int n;
+ ServerSocket ss=new ServerSocket(2000);
+ atomic {
+ n=numthreads;
+ done=true;
+ }
+ Socket ar[]=new Socket[n];
+ for(int i=0; i<n; i++) {
+ ar[i]=ss.accept();
+ }
+
+ while(true) {
+ for(int j=0; j<n; j++) {
+ Socket s=ar[j];
+ byte b[]=new byte[1];
+ while(s.read(b)!=1) {
+ ;
+ }
+ }
+ byte b[]=new byte[1];
+ b[0]= (byte) 'A';
+ for(int j=0; j<n; j++)
+ ar[j].write(b);
+ }
+ }
+}
+
+public class Barrier {
+ Socket s;
+ public Barrier(String name) {
+ s=new Socket(name, 2000);
+ }
+
+ public static void enterBarrier(Barrier barr) {
+ byte b[]=new byte[1];
+ b[0]=(byte)'A';
+ barr.s.write(b);
+ while(barr.s.read(b)!=1) {
+ ;
+ }
+ }
+}
--- /dev/null
+public class Barrier {
+ int numthreads;
+ int entercount;
+ boolean cleared;
+
+ public Barrier(int n) {
+ numthreads=n;
+ cleared = false;
+ entercount = 0;
+ }
+
+ public Barrier() {
+ }
+
+ public void reset() {
+ cleared = false;
+ entercount = 0;
+ }
+
+ public static void enterBarrier(Barrier b) {
+ int tmp;
+ boolean retry=true, ret1=false, ret2=true;;
+
+ do {
+ atomic {
+ if (!b.cleared) {
+ b.entercount++;
+ tmp = b.entercount;
+ if (tmp==b.numthreads) {
+ if(b.numthreads > 1)
+ b.cleared=true;
+ b.entercount--;
+ ret1 = true;
+ }
+ retry=false;
+ }
+ }
+ } while(retry);
+ if (ret1) {
+ return;
+ }
+ while(ret2) {
+ atomic {
+ if (b.cleared) {
+ b.entercount--;
+ int count = b.entercount;
+ if (count==0)
+ b.cleared=false;
+ ret2=false;
+ }
+ }
+ }
+ }
+}
--- /dev/null
+public class DistributedHashMap {
+ DistributedHashEntry[] table;
+ float loadFactor;
+ int secondcapacity;
+
+ public DistributedHashMap(int initialCapacity, int secondcapacity, float loadFactor) {
+ init(initialCapacity, secondcapacity, loadFactor);
+ }
+
+ private void init(int initialCapacity, int secondcapacity, float loadFactor) {
+ table=global new DistributedHashEntry[initialCapacity];
+ this.loadFactor=loadFactor;
+ this.secondcapacity=secondcapacity;
+ }
+
+ private static int hash1(int hashcode, int length) {
+ int value=hashcode%length;
+ if (value<0)
+ return -value;
+ else
+ return value;
+ }
+
+ private static int hash2(int hashcode, int length1, int length2) {
+ int value=(hashcode*31)%length2;
+ if (value<0)
+ return -value;
+ else
+ return value;
+ }
+
+ void resize(int index) {
+ DHashEntry[] oldtable=table[index].array;
+ int newCapacity=oldtable.length*2+1;
+ DHashEntry [] newtable=global new DHashEntry[newCapacity];
+ table[index].array=newtable;
+
+ for(int i=0; i<oldtable.length; i++) {
+ DHashEntry e=oldtable[i];
+ while(e!=null) {
+ DHashEntry next=e.next;
+ int bin=hash2(e.hashval, table.length, newCapacity);
+ e.next=newtable[bin];
+ newtable[bin]=e;
+ e=next;
+ }
+ }
+ }
+
+ Object remove(Object key) {
+ int hashcode=key.hashCode();
+ int index1=hash1(hashcode, table.length);
+ DistributedHashEntry dhe=table[index1];
+ if (dhe==null)
+ return null;
+ int index2=hash2(hashcode, table.length, dhe.array.length);
+ DHashEntry ptr=dhe.array[index2];
+
+ if (ptr!=null) {
+ if (ptr.hashval==hashcode&&ptr.key.equals(key)) {
+ dhe.array[index2]=ptr.next;
+ dhe.count--;
+ return ptr.value;
+ }
+ while(ptr.next!=null) {
+ if (ptr.hashval==hashcode&&ptr.next.key.equals(key)) {
+ Object oldvalue=ptr.value;
+ ptr.next=ptr.next.next;
+ dhe.count--;
+ return oldvalue;
+ }
+ ptr=ptr.next;
+ }
+ }
+ return null;
+ }
+
+ Object get(Object key) {
+ int hashcode=key.hashCode();
+ int index1=hash1(hashcode, table.length);
+ DistributedHashEntry dhe=table[index1];
+ if (dhe==null)
+ return null;
+
+ int index2=hash2(hashcode, table.length, dhe.array.length);
+ DHashEntry ptr=dhe.array[index2];
+
+ while(ptr!=null) {
+ if (ptr.hashval==hashcode
+ &&ptr.key.equals(key)) {
+ return ptr.value;
+ }
+ ptr=ptr.next;
+ }
+ return null;
+ }
+
+ boolean containsKey(Object key) {
+ int hashcode=key.hashCode();
+ int index1=hash1(hashcode, table.length);
+ DistributedHashEntry dhe=table[index1];
+ if (dhe==null)
+ return false;
+ int index2=hash2(hashcode, table.length, dhe.array.length);
+ DHashEntry ptr=dhe.array[index2];
+
+ while(ptr!=null) {
+ if (ptr.hashval==hashcode
+ &&ptr.key.equals(key)) {
+ return true;
+ }
+ ptr=ptr.next;
+ }
+ return false;
+ }
+
+ Object put(Object key, Object value) {
+ int hashcode=key.hashCode();
+ int index1=hash1(hashcode, table.length);
+ DistributedHashEntry dhe=table[index1];
+ if (dhe==null) {
+ dhe=global new DistributedHashEntry(secondcapacity);
+ table[index1]=dhe;
+ }
+ int index2=hash2(hashcode, table.length, dhe.array.length);
+ DHashEntry ptr=dhe.array[index2];
+
+ while(ptr!=null) {
+ if (ptr.hashval==hashcode&&ptr.key.equals(key)) {
+ Object oldvalue=ptr.value;
+ ptr.value=value;
+ return oldvalue;
+ }
+ ptr=ptr.next;
+ }
+
+ DHashEntry he=global new DHashEntry();
+ he.value=value;
+ he.key=key;
+ he.hashval=hashcode;
+ he.next=dhe.array[index2];
+ dhe.array[index2]=he;
+
+ dhe.count++;
+ if (dhe.count>(loadFactor*dhe.array.length)) {
+ //Resize the table
+ resize(index1);
+ }
+ return null;
+ }
+}
+
+
+class DistributedHashEntry {
+ public DistributedHashEntry(int capacity) {
+ array=global new DHashEntry[capacity];
+ }
+ int count;
+ DHashEntry[] array;
+}
+
+
+class DHashEntry {
+ public DHashEntry() {
+ }
+ int hashval;
+ Object key;
+ Object value;
+ DHashEntry next;
+}
--- /dev/null
+public class Object {
+ public int cachedCode; //first field has to be a primitive
+ public boolean cachedHash;
+ public Object nextobject; /* Oid */
+ public Object localcopy;
+
+ public native int nativehashCode();
+
+ public int hashCode() {
+ if (!cachedHash) {
+ cachedCode=nativehashCode();
+ cachedHash=true;
+ }
+ return cachedCode;
+ }
+
+ /* DON'T USE THIS METHOD UNLESS NECESSARY */
+ /* WE WILL DEPRECATE IT AS SOON AS INSTANCEOF WORKS */
+ public native int getType();
+
+ public String toString() {
+ return "Object"+hashCode();
+ }
+
+ public boolean equals(Object o) {
+ if (o==this)
+ return true;
+ return false;
+ }
+}
--- /dev/null
+public class Thread {
+ /* Don't allow overriding this method. If you do, it will break dispatch
+ * because we don't have the type information necessary. */
+ public boolean threadDone;
+
+ public Thread() {
+ threadDone = false;
+ }
+
+ public static native void yield();
+
+ public final native void join();
+
+ public final native void start(int mid);
+
+ public native static void sleep(long millis);
+
+ public void run() {
+ }
+}
--- /dev/null
+public class Object {
+ public int cachedCode; //first field has to be a primitive
+ public boolean cachedHash;
+
+ public native int nativehashCode();
+ private Object nextlockobject;
+ private Object prevlockobject;
+
+ public int hashCode() {
+ if (!cachedHash) {
+ cachedCode=nativehashCode();
+ cachedHash=true;
+ }
+ return cachedCode;
+ }
+
+ /* DON'T USE THIS METHOD UNLESS NECESSARY */
+ /* WE WILL DEPRECATE IT AS SOON AS INSTANCEOF WORKS */
+ public native int getType();
+
+ public native int MonitorEnter();
+ public native int MonitorExit();
+
+ public String toString() {
+ return "Object"+hashCode();
+ }
+
+ public boolean equals(Object o) {
+ if (o==this)
+ return true;
+ return false;
+ }
+}
--- /dev/null
+public class Thread {
+ private boolean finished;
+
+ public void start() {
+ nativeCreate();
+ }
+
+ private static void staticStart(Thread t) {
+ t.run();
+ }
+
+ public static native void yield();
+
+ public void join() {
+ nativeJoin();
+ }
+
+ private native void nativeJoin();
+
+ public native static void sleep(long millis);
+
+ public void run() {
+ }
+
+ private native void nativeCreate();
+
+}
+++ /dev/null
-public class Object {
- public native int nativehashCode();
- private int cachedCode; //first field has to be a primitive
- private boolean cachedHash;
-
- /* DO NOT USE ANY OF THESE - THEY ARE FOR IMPLEMENTING TAGS */
- private Object tags;
-
- public int hashCode() {
- if (!cachedHash) {
- cachedCode=nativehashCode();
- cachedHash=true;
- }
- return cachedCode;
- }
-
- /* DON'T USE THIS METHOD UNLESS NECESSARY */
- /* WE WILL DEPRECATE IT AS SOON AS INSTANCEOF WORKS */
- public native int getType();
-
- public String toString() {
- return "Object"+hashCode();
- }
-
- public boolean equals(Object o) {
- if (o==this)
- return true;
- return false;
- }
-}
+++ /dev/null
-public class Object {
- public int cachedCode; //first field has to be a primitive
- public boolean cachedHash;
- public Object nextobject; /* Oid */
- public Object localcopy;
- private Object tags;
-
- public native int nativehashCode();
-
- public int hashCode() {
- if (!cachedHash) {
- cachedCode=nativehashCode();
- cachedHash=true;
- }
- return cachedCode;
- }
-
- /* DON'T USE THIS METHOD UNLESS NECESSARY */
- /* WE WILL DEPRECATE IT AS SOON AS INSTANCEOF WORKS */
- public native int getType();
-
- public String toString() {
- return "Object"+hashCode();
- }
-
- public boolean equals(Object o) {
- if (o==this)
- return true;
- return false;
- }
-}
+++ /dev/null
-public class Object {
- public int cachedCode; //first field has to be a primitive
- public boolean cachedHash;
-
- public native int nativehashCode();
- private Object nextlockobject;
- private Object prevlockobject;
-
- public int hashCode() {
- if (!cachedHash) {
- cachedCode=nativehashCode();
- cachedHash=true;
- }
- return cachedCode;
- }
-
- /* DON'T USE THIS METHOD UNLESS NECESSARY */
- /* WE WILL DEPRECATE IT AS SOON AS INSTANCEOF WORKS */
- public native int getType();
-
- public native int MonitorEnter();
- public native int MonitorExit();
-
- public String toString() {
- return "Object"+hashCode();
- }
-
- public boolean equals(Object o) {
- if (o==this)
- return true;
- return false;
- }
-}
+++ /dev/null
-public class Object {
- public int cachedCode; //first field has to be a primitive
- public boolean cachedHash;
- public Object nextobject; /* Oid */
- public Object localcopy;
-
- public native int nativehashCode();
-
- public int hashCode() {
- if (!cachedHash) {
- cachedCode=nativehashCode();
- cachedHash=true;
- }
- return cachedCode;
- }
-
- /* DON'T USE THIS METHOD UNLESS NECESSARY */
- /* WE WILL DEPRECATE IT AS SOON AS INSTANCEOF WORKS */
- public native int getType();
-
- public String toString() {
- return "Object"+hashCode();
- }
-
- public boolean equals(Object o) {
- if (o==this)
- return true;
- return false;
- }
-}
+++ /dev/null
-public class Object {
- public int cachedCode; //first field has to be a primitive
- public boolean cachedHash;
-
- public native int nativehashCode();
-
- public int hashCode() {
- if (!cachedHash) {
- cachedCode=nativehashCode();
- cachedHash=true;
- }
- return cachedCode;
- }
-
- /* DON'T USE THIS METHOD UNLESS NECESSARY */
- /* WE WILL DEPRECATE IT AS SOON AS INSTANCEOF WORKS */
- public native int getType();
-
- public String toString() {
- return "Object"+hashCode();
- }
-
- public boolean equals(Object o) {
- if (o==this)
- return true;
- return false;
- }
-}
+++ /dev/null
-public class ServerSocket {
- /* Socket pending flag */
- external flag SocketPending;
- /* File Descriptor */
- int fd;
-
- private native int createSocket(int port);
-
- public ServerSocket(int port) {
- this.fd=createSocket(port);
- }
-
- public Socket accept() {
- Socket s=new Socket();
- int newfd=nativeaccept(s);
- s.setFD(newfd);
- return s;
- }
-
- public Socket accept(tag td) {
- Socket s=new Socket() {
- } {td};
- int newfd=nativeaccept(s);
- s.setFD(newfd);
- return s;
- }
-
- /* Lets caller pass in their own Socket object. */
- public void accept(Socket s) {
- int newfd=nativeaccept(s);
- s.setFD(newfd);
- }
-
- private native int nativeaccept(Socket s);
-
- public void close();
-
-}
+++ /dev/null
-public class ServerSocket {
- /* File Descriptor */
- int fd;
-
- private native int createSocket(int port);
-
- public ServerSocket(int port) {
- this.fd=createSocket(port);
- }
-
- public Socket accept() {
- Socket s=new Socket();
- int newfd=nativeaccept(s);
- s.setFD(newfd);
- return s;
- }
-
- /* Lets caller pass in their own Socket object. */
- public void accept(Socket s) {
- int newfd=nativeaccept(s);
- s.setFD(newfd);
- }
-
- private native int nativeaccept(Socket s);
-
- public void close();
-
-}
+++ /dev/null
-public class Socket {
- /* Data pending flag */
- external flag IOPending;
- /* File Descriptor */
- int fd;
- private SocketInputStream sin;
- private SocketOutputStream sout;
-
- public Socket() {
- sin=new SocketInputStream(this);
- sout=new SocketOutputStream(this);
- }
-
- public InputStream getInputStream() {
- return sin;
- }
-
- public OutputStream getOutputStream() {
- return sout;
- }
-
- public Socket(String host, int port) {
- InetAddress address=InetAddress.getByName(host);
- fd=nativeBind(address.getAddress(), port);
- nativeConnect(fd, address.getAddress(), port);
- }
-
- public Socket(InetAddress address, int port) {
- fd=nativeBind(address.getAddress(), port);
- nativeConnect(fd, address.getAddress(), port);
- }
-
- public void connect(String host, int port) {
- InetAddress address=InetAddress.getByName(host);
- fd=nativeBind(address.getAddress(), port);
- nativeConnect(fd, address.getAddress(), port);
- }
-
- public void connect(InetAddress address, int port) {
- fd=nativeBind(address.getAddress(), port);
- nativeConnect(fd, address.getAddress(), port);
- }
-
- public static native int nativeBind(byte[] address, int port);
-
- public native int nativeConnect(int fd, byte[] address, int port);
-
- int setFD(int filed) {
- fd=filed;
- }
-
- public int read(byte[] b) {
- return nativeRead(b);
- }
- public void write(byte[] b) {
- nativeWrite(b, 0, b.length);
- }
-
- public void write(byte[] b, int offset, int len) {
- nativeWrite(b, offset, len);
- }
-
- private native void nativeBindFD(int fd);
- private native int nativeRead(byte[] b);
- private native void nativeWrite(byte[] b, int offset, int len);
- private native void nativeClose();
-
- public void close() {
- nativeClose();
- }
-}
+++ /dev/null
-public class Socket {
- /* File Descriptor */
- int fd;
- SocketInputStream sin;
- SocketOutputStream sout;
-
- public Socket() {
- sin=new SocketInputStream(this);
- sout=new SocketOutputStream(this);
- }
-
- public InputStream getInputStream() {
- return sin;
- }
-
- public OutputStream getOutputStream() {
- return sout;
- }
-
- public Socket(String host, int port) {
- InetAddress address=InetAddress.getByName(host);
- fd=nativeBind(address.getAddress(), port);
- nativeConnect(fd, address.getAddress(), port);
- sin=new SocketInputStream(this);
- sout=new SocketOutputStream(this);
- }
-
- public Socket(InetAddress address, int port) {
- fd=nativeBind(address.getAddress(), port);
- nativeConnect(fd, address.getAddress(), port);
- sin=new SocketInputStream(this);
- sout=new SocketOutputStream(this);
- }
-
- public static native int nativeBind(byte[] address, int port);
-
- public static native int nativeConnect(int fd, byte[] address, int port);
-
- int setFD(int filed) {
- fd=filed;
- }
-
- public int read(byte[] b) {
- return nativeRead(b);
- }
- public void write(byte[] b) {
- nativeWrite(b, 0, b.length);
- }
-
- public void write(byte[] b, int offset, int len) {
- nativeWrite(b, offset, len);
- }
-
- private native int nativeRead(byte[] b);
- private native void nativeWrite(byte[] b, int offset, int len);
- private native void nativeClose();
-
- public void close() {
- nativeClose();
- }
-}
+++ /dev/null
-public class StartupObject {
- flag initialstate;
-
- String [] parameters;
-}
+++ /dev/null
-/** This class is not to be used by the end user. It's intended for
- * internal use to keep track of tags. */
-
-private class TagDescriptor {
-}
+++ /dev/null
-public class Thread {
- private boolean finished;
-
- public void start() {
- nativeCreate();
- }
-
- private static void staticStart(Thread t) {
- t.run();
- }
-
- public static native void yield();
-
- public void join() {
- nativeJoin();
- }
-
- private native void nativeJoin();
-
- public native static void sleep(long millis);
-
- public void run() {
- }
-
- private native void nativeCreate();
-
-}
+++ /dev/null
-public class Thread {
- /* Don't allow overriding this method. If you do, it will break dispatch
- * because we don't have the type information necessary. */
- public boolean threadDone;
-
- public Thread() {
- threadDone = false;
- }
-
- public static native void yield();
-
- public final native void join();
-
- public final native void start(int mid);
-
- public native static void sleep(long millis);
-
- public void run() {
- }
-}
public class State {
public State() {
this.classes=new SymbolTable();
+ this.discclass=new HashSet();
this.tasks=new SymbolTable();
this.treemethodmap=new Hashtable();
this.flatmethodmap=new Hashtable();
this.tagmap=new Hashtable();
this.selfloops=new HashSet();
this.excprefetch=new HashSet();
+ this.classpath=new Vector();
}
public void addParseNode(ParseNode parsetree) {
public HashSet selfloops;
public HashSet excprefetch;
+ public Vector classpath;
+ public HashSet discclass;
public SymbolTable classes;
public SymbolTable tasks;
public Set parsetrees;
this.identifier=identifier;
this.safename = "___" + name + "___";
this.uniqueid=count++;
+ throw new Error();
}
public String getName() {
this.m_taskexitnum = 0;
}
- public void buildtree() {
- for(Iterator it=state.parsetrees.iterator(); it.hasNext();) {
- ParseNode pn=(ParseNode)it.next();
+ public void buildtree(ParseNode pn) {
parseFile(pn);
- }
}
+ Vector singleimports;
+ Vector multiimports;
+ NameDescriptor packages;
+
/** Parse the classes in this file */
public void parseFile(ParseNode pn) {
- NameDescriptor packages;
- Vector singleimports=new Vector();
- Vector multiimports=new Vector();
+ singleimports=new Vector();
+ multiimports=new Vector();
ParseNode ipn=pn.getChild("imports").getChild("import_decls_list");
if (ipn!=null) {
return new LiteralNode(literaltype, literal_obj);
} else if (isNode(pn,"createobject")) {
TypeDescriptor td=parseTypeDescriptor(pn);
+
Vector args=parseArgumentList(pn);
boolean isglobal=pn.getChild("global")!=null;
String disjointId=null;
public class SemanticCheck {
State state;
TypeUtil typeutil;
- Stack loopstack;
+ Stack loopstack;
+ HashSet toanalyze;
+ HashSet completed;
public SemanticCheck(State state, TypeUtil tu) {
this.state=state;
this.typeutil=tu;
this.loopstack=new Stack();
+ this.toanalyze=new HashSet();
+ this.completed=new HashSet();
}
- public void semanticCheck() {
- SymbolTable classtable=state.getClassSymbolTable();
- Iterator it=classtable.getDescriptorsIterator();
- // Do descriptors first
- while(it.hasNext()) {
- ClassDescriptor cd=(ClassDescriptor)it.next();
+ public ClassDescriptor getClass(String classname) {
+ ClassDescriptor cd=typeutil.getClass(classname, toanalyze);
+ if (!completed.contains(cd)) {
+ completed.add(cd);
//System.out.println("Checking class: "+cd);
//Set superclass link up
if (cd.getSuper()!=null) {
- cd.setSuper(typeutil.getClass(cd.getSuper()));
+ cd.setSuper(getClass(cd.getSuper()));
// Link together Field, Method, and Flag tables so classes
// inherit these from their superclasses
cd.getFieldTable().setParent(cd.getSuperDesc().getFieldTable());
cd.getMethodTable().setParent(cd.getSuperDesc().getMethodTable());
cd.getFlagTable().setParent(cd.getSuperDesc().getFlagTable());
}
-
+
/* Check to see that fields are well typed */
for(Iterator field_it=cd.getFields(); field_it.hasNext();) {
FieldDescriptor fd=(FieldDescriptor)field_it.next();
//System.out.println("Checking field: "+fd);
checkField(cd,fd);
}
-
+
for(Iterator method_it=cd.getMethods(); method_it.hasNext();) {
MethodDescriptor md=(MethodDescriptor)method_it.next();
checkMethod(cd,md);
}
}
+ return cd;
+ }
- it=classtable.getDescriptorsIterator();
- // Do descriptors first
- while(it.hasNext()) {
- ClassDescriptor cd=(ClassDescriptor)it.next();
- for(Iterator method_it=cd.getMethods(); method_it.hasNext();) {
- MethodDescriptor md=(MethodDescriptor)method_it.next();
- checkMethodBody(cd,md);
- }
- }
+ public void semanticCheck() {
+ SymbolTable classtable=state.getClassSymbolTable();
+ toanalyze.addAll(classtable.getValueSet());
+ //Start with any tasks
for(Iterator task_it=state.getTaskSymbolTable().getDescriptorsIterator(); task_it.hasNext();) {
TaskDescriptor td=(TaskDescriptor)task_it.next();
checkTask(td);
}
+
+ // Do methods next
+ while(!toanalyze.isEmpty()) {
+ ClassDescriptor cd=(ClassDescriptor)toanalyze.iterator().next();
+ toanalyze.remove(cd);
+ for(Iterator method_it=cd.getMethods(); method_it.hasNext();) {
+ MethodDescriptor md=(MethodDescriptor)method_it.next();
+ checkMethodBody(cd,md);
+ }
+ }
+
}
public void checkTypeDescriptor(TypeDescriptor td) {
return; /* Done */
else if (td.isClass()) {
String name=td.toString();
- ClassDescriptor field_cd=(ClassDescriptor)state.getClassSymbolTable().get(name);
+ ClassDescriptor field_cd=getClass(name);
if (field_cd==null)
throw new Error("Undefined class "+name);
td.setClassDescriptor(field_cd);
if (cn.getType()==null) {
NameDescriptor typenamed=cn.getTypeName().getName();
String typename=typenamed.toString();
- TypeDescriptor ntd=new TypeDescriptor(typeutil.getClass(typename));
+ TypeDescriptor ntd=new TypeDescriptor(getClass(typename));
cn.setType(ntd);
}
} else if (o instanceof Character) {
ln.setType(new TypeDescriptor(TypeDescriptor.CHAR));
} else if (o instanceof String) {
- ln.setType(new TypeDescriptor(typeutil.getClass(TypeUtil.StringClass)));
+ ln.setType(new TypeDescriptor(getClass(TypeUtil.StringClass)));
}
if (td!=null)
if (an.getDest().getType().isString()&&an.getOperation().getOp()==AssignOperation.PLUSEQ) {
//String add
- ClassDescriptor stringcl=typeutil.getClass(TypeUtil.StringClass);
+ ClassDescriptor stringcl=getClass(TypeUtil.StringClass);
TypeDescriptor stringtd=new TypeDescriptor(stringcl);
NameDescriptor nd=new NameDescriptor("String");
NameDescriptor valuend=new NameDescriptor(nd, "valueOf");
typetolookin=min.getExpression().getType();
} else {
//we have a type
- ClassDescriptor cd=typeutil.getClass(min.getBaseName().getSymbol());
+ ClassDescriptor cd=getClass(min.getBaseName().getSymbol());
if (cd==null)
throw new Error("md = "+ md.toString()+ " "+min.getBaseName()+" undefined");
typetolookin=new TypeDescriptor(cd);
case Operation.ADD:
if (ltd.isString()||rtd.isString()) {
- ClassDescriptor stringcl=typeutil.getClass(TypeUtil.StringClass);
+ ClassDescriptor stringcl=getClass(TypeUtil.StringClass);
TypeDescriptor stringtd=new TypeDescriptor(stringcl);
NameDescriptor nd=new NameDescriptor("String");
NameDescriptor valuend=new NameDescriptor(nd, "valueOf");
package IR;
import java.util.*;
+import IR.Tree.*;
+import java.io.File;
+import Main.Main;
public class TypeUtil {
public static final String StringClass="String";
State state;
Hashtable supertable;
Hashtable subclasstable;
+ BuildIR bir;
- public TypeUtil(State state) {
+ public TypeUtil(State state, BuildIR bir) {
this.state=state;
+ this.bir=bir;
createTables();
}
+ public void addNewClass(String cl) {
+ if (state.discclass.contains(cl))
+ return;
+ for(int i=0;i<state.classpath.size();i++) {
+ String path=(String)state.classpath.get(i);
+ File f=new File(path, cl+".java");
+ if (f.exists()) {
+ try {
+ ParseNode pn=Main.readSourceFile(state, f.getCanonicalPath());
+ bir.buildtree(pn);
+ state.discclass.add(cl);
+ return;
+ } catch (Exception e) {
+ throw new Error(e);
+ }
+ }
+ }
+ throw new Error("Couldn't find class "+cl);
+ }
+
+
+
public ClassDescriptor getClass(String classname) {
ClassDescriptor cd=(ClassDescriptor)state.getClassSymbolTable().get(classname);
return cd;
}
- private void createTables() {
- supertable=new Hashtable();
-
- Iterator classit=state.getClassSymbolTable().getDescriptorsIterator();
- while(classit.hasNext()) {
- ClassDescriptor cd=(ClassDescriptor)classit.next();
+ public ClassDescriptor getClass(String classname, HashSet todo) {
+ ClassDescriptor cd=(ClassDescriptor)state.getClassSymbolTable().get(classname);
+ if (cd==null) {
+ //have to find class
+ addNewClass(classname);
+ cd=(ClassDescriptor)state.getClassSymbolTable().get(classname);
+ System.out.println("Build class:"+cd);
+ todo.add(cd);
+ }
+ if (!supertable.containsKey(cd)) {
String superc=cd.getSuper();
if (superc!=null) {
- ClassDescriptor cd_super=getClass(superc);
- if (cd_super==null) {
- throw new Error("Couldn't find class:"+superc);
- }
+ ClassDescriptor cd_super=getClass(superc, todo);
supertable.put(cd,cd_super);
}
}
+ return cd;
+ }
+
+ private void createTables() {
+ supertable=new Hashtable();
}
public ClassDescriptor getMainClass() {
public static void main(String args[]) throws Exception {
String ClassLibraryPrefix="./ClassLibrary/";
State state=new State();
+ Vector sourcefiles=new Vector();
+ state.classpath.add(".");
for(int i=0; i<args.length; i++) {
String option=args[i];
else if (option.equals("-excprefetch"))
state.excprefetch.add(args[++i]);
else if (option.equals("-classlibrary"))
- ClassLibraryPrefix=args[++i]+"/";
+ state.classpath.add(args[++i]);
else if(option.equals("-numcore")) {
++i;
state.CORENUM = Integer.parseInt(args[i]);
System.out.println("-help -- print out help");
System.exit(0);
} else {
- readSourceFile(state, args[i]);
+ if (args[i].indexOf(".java")!=-1)
+ sourcefiles.add(args[i].substring(0,args[i].indexOf(".java")));
+ else
+ sourcefiles.add(args[i]);
}
}
-
- readSourceFile(state, ClassLibraryPrefix+"System.java");
- readSourceFile(state, ClassLibraryPrefix+"String.java");
- readSourceFile(state, ClassLibraryPrefix+"HashSet.java");
- readSourceFile(state, ClassLibraryPrefix+"HashMap.java");
- readSourceFile(state, ClassLibraryPrefix+"HashMapIterator.java");
- readSourceFile(state, ClassLibraryPrefix+"HashEntry.java");
- readSourceFile(state, ClassLibraryPrefix+"Integer.java");
- readSourceFile(state, ClassLibraryPrefix+"StringBuffer.java");
- //if(!state.RAW) {
- readSourceFile(state, ClassLibraryPrefix+"FileInputStream.java");
- readSourceFile(state, ClassLibraryPrefix+"PushbackInputStream.java");
- readSourceFile(state, ClassLibraryPrefix+"InputStream.java");
- readSourceFile(state, ClassLibraryPrefix+"OutputStream.java");
- readSourceFile(state, ClassLibraryPrefix+"FileOutputStream.java");
- readSourceFile(state, ClassLibraryPrefix+"File.java");
- readSourceFile(state, ClassLibraryPrefix+"InetAddress.java");
- readSourceFile(state, ClassLibraryPrefix+"SocketInputStream.java");
- readSourceFile(state, ClassLibraryPrefix+"SocketOutputStream.java");
- readSourceFile(state, ClassLibraryPrefix+"gnu/StringTokenizer.java");
- //}
- readSourceFile(state, ClassLibraryPrefix+"Math.java");
- readSourceFile(state, ClassLibraryPrefix+"gnu/Random.java");
- readSourceFile(state, ClassLibraryPrefix+"Vector.java");
- readSourceFile(state, ClassLibraryPrefix+"Enumeration.java");
- readSourceFile(state, ClassLibraryPrefix+"Dictionary.java");
- readSourceFile(state, ClassLibraryPrefix+"Writer.java");
- readSourceFile(state, ClassLibraryPrefix+"BufferedWriter.java");
- readSourceFile(state, ClassLibraryPrefix+"OutputStreamWriter.java");
- readSourceFile(state, ClassLibraryPrefix+"FileWriter.java");
- readSourceFile(state, ClassLibraryPrefix+"Date.java");
-
- if (state.TASK) {
- if (state.FASTCHECK)
- readSourceFile(state, ClassLibraryPrefix+"ObjectFC.java");
- else
- readSourceFile(state, ClassLibraryPrefix+"Object.java");
- readSourceFile(state, ClassLibraryPrefix+"TagDescriptor.java");
- } else if (state.DSM) {
- readSourceFile(state, ClassLibraryPrefix+"ThreadDSM.java");
- readSourceFile(state, ClassLibraryPrefix+"ObjectJavaDSM.java");
- readSourceFile(state, ClassLibraryPrefix+"Barrier.java");
- } else {
- if (state.THREAD) {
- readSourceFile(state, ClassLibraryPrefix+"Thread.java");
- readSourceFile(state, ClassLibraryPrefix+"ObjectJava.java");
- } else
- readSourceFile(state, ClassLibraryPrefix+"ObjectJavaNT.java");
- }
-
- if (state.TASK) {
- readSourceFile(state, ClassLibraryPrefix+"StartupObject.java");
- readSourceFile(state, ClassLibraryPrefix+"Socket.java");
- readSourceFile(state, ClassLibraryPrefix+"ServerSocket.java");
- } else {
- readSourceFile(state, ClassLibraryPrefix+"SocketJava.java");
- readSourceFile(state, ClassLibraryPrefix+"ServerSocketJava.java");
- }
+ //add default classpath
+ if (state.classpath.size()==1)
+ state.classpath.add(ClassLibraryPrefix);
BuildIR bir=new BuildIR(state);
- bir.buildtree();
-
- TypeUtil tu=new TypeUtil(state);
+ TypeUtil tu=new TypeUtil(state, bir);
+
SemanticCheck sc=new SemanticCheck(state,tu);
+ for(int i=0;i<sourcefiles.size();i++)
+ sc.getClass((String)sourcefiles.get(i));
+
+ //Stuff the runtime wants to see
+ sc.getClass("String");
+ sc.getClass("Math");
+ sc.getClass("File");
+ sc.getClass("Socket");
+ sc.getClass("ServerSocket");
+ sc.getClass("FileInputStream");
+ sc.getClass("FileOutputStream");
+
sc.semanticCheck();
+
tu.createFullTable();
BuildFlat bf=new BuildFlat(state,tu);
if (state.TAGSTATE) {
CallGraph callgraph=new CallGraph(state);
TagAnalysis taganalysis=new TagAnalysis(state, callgraph);
- TaskTagAnalysis tta=new TaskTagAnalysis(state, taganalysis);
+ TaskTagAnalysis tta=new TaskTagAnalysis(state, taganalysis, tu);
}
if (state.TASKSTATE) {
CallGraph callgraph=new CallGraph(state);
TagAnalysis taganalysis=new TagAnalysis(state, callgraph);
- TaskAnalysis ta=new TaskAnalysis(state, taganalysis);
+ TaskAnalysis ta=new TaskAnalysis(state, taganalysis, tu);
ta.taskAnalysis();
TaskGraph tg=new TaskGraph(state, ta);
tg.createDOTfiles();
/** Reads in a source file and adds the parse tree to the state object. */
- private static void readSourceFile(State state, String sourcefile) throws Exception {
- Reader fr = new BufferedReader(new FileReader(sourcefile));
- Lex.Lexer l = new Lex.Lexer(fr);
- java_cup.runtime.lr_parser g;
- g = new Parse.Parser(l);
- ParseNode p=null;
+ public static ParseNode readSourceFile(State state, String sourcefile) {
try {
- p=(ParseNode) g./*debug_*/ parse().value;
+ Reader fr= new BufferedReader(new FileReader(sourcefile));
+ Lex.Lexer l = new Lex.Lexer(fr);
+ java_cup.runtime.lr_parser g;
+ g = new Parse.Parser(l);
+ ParseNode p=null;
+ try {
+ p=(ParseNode) g./*debug_*/ parse().value;
+ } catch (Exception e) {
+ System.err.println("Error parsing file:"+sourcefile);
+ e.printStackTrace();
+ System.exit(-1);
+ }
+ state.addParseNode(p);
+ if (l.numErrors()!=0) {
+ System.out.println("Error parsing "+sourcefile);
+ System.exit(l.numErrors());
+ }
+ return p;
+
} catch (Exception e) {
- System.err.println("Error parsing file:"+sourcefile);
- e.printStackTrace();
- System.exit(-1);
- }
- state.addParseNode(p);
- if (l.numErrors()!=0) {
- System.out.println("Error parsing "+sourcefile);
- System.exit(l.numErrors());
+ throw new Error(e);
}
}
}
JAVAOPTS="$JAVAOPTS -struct structfile"
fi
+# Setup class path
+
+if $RECOVERFLAG
+then
+if $FASTCHECK
+then
+#fast transactions
+JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/FastCheck"
+fi
+#base bristlecone files
+JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/Bristlecone"
+else
+if $DSMFLAG
+then
+#dsm stuff
+JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaDSM"
+elif $THREADFLAG
+then
+#threading java stuff
+JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/JavaThread"
+fi
+#base java stuff
+JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/Java"
+fi
+
# Build bristlecone/java sources
if $MULTICOREFLAG
then
if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx800m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
-$ROBUSTROOT/ClassLibrary/ -dir $BUILDDIR \
-$JAVAOPTS $SRCFILES
+$ROBUSTROOT/ClassLibrary/ -classlibrary $ROBUSTROOT/ClassLibrary/gnu/ \
+-dir $BUILDDIR $JAVAOPTS $SRCFILES
then exit $?
fi
else
if ! $NOJAVA
then
if ! ${ROBUSTROOT}/ourjava -Xms50m -Xmx600m $JAVAFORWARDOPTS -classpath $ROBUSTROOT/../cup/:$ROBUSTROOT Main.Main -classlibrary \
-$ROBUSTROOT/ClassLibrary/ -dir $BUILDDIR -precise \
+$ROBUSTROOT/ClassLibrary/ -classlibrary $ROBUSTROOT/ClassLibrary/gnu/ -dir $BUILDDIR -precise \
$JAVAOPTS $SRCFILES
then exit $?
fi