From: jzhou Date: Thu, 24 Feb 2011 01:04:32 +0000 (+0000) Subject: Fix a shadow field related bug in the compiler. Defined in Java language specificatio... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d69f4fd2a29d864321f01ffc2b0a642e8fd80ed1;p=IRC.git Fix a shadow field related bug in the compiler. Defined in Java language specification, if the class declares a field with a certain name, then the declaration of that field is said to hide any and all accessible declarations of fields with the same name in superclasses, and superinterfaces of the class. However, the hidden fields in superclasses or superinterfaces can still be accessed by using a qualified name (if it is static) or by using a field access expression that contains the keyword super or a cast to a superclass type. Previously, our compiler simply discarded all the hidden fields so that the hidden fields can never be accessed. Now we maitain all the fields including the hidden ones. We prefix the name of the class that defines the field to the field's name to differentiate the shadow field and the hidden fields. Some of the hard coded fields dereference in the Runtime C code are fixed accordingly. Now the unit tests, multicore benchmarks and oooJava related benchmarks are checked to be OK. But (D)STM related Runtime code are NOT checked yet. --- diff --git a/Robust/src/IR/ClassDescriptor.java b/Robust/src/IR/ClassDescriptor.java index 3ca241e0..86babe8d 100644 --- a/Robust/src/IR/ClassDescriptor.java +++ b/Robust/src/IR/ClassDescriptor.java @@ -202,6 +202,7 @@ public class ClassDescriptor extends Descriptor { if(fd.isStatic()) { this.incStaticFields(); } + fd.setClassDescriptor(this); } public void addMethod(MethodDescriptor md) { diff --git a/Robust/src/IR/FieldDescriptor.java b/Robust/src/IR/FieldDescriptor.java index ce515321..26b47179 100644 --- a/Robust/src/IR/FieldDescriptor.java +++ b/Robust/src/IR/FieldDescriptor.java @@ -19,6 +19,8 @@ public class FieldDescriptor extends Descriptor { private boolean isglobal; private boolean isenum; private int enumvalue; + + private ClassDescriptor cn; public FieldDescriptor(Modifiers m, TypeDescriptor t, String identifier, ExpressionNode e, boolean isglobal) { super(identifier); @@ -32,6 +34,14 @@ public class FieldDescriptor extends Descriptor { this.enumvalue = -1; } + public ClassDescriptor getClassDescriptor() { + return this.cn; + } + + public void setClassDescriptor(ClassDescriptor cn) { + this.cn = cn; + } + public boolean isEnum() { return this.isenum; } diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index d5f00a29..0fe70ab4 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -67,8 +67,6 @@ public class BuildCode { DCWrapper delaycomp; CallGraph callgraph; Hashtable printedfieldstbl; - Hashtable> cd2fieldstbl; - Hashtable> cd2shadowfields; public BuildCode(State st, Hashtable temptovar, TypeUtil typeutil, SafetyAnalysis sa, PrefetchAnalysis pa) { @@ -115,8 +113,6 @@ public class BuildCode { recorddc.doAnalysis(); } printedfieldstbl = new Hashtable(); - cd2fieldstbl = new Hashtable>(); - cd2shadowfields = new Hashtable>(); } /** The buildCode method outputs C code for all the methods. The Flat @@ -1415,7 +1411,8 @@ public class BuildCode { continue; if (type.isPtr()) { output.println(","); - output.print("((unsigned INTPTR)&(((struct "+cn.getSafeSymbol() +" *)0)->"+fd.getSafeSymbol()+"))"); + output.print("((unsigned INTPTR)&(((struct "+cn.getSafeSymbol() +" *)0)->"+ + (fd.getClassDescriptor()==null?"":fd.getClassDescriptor().getSafeSymbol())+fd.getSafeSymbol()+"))"); } } output.println("};"); @@ -1504,7 +1501,6 @@ public class BuildCode { if (sp!=null) printClassStruct(sp, classdefout, /*globaldefout*/null); - // TODO: what about here are multiple inherited fields with the same name? SymbolTable sitbl = cn.getSuperInterfaceTable(); Iterator it_sifs = sitbl.getDescriptorsIterator(); if(state.MGC) { @@ -1513,21 +1509,17 @@ public class BuildCode { printClassStruct(si, classdefout, /*globaldefout*/null); } } - - Vector shadow_fields = null; if (!fieldorder.containsKey(cn)) { Vector fields=new Vector(); fieldorder.put(cn,fields); - shadow_fields = new Vector(); - cd2shadowfields.put(cn, shadow_fields); Vector fieldvec=cn.getFieldVec(); for(int i=0;i(); + printedfieldstbl.clear(); classdefout.println("};\n"); if (state.DSM||state.SINGLETM) { @@ -2127,12 +2082,7 @@ public class BuildCode { FieldDescriptor fd=(FieldDescriptor)fields.get(i); if(fd.isStatic()) { // static field - // decide the exact class/interface that defines the field - ClassDescriptor fdcn = - cd2fieldstbl.get(cn).get(fd.getSymbol()); - - // static field - output.println(generateTemp(fm,fm.getParameter(0),lb)+"->"+fd.getSafeSymbol()+"=&(global_defs_p->"+fdcn.getSafeSymbol()+fd.getSafeSymbol()+");"); + output.println(generateTemp(fm,fm.getParameter(0),lb)+"->"+cn.getSafeSymbol()+fd.getSafeSymbol()+"=&(global_defs_p->"+fd.getClassDescriptor().getSafeSymbol()+fd.getSafeSymbol()+");"); } } } @@ -2673,7 +2623,8 @@ public class BuildCode { public void generateFlatOffsetNode(FlatMethod fm, LocalityBinding lb, FlatOffsetNode fofn, PrintWriter output) { output.println("/* FlatOffsetNode */"); FieldDescriptor fd=fofn.getField(); - output.println(generateTemp(fm, fofn.getDst(),lb)+ " = (short)(int) (&((struct "+fofn.getClassType().getSafeSymbol() +" *)0)->"+ fd.getSafeSymbol()+");"); + output.println(generateTemp(fm, fofn.getDst(),lb)+ " = (short)(int) (&((struct "+fofn.getClassType().getSafeSymbol() +" *)0)->"+ + (fd.getClassDescriptor()==null?"":fd.getClassDescriptor().getSafeSymbol()) + fd.getSafeSymbol()+");"); output.println("/* offset */"); } @@ -2787,9 +2738,11 @@ public class BuildCode { if (!teststr.equals("")) teststr+="&&"; teststr+="((prefptr="+basestr+")!=NULL)"; - basestr="((struct "+lasttype.getSafeSymbol()+" *)prefptr)->"+fd.getSafeSymbol(); + basestr="((struct "+lasttype.getSafeSymbol()+" *)prefptr)->"+ + (fd.getClassDescriptor()==null?"":fd.getClassDescriptor().getSafeSymbol())+fd.getSafeSymbol(); } else { - basestr=basestr+"->"+fd.getSafeSymbol(); + basestr=basestr+"->"+ + (fd.getClassDescriptor()==null?"":fd.getClassDescriptor().getSafeSymbol())+fd.getSafeSymbol(); maybenull=true; } lasttype=fd.getType(); @@ -2823,7 +2776,8 @@ public class BuildCode { Object desc = pp.getDescAt(i); if(desc instanceof FieldDescriptor) { FieldDescriptor fd=(FieldDescriptor)desc; - newfieldoffset = new String("(unsigned int)(&(((struct "+ lasttype.getSafeSymbol()+" *)0)->"+ fd.getSafeSymbol()+ "))"); + newfieldoffset = new String("(unsigned int)(&(((struct "+ lasttype.getSafeSymbol()+" *)0)->"+ + (fd.getClassDescriptor()==null?"":fd.getClassDescriptor().getSafeSymbol()) + fd.getSafeSymbol()+ "))"); lasttype=fd.getType(); } else { newfieldoffset = ""; @@ -3298,7 +3252,7 @@ public class BuildCode { private void generateFlatFieldNode(FlatMethod fm, LocalityBinding lb, FlatFieldNode ffn, PrintWriter output) { if (state.SINGLETM) { //single machine transactional memory case - String field=ffn.getField().getSafeSymbol(); + String field=(ffn.getField().getClassDescriptor()==null?"":ffn.getField().getClassDescriptor().getSafeSymbol()) + ffn.getField().getSafeSymbol(); String src=generateTemp(fm, ffn.getSrc(),lb); String dst=generateTemp(fm, ffn.getDst(),lb); @@ -3318,7 +3272,7 @@ public class BuildCode { } else if (state.DSM) { Integer status=locality.getNodePreTempInfo(lb,ffn).get(ffn.getSrc()); if (status==LocalityAnalysis.GLOBAL) { - String field=ffn.getField().getSafeSymbol(); + String field=(ffn.getField().getClassDescriptor()==null?"":ffn.getField().getClassDescriptor().getSafeSymbol()) + ffn.getField().getSafeSymbol(); String src=generateTemp(fm, ffn.getSrc(),lb); String dst=generateTemp(fm, ffn.getDst(),lb); @@ -3348,7 +3302,7 @@ public class BuildCode { } else if (status==LocalityAnalysis.LOCAL) { if (ffn.getField().getType().isPtr()&& ffn.getField().isGlobal()) { - String field=ffn.getField().getSafeSymbol(); + String field=(ffn.getField().getClassDescriptor()==null?"":ffn.getField().getClassDescriptor().getSafeSymbol()) + ffn.getField().getSafeSymbol(); String src=generateTemp(fm, ffn.getSrc(),lb); String dst=generateTemp(fm, ffn.getDst(),lb); output.println(dst+"="+ src +"->"+field+ ";"); @@ -3401,23 +3355,23 @@ public class BuildCode { } // redirect to the global_defs_p structure if((ffn.getField().isStatic()) || (ffn.getSrc().getType().isClassNameRef())) { - // decide the exact class/interface that defines the field - ClassDescriptor fdcn = - cd2fieldstbl.get(ffn.getSrc().getType().getClassDesc()).get(ffn.getField().getSymbol()); - // reference to the static field with Class name - output.println(generateTemp(fm, ffn.getDst(),lb)+"=global_defs_p->"+ fdcn.getSafeSymbol()+ffn.getField().getSafeSymbol()+";"); + output.println(generateTemp(fm, ffn.getDst(),lb)+"=global_defs_p->"+ + ffn.getField().getClassDescriptor().getSafeSymbol()+ffn.getField().getSafeSymbol()+";"); } else { - output.println(generateTemp(fm, ffn.getDst(),lb)+"=*"+ generateTemp(fm,ffn.getSrc(),lb)+"->"+ ffn.getField().getSafeSymbol()+";"); + output.println(generateTemp(fm, ffn.getDst(),lb)+"=*"+ generateTemp(fm,ffn.getSrc(),lb)+"->"+ + (ffn.getField().getClassDescriptor()==null?"":ffn.getField().getClassDescriptor().getSafeSymbol()) + ffn.getField().getSafeSymbol()+";"); } } else if (ffn.getField().isEnum()) { // an Enum value, directly replace the field access as int output.println(generateTemp(fm, ffn.getDst(), lb) + "=" + ffn.getField().enumValue() + ";"); } else { - output.println(generateTemp(fm, ffn.getDst(),lb)+"="+ generateTemp(fm,ffn.getSrc(),lb)+"->"+ ffn.getField().getSafeSymbol()+";"); + output.println(generateTemp(fm, ffn.getDst(),lb)+"="+ generateTemp(fm,ffn.getSrc(),lb)+"->"+ + (ffn.getField().getClassDescriptor()==null?"":ffn.getField().getClassDescriptor().getSafeSymbol()) + ffn.getField().getSafeSymbol()+";"); } } else { - output.println(generateTemp(fm, ffn.getDst(),lb)+"="+ generateTemp(fm,ffn.getSrc(),lb)+"->"+ ffn.getField().getSafeSymbol()+";"); + output.println(generateTemp(fm, ffn.getDst(),lb)+"="+ generateTemp(fm,ffn.getSrc(),lb)+"->"+ + (ffn.getField().getClassDescriptor()==null?"":ffn.getField().getClassDescriptor().getSafeSymbol()) + ffn.getField().getSafeSymbol()+";"); } } } @@ -3449,10 +3403,12 @@ public class BuildCode { output.println("*((unsigned int *)&("+dst+"->___objstatus___))|=DIRTY;"); } if (srcptr&!fsfn.getSrc().getType().isNull()) { - output.println("*((unsigned INTPTR *)&("+dst+"->"+ fsfn.getField().getSafeSymbol()+"))=srcoid;"); + output.println("*((unsigned INTPTR *)&("+dst+"->"+ + (fsfn.getField().getClassDescriptor()==null?"":fsfn.getField().getClassDescriptor().getSafeSymbol()) + fsfn.getField().getSafeSymbol()+"))=srcoid;"); output.println("}"); } else { - output.println(dst+"->"+ fsfn.getField().getSafeSymbol()+"="+ src+";"); + output.println(dst+"->"+ + (fsfn.getField().getClassDescriptor()==null?"":fsfn.getField().getClassDescriptor().getSafeSymbol()) + fsfn.getField().getSafeSymbol()+"="+ src+";"); } } else if (state.DSM && locality.getAtomic(lb).get(fsfn).intValue()>0) { Integer statussrc=locality.getNodePreTempInfo(lb,fsfn).get(fsfn.getSrc()); @@ -3471,9 +3427,11 @@ public class BuildCode { if (wb.needBarrier(fsfn)) output.println("*((unsigned int *)&("+dst+"->___localcopy___))|=DIRTY;"); if (srcglobal) { - output.println("*((unsigned INTPTR *)&("+glbdst+"->"+ fsfn.getField().getSafeSymbol()+"))=srcoid;"); + output.println("*((unsigned INTPTR *)&("+glbdst+"->"+ + (fsfn.getField().getClassDescriptor()==null?"":fsfn.getField().getClassDescriptor().getSafeSymbol()) + fsfn.getField().getSafeSymbol()+"))=srcoid;"); } else - output.println(glbdst+"->"+ fsfn.getField().getSafeSymbol()+"="+ src+";"); + output.println(glbdst+"->"+ + (fsfn.getField().getClassDescriptor()==null?"":fsfn.getField().getClassDescriptor().getSafeSymbol()) + fsfn.getField().getSafeSymbol()+"="+ src+";"); } else if (statusdst.equals(LocalityAnalysis.LOCAL)) { /** Check if we need to copy */ output.println("if(!"+dst+"->"+localcopystr+") {"); @@ -3488,17 +3446,21 @@ public class BuildCode { output.println("revertlist=(struct ___Object___ *)"+dst+";"); output.println("}"); if (srcglobal) - output.println(dst+"->"+ fsfn.getField().getSafeSymbol()+"=(void *) srcoid;"); + output.println(dst+"->"+ + (fsfn.getField().getClassDescriptor()==null?"":fsfn.getField().getClassDescriptor().getSafeSymbol()) + fsfn.getField().getSafeSymbol()+"=(void *) srcoid;"); else - output.println(dst+"->"+ fsfn.getField().getSafeSymbol()+"="+ src+";"); + output.println(dst+"->"+ + (fsfn.getField().getClassDescriptor()==null?"":fsfn.getField().getClassDescriptor().getSafeSymbol()) + fsfn.getField().getSafeSymbol()+"="+ src+";"); } else if (statusdst.equals(LocalityAnalysis.EITHER)) { //writing to a null...bad output.println("if ("+dst+") {"); output.println("printf(\"BIG ERROR 2\\n\");exit(-1);}"); if (srcglobal) - output.println(dst+"->"+ fsfn.getField().getSafeSymbol()+"=(void *) srcoid;"); + output.println(dst+"->"+ + (fsfn.getField().getClassDescriptor()==null?"":fsfn.getField().getClassDescriptor().getSafeSymbol()) + fsfn.getField().getSafeSymbol()+"=(void *) srcoid;"); else - output.println(dst+"->"+ fsfn.getField().getSafeSymbol()+"="+ src+";"); + output.println(dst+"->"+ + (fsfn.getField().getClassDescriptor()==null?"":fsfn.getField().getClassDescriptor().getSafeSymbol()) + fsfn.getField().getSafeSymbol()+"="+ src+";"); } if (srcglobal) { output.println("}"); @@ -3553,20 +3515,19 @@ public class BuildCode { } // redirect to the global_defs_p structure if(fsfn.getDst().getType().isClassNameRef()) { - // reference to the static field with Class name - // decide the exact class/interface that defines the field - ClassDescriptor fdcn = - cd2fieldstbl.get(fsfn.getDst().getType().getClassDesc()).get(fsfn.getField().getSymbol()); - - output.println("global_defs_p->" + fdcn.getSafeSymbol() + fsfn.getField().getSafeSymbol()+"="+ generateTemp(fm,fsfn.getSrc(),lb)+";"); + // reference to the static field with Class name + output.println("global_defs_p->" + fsfn.getField().getClassDescriptor().getSafeSymbol() + fsfn.getField().getSafeSymbol()+"="+ generateTemp(fm,fsfn.getSrc(),lb)+";"); } else { - output.println("*"+generateTemp(fm, fsfn.getDst(),lb)+"->"+ fsfn.getField().getSafeSymbol()+"="+ generateTemp(fm,fsfn.getSrc(),lb)+";"); + output.println("*"+generateTemp(fm, fsfn.getDst(),lb)+"->"+ + (fsfn.getField().getClassDescriptor()==null?"":fsfn.getField().getClassDescriptor().getSafeSymbol()) + fsfn.getField().getSafeSymbol()+"="+ generateTemp(fm,fsfn.getSrc(),lb)+";"); } } else { - output.println(generateTemp(fm, fsfn.getDst(),lb)+"->"+ fsfn.getField().getSafeSymbol()+"="+ generateTemp(fm,fsfn.getSrc(),lb)+";"); + output.println(generateTemp(fm, fsfn.getDst(),lb)+"->"+ + (fsfn.getField().getClassDescriptor()==null?"":fsfn.getField().getClassDescriptor().getSafeSymbol()) + fsfn.getField().getSafeSymbol()+"="+ generateTemp(fm,fsfn.getSrc(),lb)+";"); } } else { - output.println(generateTemp(fm, fsfn.getDst(),lb)+"->"+ fsfn.getField().getSafeSymbol()+"="+ generateTemp(fm,fsfn.getSrc(),lb)+";"); + output.println(generateTemp(fm, fsfn.getDst(),lb)+"->"+ + (fsfn.getField().getClassDescriptor()==null?"":fsfn.getField().getClassDescriptor().getSafeSymbol()) + fsfn.getField().getSafeSymbol()+"="+ generateTemp(fm,fsfn.getSrc(),lb)+";"); } } } diff --git a/Robust/src/Runtime/bamboo/multicoreruntime.c b/Robust/src/Runtime/bamboo/multicoreruntime.c index f08c9447..09ffaf33 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___)->___value___; + struct ArrayObject * chararray=VAR(___s___)->___String______value___; int i; - int offset=VAR(___s___)->___offset___; + int offset=VAR(___s___)->___String______offset___; tprintf(""); - for(i=0; i___count___; i++) { + for(i=0; i___String______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->___value___=chararray; - strobj->___count___=length; - strobj->___offset___=0; + strobj->___String______value___=chararray; + strobj->___String______count___=length; + strobj->___String______offset___=0; for(i=0; i___length___)+sizeof(int)))[i]=(short)str[i]; @@ -345,6 +345,8 @@ void failedboundschk() { printf("Array out of bounds\n"); #ifdef THREADS threadexit(); +#elif defined MGC + BAMBOO_EXIT(0xa002); #else exit(-1); #endif diff --git a/Robust/src/Runtime/object.c b/Robust/src/Runtime/object.c index c552b4c5..8b09a3b2 100644 --- a/Robust/src/Runtime/object.c +++ b/Robust/src/Runtime/object.c @@ -33,10 +33,10 @@ int CALL01(___Object______MonitorEnter____, struct ___Object___ * ___this___) { #endif while(1) { if (VAR(___this___)->tid==0) { - VAR(___this___)->___prevlockobject___=NULL; - VAR(___this___)->___nextlockobject___=(struct ___Object___ *)pthread_getspecific(threadlocks); - if (VAR(___this___)->___nextlockobject___!=NULL) - VAR(___this___)->___nextlockobject___->___prevlockobject___=VAR(___this___); + VAR(___this___)->___Object______prevlockobject___=NULL; + VAR(___this___)->___Object______nextlockobject___=(struct ___Object___ *)pthread_getspecific(threadlocks); + if (VAR(___this___)->___Object______nextlockobject___!=NULL) + VAR(___this___)->___Object______nextlockobject___->___Object______prevlockobject___=VAR(___this___); pthread_setspecific(threadlocks, VAR(___this___)); VAR(___this___)->lockcount=1; VAR(___this___)->tid=self; @@ -61,12 +61,12 @@ int CALL01(___Object______MonitorExit____, struct ___Object___ * ___this___) { if (self==VAR(___this___)->tid) { VAR(___this___)->lockcount--; if (VAR(___this___)->lockcount==0) { - if (VAR(___this___)->___prevlockobject___==NULL) { - pthread_setspecific(threadlocks, VAR(___this___)->___nextlockobject___); + if (VAR(___this___)->___Object______prevlockobject___==NULL) { + pthread_setspecific(threadlocks, VAR(___this___)->___Object______nextlockobject___); } else - VAR(___this___)->___prevlockobject___->___nextlockobject___=VAR(___this___)->___nextlockobject___; - if (VAR(___this___)->___nextlockobject___!=NULL) - VAR(___this___)->___nextlockobject___->___prevlockobject___=VAR(___this___)->___prevlockobject___; + VAR(___this___)->___Object______prevlockobject___->___Object______nextlockobject___=VAR(___this___)->___Object______nextlockobject___; + if (VAR(___this___)->___Object______nextlockobject___!=NULL) + VAR(___this___)->___Object______nextlockobject___->___Object______prevlockobject___=VAR(___this___)->___Object______prevlockobject___; VAR(___this___)->lockentry=NULL; VAR(___this___)->tid=0; } diff --git a/Robust/src/Runtime/runtime.c b/Robust/src/Runtime/runtime.c index 8cf71847..4ba5e83c 100644 --- a/Robust/src/Runtime/runtime.c +++ b/Robust/src/Runtime/runtime.c @@ -387,10 +387,10 @@ long long CALL00(___System______getticks____) { } void CALL01(___System______printString____L___String___,struct ___String___ * ___s___) { - struct ArrayObject * chararray=VAR(___s___)->___value___; + struct ArrayObject * chararray=VAR(___s___)->___String______value___; int i; - int offset=VAR(___s___)->___offset___; - for(i=0; i___count___; i++) { + int offset=VAR(___s___)->___String______offset___; + for(i=0; i___String______count___; i++) { short sc=((short *)(((char *)&chararray->___length___)+sizeof(int)))[i+offset]; putchar(sc); } @@ -733,9 +733,9 @@ __attribute__((malloc)) struct ___String___ * NewString(const char *str,int leng struct ArrayObject * chararray=allocate_newarray(CHARARRAYTYPE, length); struct ___String___ * strobj=allocate_new(STRINGTYPE); #endif - strobj->___value___=chararray; - strobj->___count___=length; - strobj->___offset___=0; + strobj->___String______value___=chararray; + strobj->___String______count___=length; + strobj->___String______offset___=0; for(i=0; i___length___)+sizeof(int)))[i]=(short)str[i]; diff --git a/Robust/src/Runtime/socket.c b/Robust/src/Runtime/socket.c index e9e73d45..8812ea85 100644 --- a/Robust/src/Runtime/socket.c +++ b/Robust/src/Runtime/socket.c @@ -299,7 +299,7 @@ int CALL02(___ServerSocket______nativeaccept____L___Socket___,struct ___ServerSo #else struct sockaddr_in sin; unsigned int sinlen=sizeof(sin); - int fd=VAR(___this___)->___fd___; + int fd=VAR(___this___)->___ServerSocket______fd___; int newfd; #if defined(THREADS)||defined(DSTM)||defined(STM) #ifdef PRECISE_GC @@ -348,7 +348,7 @@ int CALL02(___ServerSocket______nativeaccept____L___Socket___,struct ___ServerSo void CALL24(___Socket______nativeWrite_____AR_B_I_I, int offset, int length, struct ___Socket___ * ___this___, struct ArrayObject * ___b___, int offset, int length) { #ifdef MULTICORE #else - int fd=VAR(___this___)->___fd___; + int fd=VAR(___this___)->___Socket______fd___; char * charstr=((char *)&VAR(___b___)->___length___)+sizeof(int)+offset; while(1) { int offset=0; @@ -374,7 +374,7 @@ int CALL02(___Socket______nativeRead_____AR_B, struct ___Socket___ * ___this___, #ifdef MULTICORE return -1; #else - int fd=VAR(___this___)->___fd___; + int fd=VAR(___this___)->___Socket______fd___; int length=VAR(___b___)->___length___; char * charstr=malloc(length); @@ -426,7 +426,7 @@ int CALL02(___Socket______nativeRead_____AR_B, struct ___Socket___ * ___this___, void CALL01(___Socket______nativeClose____, struct ___Socket___ * ___this___) { #ifdef MULTICORE #else - int fd=VAR(___this___)->___fd___; + int fd=VAR(___this___)->___Socket______fd___; int data; #ifdef TASK RuntimeHashget(fdtoobject, fd, &data); diff --git a/Robust/src/Runtime/thread.c b/Robust/src/Runtime/thread.c index c46b1000..848243d0 100644 --- a/Robust/src/Runtime/thread.c +++ b/Robust/src/Runtime/thread.c @@ -65,9 +65,9 @@ void threadexit() { #ifdef THREADS struct ___Object___ *ll=pthread_getspecific(threadlocks); while(ll!=NULL) { - struct ___Object___ *llnext=ll->___nextlockobject___; - ll->___nextlockobject___=NULL; - ll->___prevlockobject___=NULL; + struct ___Object___ *llnext=ll->___Object______nextlockobject___; + ll->___Object______nextlockobject___=NULL; + ll->___Object______prevlockobject___=NULL; ll->lockcount=0; ll->tid=0; //unlock it ll=llnext; @@ -346,7 +346,7 @@ void initthread(struct ___Thread___ * ___this___) { #else ___Thread______staticStart____L___Thread___(___this___); #endif - ___this___->___finished___=1; + ___this___->___Thread______finished___=1; pthread_mutex_lock(&joinlock); pthread_cond_signal(&joincond); pthread_mutex_unlock(&joinlock); @@ -477,7 +477,7 @@ transstart: #if defined(THREADS)||defined(STM) void CALL01(___Thread______nativeJoin____, struct ___Thread___ * ___this___) { pthread_mutex_lock(&joinlock); - while(!VAR(___this___)->___finished___) { + while(!VAR(___this___)->___Thread______finished___) { #ifdef PRECISE_GC stopforgc((struct garbagelist *)___params___); #endif