From: bdemsky Date: Tue, 14 Jul 2009 02:51:26 +0000 (+0000) Subject: changes to fix alignment issues X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6dc3150b6aa20759c0cd6279fdda655d55bb38a8;p=IRC.git changes to fix alignment issues --- diff --git a/Robust/src/Analysis/Prefetch/PrefetchAnalysis.java b/Robust/src/Analysis/Prefetch/PrefetchAnalysis.java index b7f9c6a2..78a6faf2 100644 --- a/Robust/src/Analysis/Prefetch/PrefetchAnalysis.java +++ b/Robust/src/Analysis/Prefetch/PrefetchAnalysis.java @@ -109,6 +109,7 @@ public class PrefetchAnalysis { case FKind.FlatFlagActionNode: case FKind.FlatGlobalConvNode: case FKind.FlatNop: + case FKind.FlatExit: case FKind.FlatNew: case FKind.FlatCastNode: case FKind.FlatTagDeclaration: diff --git a/Robust/src/Benchmarks/SingleTM/common/Makefile.flags b/Robust/src/Benchmarks/SingleTM/common/Makefile.flags index f99d940e..c7b78849 100644 --- a/Robust/src/Benchmarks/SingleTM/common/Makefile.flags +++ b/Robust/src/Benchmarks/SingleTM/common/Makefile.flags @@ -1,6 +1,6 @@ -FLAGSLOCK=-mainclass ${MAINCLASS} -thread -optimize -abcclose -64bit -debug -joptimize -FLAGSLOCKNOJ=-mainclass ${MAINCLASS} -thread -optimize -abcclose -64bit -debug -FLAGSSTMNOJ=-mainclass ${MAINCLASS} -singleTM -optimize -64bit -debug -abcclose -transstats -FLAGSSTM=-mainclass ${MAINCLASS} -singleTM -optimize -joptimize -64bit -debug -abcclose -transstats -FLAGSOPTSTM=-mainclass ${MAINCLASS} -singleTM -optimize -joptimize -64bit -debug -abcclose -dcopts -transstats -FLAGSFISSION=-mainclass ${MAINCLASS} -singleTM -delaycomp -optimize -joptimize -abcclose -64bit -debug -transstats -inlineatomic 2 -minimize \ No newline at end of file +FLAGSLOCK=-mainclass ${MAINCLASS} -thread -optimize -abcclose -64bit -debug -joptimize -arraypad +FLAGSLOCKNOJ=-mainclass ${MAINCLASS} -thread -optimize -abcclose -64bit -debug -arraypad +FLAGSSTMNOJ=-mainclass ${MAINCLASS} -singleTM -optimize -64bit -debug -abcclose -transstats -arraypad +FLAGSSTM=-mainclass ${MAINCLASS} -singleTM -optimize -joptimize -64bit -debug -abcclose -transstats -arraypad +FLAGSOPTSTM=-mainclass ${MAINCLASS} -singleTM -optimize -joptimize -64bit -debug -abcclose -dcopts -transstats -arraypad +FLAGSFISSION=-mainclass ${MAINCLASS} -singleTM -delaycomp -optimize -joptimize -abcclose -64bit -debug -transstats -inlineatomic 2 -minimize -readset -arraypad diff --git a/Robust/src/Benchmarks/SingleTM/common/Random.java b/Robust/src/Benchmarks/SingleTM/common/Random.java index 611592b2..36ee5e8e 100644 --- a/Robust/src/Benchmarks/SingleTM/common/Random.java +++ b/Robust/src/Benchmarks/SingleTM/common/Random.java @@ -53,11 +53,7 @@ public class Random { } public int posrandom_generate() { - int r=genrand_int32(); - if (r>0) - return r; - else - return -r; + return 0x7fffffff&genrand_int32(); } public int genrand_int32() { diff --git a/Robust/src/IR/ClassDescriptor.java b/Robust/src/IR/ClassDescriptor.java index e38a12f6..d86e115c 100644 --- a/Robust/src/IR/ClassDescriptor.java +++ b/Robust/src/IR/ClassDescriptor.java @@ -13,6 +13,7 @@ public class ClassDescriptor extends Descriptor { Modifiers modifiers; SymbolTable fields; + Vector fieldvec; SymbolTable flags; SymbolTable methods; @@ -25,6 +26,7 @@ public class ClassDescriptor extends Descriptor { superclass=null; flags=new SymbolTable(); fields=new SymbolTable(); + fieldvec=new Vector(); methods=new SymbolTable(); classid=UIDCount++; this.packagename=packagename; @@ -50,6 +52,10 @@ public class ClassDescriptor extends Descriptor { return fields; } + public Vector getFieldVec() { + return fieldvec; + } + public SymbolTable getFlagTable() { return flags; } @@ -114,6 +120,7 @@ public class ClassDescriptor extends Descriptor { if (fields.contains(fd.getSymbol())) throw new Error(fd.getSymbol()+" already defined"); fields.add(fd); + fieldvec.add(fd); } public void addMethod(MethodDescriptor md) { diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index 08828226..e3d6bf1f 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -586,6 +586,9 @@ public class BuildCode { } printClassStruct(typeutil.getClass(TypeUtil.ObjectClass), outclassdefs); + if (state.ARRAYPAD) + outclassdefs.println(" int paddingforarray;"); + outclassdefs.println(" int ___length___;"); outclassdefs.println("};\n"); outclassdefs.println("extern int classsize[];"); @@ -1208,21 +1211,10 @@ public class BuildCode { if (!fieldorder.containsKey(cn)) { Vector fields=new Vector(); fieldorder.put(cn,fields); - if (sp==null&&!state.TASK) { - fields.add(cn.getFieldTable().get("cachedCode")); - } - Iterator fieldit=cn.getFields(); - while(fieldit.hasNext()) { - FieldDescriptor fd=(FieldDescriptor)fieldit.next(); - if ((sp==null||!sp.getFieldTable().contains(fd.getSymbol()))&&!fd.getType().isPtr()&& - (!fd.getSymbol().equals("cachedCode")||state.TASK)) - fields.add(fd); - } - fieldit=cn.getFields(); - while(fieldit.hasNext()) { - FieldDescriptor fd=(FieldDescriptor)fieldit.next(); - if ((sp==null||!sp.getFieldTable().contains(fd.getSymbol()))&&fd.getType().isPtr()&& - (!fd.getSymbol().equals("cachedCode")||state.TASK)) + Vector fieldvec=cn.getFieldVec(); + for(int i=0;i