From b1b8125b2fe58d34021fcdde58c637c85bbfa8a9 Mon Sep 17 00:00:00 2001 From: jzhou Date: Fri, 25 Feb 2011 19:39:33 +0000 Subject: [PATCH] Make new field naming strategy work for MGC --- Robust/src/IR/Flat/BuildCode.java | 29 ++++++++++++-------- Robust/src/Runtime/bamboo/multicoreruntime.c | 12 ++++---- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index b90eee93..cfa6eb7c 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -66,7 +66,7 @@ public class BuildCode { DiscoverConflicts recorddc; DCWrapper delaycomp; CallGraph callgraph; - Hashtable printedfieldstbl; + Hashtable printedfieldstbl; public BuildCode(State st, Hashtable temptovar, TypeUtil typeutil, SafetyAnalysis sa, PrefetchAnalysis pa) { @@ -111,7 +111,7 @@ public class BuildCode { recorddc=new DiscoverConflicts(locality, st, typeanalysis, delaycomp.getCannotDelayMap(), true, true, null); recorddc.doAnalysis(); } - printedfieldstbl = new Hashtable(); + printedfieldstbl = new Hashtable(); } /** The buildCode method outputs C code for all the methods. The Flat @@ -1489,7 +1489,7 @@ public class BuildCode { printClassStruct(si, classdefout, /*globaldefout*/ null); } } - + if (!fieldorder.containsKey(cn)) { Vector fields=new Vector(); fieldorder.put(cn,fields); @@ -1522,18 +1522,24 @@ public class BuildCode { } } } - Vector fields=(Vector)fieldorder.get(cn); + //Vector fields=(Vector)fieldorder.get(cn); - /*Vector */ fields = cn.getFieldVec(); + Vector fields = cn.getFieldVec(); for(int i=0; i(); classdefout.println("};\n"); if (state.DSM||state.SINGLETM) { @@ -3313,8 +3319,7 @@ public class BuildCode { // redirect to the global_defs_p structure if((ffn.getField().isStatic()) || (ffn.getSrc().getType().isClassNameRef())) { // reference to the static field with Class name - output.println(generateTemp(fm, ffn.getDst(),lb)+"=global_defs_p->"+ - ffn.getField().getClassDescriptor().getSafeSymbol()+ffn.getField().getSafeSymbol()+";"); + output.println(generateTemp(fm, ffn.getDst(),lb)+"=global_defs_p->"+ffn.getField().getSafeSymbol()+";"); } else { output.println(generateTemp(fm, ffn.getDst(),lb)+"=*"+ generateTemp(fm,ffn.getSrc(),lb)+"->"+ ffn.getField().getSafeSymbol()+";"); } diff --git a/Robust/src/Runtime/bamboo/multicoreruntime.c b/Robust/src/Runtime/bamboo/multicoreruntime.c index 09ffaf33..75928f58 100644 --- a/Robust/src/Runtime/bamboo/multicoreruntime.c +++ b/Robust/src/Runtime/bamboo/multicoreruntime.c @@ -225,11 +225,11 @@ long long CALL00(___System______currentTimeMillis____) { void CALL01(___System______printString____L___String___,struct ___String___ * ___s___) { #ifdef MGC #ifdef TILERA_BME - struct ArrayObject * chararray=VAR(___s___)->___String______value___; + struct ArrayObject * chararray=VAR(___s___)->___value___; int i; - int offset=VAR(___s___)->___String______offset___; + int offset=VAR(___s___)->___offset___; tprintf(""); - for(i=0; i___String______count___; i++) { + for(i=0; i___count___; i++) { short sc= ((short *)(((char *)&chararray->___length___)+sizeof(int)))[i+offset]; printf("%c", sc); @@ -328,9 +328,9 @@ struct ___String___ * NewString(const char *str,int length) { struct ArrayObject * chararray=allocate_newarray(CHARARRAYTYPE, length); struct ___String___ * strobj=allocate_new(STRINGTYPE); #endif - strobj->___String______value___=chararray; - strobj->___String______count___=length; - strobj->___String______offset___=0; + strobj->___value___=chararray; + strobj->___count___=length; + strobj->___offset___=0; for(i=0; i___length___)+sizeof(int)))[i]=(short)str[i]; -- 2.34.1