changes to make compiler work without STM flag with atomic statements/etc
authorbdemsky <bdemsky>
Thu, 16 Apr 2009 08:41:47 +0000 (08:41 +0000)
committerbdemsky <bdemsky>
Thu, 16 Apr 2009 08:41:47 +0000 (08:41 +0000)
Robust/src/IR/Flat/BuildCode.java
Robust/src/Runtime/runtime.c

index b0e619034e1b9e9885c0b6b021db3809b9c27a1e..2b2c9c703757bf1c65f7b7669e918a2bf943b6af 100644 (file)
@@ -1940,7 +1940,7 @@ public class BuildCode {
 
   public void generateFlatAtomicEnterNode(FlatMethod fm,  LocalityBinding lb, FlatAtomicEnterNode faen, PrintWriter output) {
     /* Check to see if we need to generate code for this atomic */
-    if (locality.getAtomic(lb).get(faen.getPrev(0)).intValue()>0)
+    if (locality==null||locality.getAtomic(lb).get(faen.getPrev(0)).intValue()>0)
       return;
     /* Backup the temps. */
     for(Iterator<TempDescriptor> tmpit=locality.getTemps(lb).get(faen).iterator(); tmpit.hasNext();) {
@@ -1983,7 +1983,7 @@ public class BuildCode {
 
   public void generateFlatAtomicExitNode(FlatMethod fm,  LocalityBinding lb, FlatAtomicExitNode faen, PrintWriter output) {
     /* Check to see if we need to generate code for this atomic */
-    if (locality.getAtomic(lb).get(faen).intValue()>0)
+    if (locality==null||locality.getAtomic(lb).get(faen).intValue()>0)
       return;
     //store the revert list before we lose the transaction object
     String revertptr=null;
@@ -2517,7 +2517,7 @@ public class BuildCode {
       }
     } else if (fn.getType().isArray()) {
       int arrayid=state.getArrayNumber(fn.getType())+state.numClasses();
-      if (fn.isGlobal()) {
+      if (fn.isGlobal()&&(state.DSM||state.SINGLETM)) {
        output.println(generateTemp(fm,fn.getDst(),lb)+"=allocate_newarrayglobal("+arrayid+", "+generateTemp(fm, fn.getSize(),lb)+");");
       } else if (GENERATEPRECISEGC) {
        output.println(generateTemp(fm,fn.getDst(),lb)+"=allocate_newarray(&"+localsprefix+", "+arrayid+", "+generateTemp(fm, fn.getSize(),lb)+");");
index a4acf054deb62d934e10f0431785c5a08b79642a..1a2fc92046605b17af28006659e541964992bf47 100644 (file)
@@ -126,7 +126,7 @@ void CALL11(___System______printI____I,int ___status___, int ___status___) {
   printf("%d\n",___status___);
 }
 
-long CALL00(___System______currentTimeMillis____) {
+long long CALL00(___System______currentTimeMillis____) {
   struct timeval tv; long long retval;
   gettimeofday(&tv, NULL);
   retval = tv.tv_sec; /* seconds */