From fb4ae33e041d4011b66bcc1f77cae91010fa3cc8 Mon Sep 17 00:00:00 2001 From: jzhou Date: Fri, 30 Dec 2011 00:18:30 +0000 Subject: [PATCH] changes to classes --- .../Prefetch/DSTM2/MatrixMultiply/makefile | 215 ++++++++++++++++-- .../MGC/gnu/AtomicStampedReference.java | 26 +-- 2 files changed, 210 insertions(+), 31 deletions(-) diff --git a/Robust/src/Benchmarks/Prefetch/DSTM2/MatrixMultiply/makefile b/Robust/src/Benchmarks/Prefetch/DSTM2/MatrixMultiply/makefile index 12c12cf5..3482903d 100644 --- a/Robust/src/Benchmarks/Prefetch/DSTM2/MatrixMultiply/makefile +++ b/Robust/src/Benchmarks/Prefetch/DSTM2/MatrixMultiply/makefile @@ -1,18 +1,197 @@ -SRC = dstm2/MMulMain -RUNSRC = dstm2.MMulMain -BENCHMARK = -b dstm2.benchmark.MMulBenchMark -CP = bcel-5.2.jar -VMFLAG = -Xmx1000m - -default: - javac -cp $(CP):. $(SRC).java -run: - java $(VMFLAG) -cp $(CP):. $(RUNSRC) $(BENCHMARK) - -clean: - rm dstm2/*.class - rm dstm2/exceptions/*.class - rm dstm2/factory/*.class - rm dstm2/benchmark/*.class - rm dstm2/manager/*.class - rm dstm2/util/*.class +CLASSFILES=Main/Main.class Lex/BooleanLiteral.class \ +Lex/CharacterLiteral.class Lex/Comment.class \ +Lex/DocumentationComment.class Lex/DoubleLiteral.class Lex/EOF.class \ +Lex/EndOfLineComment.class Lex/EscapedUnicodeReader.class \ +Lex/FIFO.class Lex/FloatLiteral.class Lex/Identifier.class \ +Lex/InputElement.class Lex/IntegerLiteral.class Lex/Keyword.class \ +Lex/Lexer.class Lex/Literal.class Lex/LongLiteral.class \ +Lex/NullLiteral.class Lex/NumericLiteral.class Lex/Operator.class \ +Lex/Separator.class Lex/StringLiteral.class Lex/Token.class \ +Lex/TraditionalComment.class Lex/WhiteSpace.class \ +IR/AssignOperation.class IR/ClassDescriptor.class IR/Descriptor.class \ +IR/FieldDescriptor.class IR/FlagDescriptor.class \ +IR/MethodDescriptor.class IR/NameDescriptor.class IR/Operation.class \ +IR/State.class IR/SymbolTable.class IR/TagDescriptor.class \ +IR/TagVarDescriptor.class IR/TaskDescriptor.class \ +IR/TypeDescriptor.class IR/TypeUtil.class IR/VarDescriptor.class \ +IR/Virtual.class IR/Flat/BuildCode.class IR/Flat/BuildFlat.class \ +IR/Flat/BuildOoOJavaCode.class \ +IR/Flat/FKind.class IR/Flat/FlatAtomicEnterNode.class \ +IR/Flat/FlatAtomicExitNode.class IR/Flat/FlatBackEdge.class \ +IR/Flat/FlatCall.class IR/Flat/FlatCastNode.class \ +IR/Flat/FlatCheckNode.class IR/Flat/FlatCondBranch.class \ +IR/Flat/FlatElementNode.class IR/Flat/FlatFieldNode.class \ +IR/Flat/FlatFlagActionNode.class IR/Flat/FlatGlobalConvNode.class \ +IR/Flat/FlatLiteralNode.class IR/Flat/FlatMethod.class \ +IR/Flat/FlatNew.class IR/Flat/FlatNode.class IR/Flat/FlatNop.class \ +IR/Flat/FlatOpNode.class IR/Flat/FlatReturnNode.class \ +IR/Flat/FlatSetElementNode.class IR/Flat/FlatSetFieldNode.class \ +IR/Flat/FlatTagDeclaration.class IR/Flat/NodePair.class \ +IR/Flat/FlatPrefetchNode.class \ +IR/Flat/ParamsObject.class IR/Flat/TempDescriptor.class \ +IR/Flat/TempFlagPair.class IR/Flat/TempObject.class \ +IR/Flat/TempTagPair.class IR/Tree/ArrayAccessNode.class \ +IR/Tree/AssignmentNode.class IR/Tree/AtomicNode.class \ +IR/Tree/BlockExpressionNode.class IR/Tree/BlockNode.class \ +IR/Tree/BlockStatementNode.class IR/Tree/BuildIR.class \ +IR/Tree/CastNode.class IR/Tree/ConstraintCheck.class \ +IR/Tree/CreateObjectNode.class IR/Tree/DNFFlag.class \ +IR/Tree/DNFFlagAtom.class IR/Tree/DeclarationNode.class \ +IR/Tree/ExpressionNode.class IR/Tree/FieldAccessNode.class \ +IR/Tree/FlagEffect.class IR/Tree/FlagEffects.class \ +IR/Tree/FlagExpressionNode.class IR/Tree/FlagNode.class \ +IR/Tree/FlagOpNode.class IR/Tree/IfStatementNode.class \ +IR/Tree/Kind.class IR/Tree/LiteralNode.class IR/Tree/LoopNode.class \ +IR/Tree/MethodInvokeNode.class IR/Tree/Modifiers.class \ +IR/Tree/NameNode.class IR/Tree/OpNode.class IR/Tree/ParseNode.class \ +IR/Tree/ParseNodeDOTVisitor.class IR/Tree/ParseNodeVector.class \ +IR/Tree/ReturnNode.class IR/Tree/SemanticCheck.class \ +IR/Tree/SubBlockNode.class IR/Tree/TagDeclarationNode.class \ +IR/Tree/TagEffect.class IR/Tree/TagExpressionList.class \ +IR/Tree/TaskExitNode.class IR/Tree/TreeNode.class \ +IR/Tree/Walkable.class Analysis/CallGraph/CallGraph.class \ +Analysis/Locality/GenerateConversions.class \ +Analysis/Locality/LocalityAnalysis.class \ +Analysis/Locality/LocalityBinding.class \ +Analysis/Locality/TempNodePair.class \ +Analysis/TaskStateAnalysis/Allocations.class \ +Analysis/TaskStateAnalysis/EGEdge.class \ +Analysis/TaskStateAnalysis/EGTaskNode.class \ +Analysis/TaskStateAnalysis/ExecutionGraph.class \ +Analysis/TaskStateAnalysis/FEdge.class \ +Analysis/TaskStateAnalysis/FlagState.class \ +Analysis/TaskStateAnalysis/GarbageAnalysis.class \ +Analysis/TaskStateAnalysis/OptionalTaskDescriptor.class \ +Analysis/TaskStateAnalysis/Predicate.class \ +Analysis/TaskStateAnalysis/SafetyAnalysis.class \ +Analysis/TaskStateAnalysis/TEdge.class \ +Analysis/TaskStateAnalysis/TagAnalysis.class \ +Analysis/TaskStateAnalysis/TagBinding.class \ +Analysis/TaskStateAnalysis/TaskAnalysis.class \ +Analysis/TaskStateAnalysis/TaskEdges.class \ +Analysis/TaskStateAnalysis/TaskGraph.class \ +Analysis/TaskStateAnalysis/TaskNode.class \ +Analysis/TaskStateAnalysis/FlagComparator.class \ +Analysis/TaskStateAnalysis/TaskNodeNamer.class Util/Edge.class \ +Analysis/FlatIRGraph/FlatIRGraph.class \ +Analysis/OwnershipAnalysis/OwnershipAnalysis.class \ +Analysis/OwnershipAnalysis/OwnershipGraph.class \ +Analysis/OwnershipAnalysis/OwnershipNode.class \ +Analysis/OwnershipAnalysis/LabelNode.class \ +Analysis/OwnershipAnalysis/HeapRegionNode.class \ +Analysis/OwnershipAnalysis/ReferenceEdge.class \ +Analysis/OwnershipAnalysis/AllocationSite.class \ +Analysis/OwnershipAnalysis/TokenTuple.class \ +Analysis/OwnershipAnalysis/TokenTupleSet.class \ +Analysis/OwnershipAnalysis/ReachabilitySet.class \ +Analysis/OwnershipAnalysis/ChangeTuple.class \ +Analysis/OwnershipAnalysis/ChangeTupleSet.class \ +Analysis/OwnershipAnalysis/Canonical.class \ +Analysis/OwnershipAnalysis/MethodContext.class \ +Analysis/OwnershipAnalysis/ParameterDecomposition.class \ +Analysis/OwnershipAnalysis/AccessPath.class \ +Analysis/Disjoint/DisjointAnalysis.class \ +Analysis/Disjoint/ReachGraph.class \ +Analysis/OoOJava/OoOJavaAnalysis.class \ +Analysis/OoOJava/CodePlan.class \ +Analysis/OoOJava/SVKey.class \ +Analysis/OoOJava/VSTWrapper.class \ +Analysis/OoOJava/VarSrcTokTable.class \ +Analysis/OoOJava/VariableSourceToken.class \ +Analysis/OoOJava/ContextTaskNames.class \ +Util/GraphNode.class Util/Namer.class Util/Relation.class \ +Util/UtilAlgorithms.class \ +Interface/HTTPHeader.class Interface/HTTPResponse.class \ +Interface/HTTPServices.class Interface/HashStrings.class \ +Interface/JhttpServer.class Interface/JhttpWorker.class \ +Interface/LogFile.class Interface/Pair.class \ +Interface/WebInterface.class Analysis/Prefetch/PrefetchAnalysis.class \ +Analysis/Prefetch/PrefetchPair.class Analysis/Prefetch/PairMap.class \ +Analysis/Prefetch/IndexDescriptor.class \ +Analysis/Scheduling/ClassNode.class \ +Analysis/Scheduling/ScheduleAnalysis.class \ +Analysis/Scheduling/ScheduleEdge.class \ +Analysis/Scheduling/ScheduleNode.class \ +Analysis/Scheduling/CoreSimulator.class \ +Analysis/Scheduling/FIFORSchedule.class \ +Analysis/Scheduling/ObjectSimulator.class \ +Analysis/Scheduling/RuntimeSchedule.class \ +Analysis/Scheduling/Schedule.class \ +Analysis/Scheduling/ScheduleSimulator.class \ +Analysis/Scheduling/SchedulingUtil.class \ +Analysis/Scheduling/TaskSimulator.class \ +Analysis/Scheduling/TransTaskSimulator.class + +JAVAFILES=IR/*.java \ + IR/Flat/*.java \ + IR/Tree/*.java \ + Main/*.java \ + Analysis/CallGraph/*.java \ + Analysis/FlatIRGraph/*.java \ + Analysis/Loops/*.java \ + Analysis/Locality/*.java \ + Analysis/OwnershipAnalysis/*.java \ + Analysis/Disjoint/*.java \ + Analysis/OoOJava/*.java \ + Analysis/Pointer/*.java \ + Analysis/Prefetch/*.java \ + Analysis/Scheduling/*.java \ + Analysis/SSJava/*.java \ + Analysis/TaskStateAnalysis/*.java \ + Util/*.java \ + ClassLibrary/*.java \ + ClassLibrary/gnu/*.java \ + Interface/*.java \ + Lex/*.java + +CFILES=Runtime/*.c \ + Runtime/*.h \ + Runtime/DSTM/interface/*.c \ + Runtime/DSTM/interface/*.h + +all: compiler javadoc + +compiler: Parse/Sym.java Parse/Parser.java cleanclass classfiles + +classfiles: + ./ourjavac -cp ../cup:.:$(CLASSPATH) Main/Main.java + +wc: + wc Interface/*.java Analysis/*/*.java IR/*.java IR/*/*.java Lex/*.java Util/*.java ClassLibrary/*.java Main/*.java + +wcrun: + wc Runtime/*.[c,h] Runtime/DSTM/interface*/*.[c,h] Runtime/STM/*.[c,h] + +Parse/Parser.java Parse/Sym.java: Parse/java14.cup + cd Parse && \ + java -cp ../../cup:$(CLASSPATH) java_cup.Main -parser Parser -symbols Sym < java14.cup + +%.class: %.java + ./ourjavac -cp ../cup:.:$(CLASSPATH) $< + +tabbing: + uncrustify -c java.cfg --no-backup $(JAVAFILES) + uncrustify -c c.cfg --no-backup $(CFILES) + +commit: tabbing + cvs commit . + +update: tabbing + cvs update -d . + +mytabbing: + uncrustify -c myjava.cfg --no-backup $(JAVAFILES) + uncrustify -c myc.cfg --no-backup $(CFILES) + +javadoc: + mkdir javadoc + javadoc -classpath ../cup:.:$(CLASSPATH) -sourcepath . -private -d javadoc Lex Util IR IR.Tree IR.Flat Analysis Analysis.CallGraph Analysis.Flag Analysis.TaskStateAnalysis Analysis.Locality Analysis.Prefetch Main Analysis.OwnershipAnalysis Analysis.Disjoint Analysis.Scheduling + +clean: + rm -f IR/*.class IR/Tree/*.class Main/*.class Lex/*.class Parse/*.class Parse/Sym.java Parse/Parser.java IR/Flat/*.class classdefs.h methodheaders.h methods.c structdefs.h virtualtable.h task.h taskdefs.c taskdefs.h Analysis/*.class Analysis/Flag/*.class Analysis/CallGraph/*.class Analysis/TaskStateAnalysis/*.class Interface/*.class Util/*.class Analysis/Locality/*.class Analysis/Prefetch/*.class Analysis/FlatIRGraph/*.class Analysis/OwnershipAnalysis/*.class Analysis/Disjoint/*.class Analysis/OoOJava/*.class Analysis/Scheduling/*.class Analysis/Loops/*.class Analysis/Pointer/*.class Analysis/SSJava/*.class + +cleanclass: + rm -f IR/*.class IR/Tree/*.class Main/*.class IR/Flat/*.class Analysis/*.class Analysis/Flag/*.class Analysis/CallGraph/*.class Analysis/TaskStateAnalysis/*.class Interface/*.class Util/*.class Analysis/Locality/*.class Analysis/Prefetch/*.class Analysis/FlatIRGraph/*.class Analysis/OwnershipAnalysis/*.class Analysis/Disjoint/*.class Analysis/OoOJava/*.class Analysis/Scheduling/*.class Analysis/Loops/*.class Analysis/Pointer/*.class Analysis/SSJava/*.class + +cleandoc: + rm -rf javadoc diff --git a/Robust/src/ClassLibrary/MGC/gnu/AtomicStampedReference.java b/Robust/src/ClassLibrary/MGC/gnu/AtomicStampedReference.java index 529fce49..793e7f80 100644 --- a/Robust/src/ClassLibrary/MGC/gnu/AtomicStampedReference.java +++ b/Robust/src/ClassLibrary/MGC/gnu/AtomicStampedReference.java @@ -48,7 +48,7 @@ public class AtomicStampedReference/**/ { * @return the current value of the reference */ public Object/*V*/ getReference() { - return atomicRef.get().reference; + return ((ReferenceIntegerPair)atomicRef.get()).reference; } /** @@ -57,7 +57,7 @@ public class AtomicStampedReference/**/ { * @return the current value of the stamp */ public int getStamp() { - return atomicRef.get().integer; + return ((ReferenceIntegerPair)atomicRef.get()).integer; } /** @@ -69,7 +69,7 @@ public class AtomicStampedReference/**/ { * @return the current value of the reference */ public Object/*V*/ get(int[] stampHolder) { - ReferenceIntegerPair/**/ p = atomicRef.get(); + ReferenceIntegerPair/**/ p = (ReferenceIntegerPair)(atomicRef.get()); stampHolder[0] = p.integer; return p.reference; } @@ -92,10 +92,10 @@ public class AtomicStampedReference/**/ { Object/*V*/ newReference, int expectedStamp, int newStamp) { - ReferenceIntegerPair/**/ current = atomicRef.get(); - return expectedReference == current.reference && + ReferenceIntegerPair/**/ current = (ReferenceIntegerPair)(atomicRef.get()); + return (ReferenceIntegerPair)expectedReference == current.reference && expectedStamp == current.integer && - ((newReference == current.reference && + (((ReferenceIntegerPair)newReference == current.reference && newStamp == current.integer) || atomicRef.weakCompareAndSet(current, new ReferenceIntegerPair/**/(newReference, @@ -118,10 +118,10 @@ public class AtomicStampedReference/**/ { Object/*V*/ newReference, int expectedStamp, int newStamp) { - ReferenceIntegerPair/**/ current = atomicRef.get(); - return expectedReference == current.reference && + ReferenceIntegerPair/**/ current = (ReferenceIntegerPair)(atomicRef.get()); + return (ReferenceIntegerPair)expectedReference == current.reference && expectedStamp == current.integer && - ((newReference == current.reference && + (((ReferenceIntegerPair)newReference == current.reference && newStamp == current.integer) || atomicRef.compareAndSet(current, new ReferenceIntegerPair/**/(newReference, @@ -136,8 +136,8 @@ public class AtomicStampedReference/**/ { * @param newStamp the new value for the stamp */ public void set(Object/*V*/ newReference, int newStamp) { - ReferenceIntegerPair/**/ current = atomicRef.get(); - if (newReference != current.reference || newStamp != current.integer) + ReferenceIntegerPair/**/ current = (ReferenceIntegerPair)(atomicRef.get()); + if ((ReferenceIntegerPair)newReference != current.reference || newStamp != current.integer) atomicRef.set(new ReferenceIntegerPair/**/(newReference, newStamp)); } @@ -155,8 +155,8 @@ public class AtomicStampedReference/**/ { * @return true if successful */ public boolean attemptStamp(Object/*V*/ expectedReference, int newStamp) { - ReferenceIntegerPair/**/ current = atomicRef.get(); - return expectedReference == current.reference && + ReferenceIntegerPair/**/ current = (ReferenceIntegerPair)(atomicRef.get()); + return (ReferenceIntegerPair)expectedReference == current.reference && (newStamp == current.integer || atomicRef.compareAndSet(current, new ReferenceIntegerPair/**/(expectedReference, -- 2.34.1