From: bdemsky Date: Thu, 16 Apr 2009 07:31:22 +0000 (+0000) Subject: bug fixes. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d67b694479e48d4c78889e373fb8ef2a8dc6f051;p=IRC.git bug fixes. --- diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index 91398dc4..b0e61903 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -1299,7 +1299,11 @@ public class BuildCode { } /********* Output method declaration ***********/ - + if (state.DSM||state.SINGLETM) { + headersout.println("#define D"+cn.getSafeSymbol()+lb.getSignature()+md.getSafeSymbol()+"_"+md.getSafeMethodDescriptor()+" 1"); + } else { + headersout.println("#define D"+cn.getSafeSymbol()+md.getSafeSymbol()+"_"+md.getSafeMethodDescriptor()+" 1"); + } /* First the return type */ if (md.getReturnType()!=null) { if (md.getReturnType().isClass()||md.getReturnType().isArray()) @@ -1313,9 +1317,9 @@ public class BuildCode { /* Next the method name */ if (state.DSM||state.SINGLETM) { headersout.print(cn.getSafeSymbol()+lb.getSignature()+md.getSafeSymbol()+"_"+md.getSafeMethodDescriptor()+"("); - } else + } else { headersout.print(cn.getSafeSymbol()+md.getSafeSymbol()+"_"+md.getSafeMethodDescriptor()+"("); - + } boolean printcomma=false; if (GENERATEPRECISEGC) { if (state.DSM||state.SINGLETM) { @@ -1452,7 +1456,7 @@ public class BuildCode { if (state.DSM&&lb.isAtomic()) output.println("if (needtocollect) checkcollect2(&"+localsprefix+");"); else - output.println("if (needtocollect) checkcollect(&"+localsprefix+");"); + output.println("if (needtocollect) checkcollect(&"+localsprefix+");"); } generateCode( fm.getNext(0), fm, lb, null, output ); @@ -1702,7 +1706,7 @@ public class BuildCode { if(state.DSM&&locality.getAtomic(lb).get(fn).intValue()>0) { output.println("if (needtocollect) checkcollect2(&"+localsprefix+");"); } else - output.println("if (needtocollect) checkcollect(&"+localsprefix+");"); + output.println("if (needtocollect) checkcollect(&"+localsprefix+");"); } else output.println("/* nop */"); return; diff --git a/Robust/src/Runtime/STM/stm.c b/Robust/src/Runtime/STM/stm.c index 658356aa..6543380c 100644 --- a/Robust/src/Runtime/STM/stm.c +++ b/Robust/src/Runtime/STM/stm.c @@ -222,9 +222,7 @@ void freenewobjs() { * ================================================================ */ int transCommit() { -#ifdef TRANSSTATS int softaborted=0; -#endif do { /* Look through all the objects in the transaction hash table */ int finalResponse; @@ -260,8 +258,8 @@ int transCommit() { if(finalResponse == TRANS_SOFT_ABORT) { #ifdef TRANSSTATS nSoftAbort++; - softaborted++; #endif + softaborted++; if (softaborted>4) { //retry if to many soft aborts freenewobjs(); @@ -367,11 +365,11 @@ int traverseCache() { /* Decide the final response */ if (softabort) { transAbortProcess(oidrdlocked, &numoidrdlocked, oidwrlocked, &numoidwrlocked); - DEBUGSTM("Softabort\n"); + DEBUGSTM("Soft Abort: rd: %u wr: %u tot: %u\n", numoidrdlocked, numoidwrlocked, c_numelements); return TRANS_SOFT_ABORT; } else { transCommitProcess(oidrdlocked, &numoidrdlocked, oidwrlocked, &numoidwrlocked); - DEBUGSTM("Commit\n"); + DEBUGSTM("Commit: rd: %u wr: %u tot: %u\n", numoidrdlocked, numoidwrlocked, c_numelements); return TRANS_COMMIT; } } @@ -459,11 +457,11 @@ int alttraverseCache() { /* Decide the final response */ if (softabort) { transAbortProcess(oidrdlocked, &numoidrdlocked, oidwrlocked, &numoidwrlocked); - DEBUGSTM("Softabort\n"); + DEBUGSTM("Soft Abort: rd: %u wr: %u tot: %u\n", numoidrdlocked, numoidwrlocked, c_numelements); return TRANS_SOFT_ABORT; } else { transCommitProcess(oidrdlocked, &numoidrdlocked, oidwrlocked, &numoidwrlocked); - DEBUGSTM("Commit\n"); + DEBUGSTM("Commit: rd: %u wr: %u tot: %u\n", numoidrdlocked, numoidwrlocked, c_numelements); return TRANS_COMMIT; } } diff --git a/Robust/src/Runtime/runtime.c b/Robust/src/Runtime/runtime.c index 23a0aaa5..0d6c2c3f 100644 --- a/Robust/src/Runtime/runtime.c +++ b/Robust/src/Runtime/runtime.c @@ -113,12 +113,13 @@ void CALL11(___System______exit____I,int ___status___, int ___status___) { exit(___status___); } +#ifdef D___Vector______removeElement_____AR_L___Object____I void CALL12(___Vector______removeElement_____AR_L___Object____I, int ___index___, struct ArrayObject * ___array___, int ___index___) { int length=VAR(___array___)->___length___; char* offset=((char *)(&VAR(___array___)->___length___))+sizeof(unsigned int)+sizeof(void *)*___index___; memmove(offset, offset+sizeof(void *),(length-___index___-1)*sizeof(void *)); } - +#endif void CALL11(___System______printI____I,int ___status___, int ___status___) { printf("%d\n",___status___);