From 187ed326196b9db458b3f103235ec47d55ac0967 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Thu, 16 Apr 2009 08:41:47 +0000 Subject: [PATCH] changes to make compiler work without STM flag with atomic statements/etc --- Robust/src/IR/Flat/BuildCode.java | 6 +++--- Robust/src/Runtime/runtime.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index b0e61903..2b2c9c70 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -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 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)+");"); diff --git a/Robust/src/Runtime/runtime.c b/Robust/src/Runtime/runtime.c index a4acf054..1a2fc920 100644 --- a/Robust/src/Runtime/runtime.c +++ b/Robust/src/Runtime/runtime.c @@ -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 */ -- 2.34.1