From 8dac239feb3c5ace978530d5ba1ce15c4cc9a949 Mon Sep 17 00:00:00 2001 From: jjenista Date: Tue, 28 Jul 2009 00:01:01 +0000 Subject: [PATCH] mlp system changes --- Robust/src/Analysis/MLP/MLPAnalysis.java | 4 +- Robust/src/IR/Flat/BuildCode.java | 281 ++++++++++------------ Robust/src/IR/Flat/FlatSESEEnterNode.java | 101 +++++--- Robust/src/Runtime/mlp_runtime.c | 45 ++-- Robust/src/Runtime/mlp_runtime.h | 55 ++--- Robust/src/Tests/mlp/tinyTest/makefile | 2 +- Robust/src/Tests/mlp/tinyTest/test.java | 13 +- 7 files changed, 258 insertions(+), 243 deletions(-) diff --git a/Robust/src/Analysis/MLP/MLPAnalysis.java b/Robust/src/Analysis/MLP/MLPAnalysis.java index 98629ce8..cca23e91 100644 --- a/Robust/src/Analysis/MLP/MLPAnalysis.java +++ b/Robust/src/Analysis/MLP/MLPAnalysis.java @@ -202,7 +202,9 @@ public class MLPAnalysis { FlatSESEEnterNode fsen = (FlatSESEEnterNode) fn; allSESEs.add( fsen ); - fsen.setEnclosingFlatMeth( fm ); + fsen.setfmEnclosing( fm ); + fsen.setmdEnclosing( fm.getMethod() ); + fsen.setcdEnclosing( fm.getMethod().getClassDesc() ); if( !seseStack.empty() ) { seseStack.peek().addChild( fsen ); diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index 7ccde198..49a38393 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -65,7 +65,6 @@ public class BuildCode { String mlperrstr = "if(status != 0) { "+ "sprintf(errmsg, \"MLP error at %s:%d\", __FILE__, __LINE__); "+ "perror(errmsg); exit(-1); }"; - Hashtable sese2bogusFlatMeth; boolean nonSESEpass=true; WriteBarrier wb; DiscoverConflicts dc; @@ -121,10 +120,6 @@ public class BuildCode { recorddc=new DiscoverConflicts(locality, st, typeanalysis, delaycomp.getCannotDelayMap(), true, true, null); recorddc.doAnalysis(); } - - if(state.MLP) { - sese2bogusFlatMeth = new Hashtable(); - } } /** The buildCode method outputs C code for all the methods. The Flat @@ -378,11 +373,9 @@ public class BuildCode { outmethod.println("pthread_exit(NULL);"); if (state.MLP) { - outmethod.println(" mlpInit( "+state.MLP_NUMCORES+", "+ - "invokeSESEmethod, "+ - "argc, "+ - "argv, "+ - state.MLP_MAXSESEAGE+" );"); + outmethod.println(" workScheduleInit( "+state.MLP_NUMCORES+", invokeSESEmethod );"); + // issue root SESE + outmethod.println(" workScheduleBegin();"); } outmethod.println("}"); @@ -1655,78 +1648,6 @@ public class BuildCode { output.println("}\n\n"); } - // when a new mlp thread is created for an issued SESE, it is started - // by running this method which blocks on a cond variable until - // it is allowed to transition to execute. Then a case statement - // allows it to invoke the method with the proper SESE body, and after - // exiting the SESE method, executes proper SESE exit code before the - // thread can be destroyed - private void generateSESEinvocationMethod(PrintWriter outmethodheader, - PrintWriter outmethod - ) { - - outmethodheader.println("void invokeSESEmethod( void* seseRecord );"); - outmethod.println( "void invokeSESEmethod( void* seseRecord ) {"); - outmethod.println( " int status;"); - outmethod.println( " char errmsg[128];"); - outmethod.println( " SESErecord* rec = (SESErecord*) seseRecord;"); - - // generate a case for each SESE class that can be invoked - outmethod.println( " switch( rec->classID ) {"); - outmethod.println( " "); - for(Iterator seseit=mlpa.getAllSESEs().iterator();seseit.hasNext();) { - FlatSESEEnterNode fsen = seseit.next(); - outmethod.println( " /* "+fsen.getPrettyIdentifier()+" */"); - outmethod.println( " case "+fsen.getIdentifier()+":"); - generateSESEinvocation(fsen, outmethod); - outmethod.println( " break;"); - outmethod.println( ""); - } - - // default case should never be taken, error out - outmethod.println( " default:"); - outmethod.println( " printf(\"Error: unknown SESE class ID in invoke method.\\n\");"); - outmethod.println( " exit(-30);"); - outmethod.println( " break;"); - outmethod.println( " }"); - outmethod.println( "}\n\n"); - } - - private void generateSESEinvocation(FlatSESEEnterNode fsen, - PrintWriter output - ) { - /* - FlatMethod fm = fsen.getEnclosingFlatMeth(); - MethodDescriptor md = fm.getMethod(); - ClassDescriptor cn = md.getClassDesc(); - - FlatMethod bogusfm = sese2bogusFlatMeth.get(fsen); - MethodDescriptor bogusmd = bogusfm.getMethod(); - ParamsObject objectparams = (ParamsObject)paramstable.get(bogusmd); - - // first copy SESE record into param structure - - - // then invoke the sese's method - output.print(" "+cn.getSafeSymbol()+bogusmd.getSafeSymbol()+"_"+bogusmd.getSafeMethodDescriptor()); - output.print("( args->invokee, "); - - // first argument is parameter structure - output.print("(struct "+cn.getSafeSymbol()+bogusmd.getSafeSymbol()+"__params*)"); - output.print("&(args->invokee->paramStruct)"); - - // other arguments are primitive parameters - for(int i=0; iinvokee->namespace)->"+td ); - } - - output.println(");"); - */ - } protected void generateMethodSESE(FlatSESEEnterNode fsen, LocalityBinding lb, @@ -1734,40 +1655,51 @@ public class BuildCode { PrintWriter outputMethHead, PrintWriter outputMethods ) { - - FlatMethod fm = fsen.getEnclosingFlatMeth(); + + FlatMethod fm = fsen.getfmEnclosing(); MethodDescriptor md = fm.getMethod(); ClassDescriptor cn = md.getClassDesc(); // Creates bogus method descriptor to index into tables - Modifiers bogusmod=new Modifiers(); - MethodDescriptor bogusmd=new MethodDescriptor(bogusmod, - new TypeDescriptor(TypeDescriptor.VOID), - "sese_"+fsen.getPrettyIdentifier()+fsen.getIdentifier()); - bogusmd.setClassDesc(cn); - FlatMethod bogusfm=new FlatMethod(bogusmd, null); - sese2bogusFlatMeth.put(fsen, bogusfm); + Modifiers modBogus = new Modifiers(); + MethodDescriptor mdBogus = + new MethodDescriptor( modBogus, + new TypeDescriptor( TypeDescriptor.VOID ), + "sese_"+fsen.getPrettyIdentifier()+fsen.getIdentifier() + ); + + mdBogus.setClassDesc( fsen.getcdEnclosing() ); + FlatMethod fmBogus = new FlatMethod( mdBogus, null ); + fsen.setfmBogus( fmBogus ); + fsen.setmdBogus( mdBogus ); // Build paramsobj for bogus method descriptor - ParamsObject objectparams=new ParamsObject(bogusmd, tag++); - paramstable.put(bogusmd, objectparams); + ParamsObject objectparams = new ParamsObject( mdBogus, tag++ ); + paramstable.put( mdBogus, objectparams ); - for(int i=0; i inSetAndOutSet = new HashSet(); + inSetAndOutSet.addAll( fsen.getInVarSet() ); + inSetAndOutSet.addAll( fsen.getOutVarSet() ); + + Set inSetAndOutSetPrims = new HashSet(); + + Iterator itr = inSetAndOutSet.iterator(); + while( itr.hasNext() ) { + TempDescriptor temp = itr.next(); + TypeDescriptor type = temp.getType(); + if( type.isPtr() ) { + objectparams.addPtr( temp ); } else { - objectparams.addPrim(temp); + inSetAndOutSetPrims.add( temp ); } } // Build normal temp object for bogus method descriptor - TempObject objecttemps=new TempObject(objectparams,bogusmd,tag++); - tempstable.put(bogusmd, objecttemps); + TempObject objecttemps = new TempObject( objectparams, mdBogus, tag++ ); + tempstable.put( mdBogus, objecttemps ); for(Iterator nodeit=fsen.getNodeSet().iterator(); nodeit.hasNext();) { FlatNode fn=(FlatNode)nodeit.next(); @@ -1782,14 +1714,36 @@ public class BuildCode { } } - // declare namespace struct - outputStructs.println(fsen.namespaceStructDeclarationString()); + // generate the SESE record structure + outputStructs.println(fsen.getSESErecordName()+" {"); - // Generate code for parameters structure - generateMethodParam(cn, bogusmd, null, outputStructs); + // class ID comes first + outputStructs.println(" int classID;"); - // Generate code for locals structure - outputStructs.println("struct "+cn.getSafeSymbol()+bogusmd.getSafeSymbol()+"_"+bogusmd.getSafeMethodDescriptor()+"_locals {"); + // then garbage list stuff + outputStructs.println(" INTPTR size;"); + outputStructs.println(" void * next;"); + + for(int i=0; i itrPrims = inSetAndOutSetPrims.iterator(); + while( itrPrims.hasNext() ) { + TempDescriptor temp = itrPrims.next(); + TypeDescriptor type = temp.getType(); + outputStructs.println(" "+temp.getType().getSafeSymbol()+" "+temp.getSafeSymbol()+";"); + } + + outputStructs.println("};\n"); + + // generate locals structure + outputStructs.println("struct "+cn.getSafeSymbol()+mdBogus.getSafeSymbol()+"_"+mdBogus.getSafeMethodDescriptor()+"_locals {"); outputStructs.println(" INTPTR size;"); outputStructs.println(" void * next;"); for(int i=0; isize)"); for(int j=0; j pItr = seseEnter.getNeededStaticNames().iterator(); + /* + Iterator pItr = fsen.getNeededStaticNames().iterator(); while( pItr.hasNext() ) { SESEandAgePair p = pItr.next(); output.println(" SESErecord* "+p+";"); } - + */ // Check to see if we need to do a GC if this is a // multi-threaded program... @@ -1883,12 +1846,52 @@ public class BuildCode { HashSet exitset=new HashSet(); exitset.add(seseExit); - generateCode(seseEnter.getNext(0), fm, null, exitset, output, true); + generateCode(fsen.getNext(0), fm, null, exitset, output, true); output.println("}\n\n"); } + + // when a new mlp thread is created for an issued SESE, it is started + // by running this method which blocks on a cond variable until + // it is allowed to transition to execute. Then a case statement + // allows it to invoke the method with the proper SESE body, and after + // exiting the SESE method, executes proper SESE exit code before the + // thread can be destroyed + private void generateSESEinvocationMethod(PrintWriter outmethodheader, + PrintWriter outmethod + ) { + + outmethodheader.println("void* invokeSESEmethod( void* seseRecord );"); + outmethod.println( "void* invokeSESEmethod( void* seseRecord ) {"); + outmethod.println( " int status;"); + outmethod.println( " char errmsg[128];"); + + // generate a case for each SESE class that can be invoked + outmethod.println( " switch( *((int*)seseRecord) ) {"); + outmethod.println( " "); + for(Iterator seseit=mlpa.getAllSESEs().iterator();seseit.hasNext();) { + FlatSESEEnterNode fsen = seseit.next(); + + outmethod.println( " /* "+fsen.getPrettyIdentifier()+" */"); + outmethod.println( " case "+fsen.getIdentifier()+":"); + outmethod.println( " "+fsen.getSESEmethodName()+"( seseRecord );"); + outmethod.println( " break;"); + outmethod.println( ""); + } + + // default case should never be taken, error out + outmethod.println( " default:"); + outmethod.println( " printf(\"Error: unknown SESE class ID in invoke method.\\n\");"); + outmethod.println( " exit(-30);"); + outmethod.println( " break;"); + outmethod.println( " }"); + outmethod.println( " return NULL;"); + outmethod.println( "}\n\n"); + } + + protected void generateCode(FlatNode first, FlatMethod fm, LocalityBinding lb, @@ -2608,39 +2611,17 @@ public class BuildCode { // SESE nodes can be parsed for normal compilation, just skip over them return; } - - // output.println("\n /* SESE "+fsen.getPrettyIdentifier()+" issue */"); - - /* - output.println(" tempSESE = mlpCreateSESErecord( "+ - fsen.getIdentifier()+", "+ - "malloc( sizeof( "+fsen.namespaceStructNameString()+") ), "+ - "NULL );"); - - for( int i = 0; i < fsen.numParameters(); ++i ) { - TempDescriptor td = fsen.getParameter( i ); - output.println(" (("+fsen.namespaceStructNameString()+ - "*)tempSESE->namespace)->"+td+" = "+td+";"); - } - - output.println(" mlpIssue( tempSESE );"); - //output.println(" tempSESE = mlpSchedule();"); + + output.println( " {" ); - // do a pthread_create wit invokeSESE as the argument - // and pack all args into a single void* - output.println(" tempSESEargs = malloc( sizeof( invokeSESEargs ) );"); - output.println(" tempSESEargs->classID = "+fsen.getIdentifier()+";"); - output.println(" tempSESEargs->invokee = mlpSchedule();"); + output.println( " "); + output.println( " "); + output.println( " "); + output.println( " "); - if( fsen.getParent() == null ) { - output.println(" tempSESEargs->parent = NULL;"); - } else { - output.println(" tempSESEargs->parent = currentSESE;"); - } + output.println( " "); - output.println(" invokeSESEmethod( (void*) tempSESEargs );"); - output.println("\n"); - */ + output.println( " }" ); } public void generateFlatSESEExitNode(FlatMethod fm, LocalityBinding lb, FlatSESEExitNode fsen, PrintWriter output) { @@ -3326,7 +3307,7 @@ public class BuildCode { output.print(cn.getSafeSymbol()+md.getSafeSymbol()+"_"+md.getSafeMethodDescriptor()+"("); } else output.print(task.getSafeSymbol()+"("); - + if (addSESErecord) { output.print("SESErecord* currentSESE, "); } diff --git a/Robust/src/IR/Flat/FlatSESEEnterNode.java b/Robust/src/IR/Flat/FlatSESEEnterNode.java index 55869529..6b2e1518 100644 --- a/Robust/src/IR/Flat/FlatSESEEnterNode.java +++ b/Robust/src/IR/Flat/FlatSESEEnterNode.java @@ -1,6 +1,8 @@ package IR.Flat; import Analysis.MLP.VariableSourceToken; import Analysis.MLP.SESEandAgePair; +import IR.MethodDescriptor; +import IR.ClassDescriptor; import IR.TypeDescriptor; import IR.Tree.SESENode; import java.util.*; @@ -19,7 +21,17 @@ public class FlatSESEEnterNode extends FlatNode { protected Set inVars; protected Set outVars; protected Set needStaticNameInCode; - protected FlatMethod enclosing; + + // scope info for this SESE + protected FlatMethod fmEnclosing; + protected MethodDescriptor mdEnclosing; + protected ClassDescriptor cdEnclosing; + + // structures that allow SESE to appear as + // a normal method to code generation + protected FlatMethod fmBogus; + protected MethodDescriptor mdBogus; + public FlatSESEEnterNode( SESENode sn ) { this.id = identifier++; @@ -37,6 +49,37 @@ public class FlatSESEEnterNode extends FlatNode { public void rewriteDef() { } + public void setFlatExit( FlatSESEExitNode fsexn ) { + exit = fsexn; + } + + public FlatSESEExitNode getFlatExit() { + return exit; + } + + public int kind() { + return FKind.FlatSESEEnterNode; + } + + public SESENode getTreeNode() { + return treeNode; + } + + public int getIdentifier() { + return id; + } + + public String getPrettyIdentifier() { + if( treeNode.getID() != null ) { + return treeNode.getID(); + } + return ""+id; + } + + public String toString() { + return "sese "+getPrettyIdentifier()+" enter"; + } + public void setParent( FlatSESEEnterNode parent ) { this.parent = parent; } @@ -96,6 +139,7 @@ public class FlatSESEEnterNode extends FlatNode { return vecinVars.size(); } + /* public String namespaceStructNameString() { return "struct SESE_"+getPrettyIdentifier()+"_namespace"; } @@ -114,6 +158,7 @@ public class FlatSESEEnterNode extends FlatNode { public String namespaceStructAccessString( TempDescriptor td ) { return "SESE_"+getPrettyIdentifier()+"_namespace."+td; } + */ public Set getNodeSet() { HashSet tovisit=new HashSet(); @@ -147,42 +192,36 @@ public class FlatSESEEnterNode extends FlatNode { return needStaticNameInCode; } - public void setEnclosingFlatMeth( FlatMethod fm ) { - enclosing = fm; - } + public void setfmEnclosing( FlatMethod fm ) { fmEnclosing = fm; } + public FlatMethod getfmEnclosing() { return fmEnclosing; } - public FlatMethod getEnclosingFlatMeth() { - return enclosing; - } + public void setmdEnclosing( MethodDescriptor md ) { mdEnclosing = md; } + public MethodDescriptor getmdEnclosing() { return mdEnclosing; } - public SESENode getTreeNode() { - return treeNode; - } - - public int getIdentifier() { - return id; - } - - public String getPrettyIdentifier() { - if( treeNode.getID() != null ) { - return treeNode.getID(); - } - return ""+id; - } + public void setcdEnclosing( ClassDescriptor cd ) { cdEnclosing = cd; } + public ClassDescriptor getcdEnclosing() { return cdEnclosing; } - public String toString() { - return "sese "+getPrettyIdentifier()+" enter"; - } + public void setfmBogus( FlatMethod fm ) { fmBogus = fm; } + public FlatMethod getfmBogus() { return fmBogus; } - public void setFlatExit( FlatSESEExitNode fsexn ) { - exit = fsexn; - } + public void setmdBogus( MethodDescriptor md ) { mdBogus = md; } + public MethodDescriptor getmdBogus() { return mdBogus; } - public FlatSESEExitNode getFlatExit() { - return exit; + public String getSESEmethodName() { + return + cdEnclosing.getSafeSymbol()+ + mdBogus.getSafeSymbol()+ + "_"+ + mdBogus.getSafeMethodDescriptor(); } - public int kind() { - return FKind.FlatSESEEnterNode; + public String getSESErecordName() { + return + "struct "+ + cdEnclosing.getSafeSymbol()+ + mdBogus.getSafeSymbol()+ + "_"+ + mdBogus.getSafeMethodDescriptor()+ + "_SESErec"; } } diff --git a/Robust/src/Runtime/mlp_runtime.c b/Robust/src/Runtime/mlp_runtime.c index b1c09b64..a18b4fea 100644 --- a/Robust/src/Runtime/mlp_runtime.c +++ b/Robust/src/Runtime/mlp_runtime.c @@ -14,20 +14,17 @@ #define TRUE 1 +/* SESErecord* mlpCreateSESErecord( int classID, - void* inSetObjs, - void* outSetObjsNotInInSet, - void* inSetPrims, - void* outSetPrimsNotInInSet + void* inSetOutSetObjs, + void* inSetOutSetPrims ) { SESErecord* newrec = RUNMALLOC( sizeof( SESErecord ) ); - newrec->classID = classID; - newrec->inSetObjs = inSetObjs; - newrec->outSetObjsNotInInSet = outSetObjsNotInInSet; - newrec->inSetPrims = inSetPrims; - newrec->outSetPrimsNotInInSet = outSetPrimsNotInInSet; + newrec->classID = classID; + newrec->inSetOutSetObjs = inSetOutSetObjs; + newrec->inSetOutSetPrims = inSetOutSetPrims; pthread_mutex_init( &(newrec->lock), NULL ); newrec->forwardList = createQueue(); @@ -42,38 +39,38 @@ void mlpDestroySESErecord( SESErecord* sese ) { pthread_mutex_destroy( &(sese->lock) ); freeQueue( sese->forwardList ); - RUNFREE( sese->inSetObjs ); - RUNFREE( sese->outSetObjsNotInInSet ); - RUNFREE( sese->inSetPrims ); - RUNFREE( sese->outSetPrimsNotInInSet ); - RUNFREE( sese ); + RUNFREE( sese->inSetOutSetObjs ); + RUNFREE( sese->inSetOutSetPrims ); + RUNFREE( sese ); } +*/ - +/* struct rootSESEinSetObjs { char** argv; }; struct rootSESEinSetPrims { int argc; }; +*/ void mlpInit( int numProcessors, void(*workFunc)(void*), int argc, char** argv, int maxSESEage ) { - SESErecord* rootSESE; + //SESErecord* rootSESE; - struct rootSESEinSetObjs* inObjs = RUNMALLOC( sizeof( struct rootSESEinSetObjs ) ); - struct rootSESEinSetPrims* inPrims = RUNMALLOC( sizeof( struct rootSESEinSetPrims ) ); + //struct rootSESEinSetObjs* inObjs = RUNMALLOC( sizeof( struct rootSESEinSetObjs ) ); + //struct rootSESEinSetPrims* inPrims = RUNMALLOC( sizeof( struct rootSESEinSetPrims ) ); // first initialize the work scheduler workScheduleInit( numProcessors, workFunc ); // the prepare the root SESE - inObjs->argv = argv; - inPrims->argc = argc; - rootSESE = mlpCreateSESErecord( 0, inObjs, NULL, inPrims, NULL ); + //inObjs->argv = argv; + //inPrims->argc = argc; + //rootSESE = mlpCreateSESErecord( 0, inObjs, NULL, inPrims, NULL ); // skip the issue step because the root SESE will // never have outstanding dependencies - workScheduleSubmit( (void*) rootSESE ); + //workScheduleSubmit( (void*) rootSESE ); // now the work scheduler is initialized and work is // in the hopper, so begin processing. This call @@ -82,11 +79,11 @@ void mlpInit( int numProcessors, } -void mlpIssue( SESErecord* sese ) { +void mlpIssue( void* seseRecord ) { } -void mlpStall( SESErecord* sese ) { +void mlpStall( void* seseRecord ) { } diff --git a/Robust/src/Runtime/mlp_runtime.h b/Robust/src/Runtime/mlp_runtime.h index be636faa..5a505ce3 100644 --- a/Robust/src/Runtime/mlp_runtime.h +++ b/Robust/src/Runtime/mlp_runtime.h @@ -6,46 +6,24 @@ #include "Queue.h" #include "psemaphore.h" - +/* // forward delcarations struct SESErecord_t; - -/* -typedef struct SESEvar_t { - // the value when it is known will be placed - // in this location, which can be accessed - // as a variety of types - union { - char sesetype_byte; - int sesetype_boolean; - short sesetype_short; - int sesetype_int; - long long sesetype_long; - short sesetype_char; - float sesetype_float; - double sesetype_double; - void* sesetype_object; - }; -} SESEvar; -*/ - typedef struct SESErecord_t { // the identifier for the class of sese's that // are instances of one particular static code block int classID; - // The following fields have this structure: + // This field is a structure of in-set and out-set + // objects with the following layout: // [INTPTR numPtrs][void* next][ptr0][ptr1]... - void* inSetObjs; - void* outSetObjsNotInInSet; + void* inSetOutSetObjs; - // The following fields point to compile-time - // generated structures that have named - // primitive fields - void* inSetPrims; - void* outSetPrimsNotInInSet; + // This field is a structure of primitives for + // the in-set and out-set + void* inSetOutSetPrims; // the lock guards the following data SESE's // use to coordinate with one another @@ -54,24 +32,31 @@ typedef struct SESErecord_t { int doneExecuting; } SESErecord; +*/ +/* +typedef struct SESEvarSrc_t { + void* seseRecord; + int offset; +} SESEvarSrc; +*/ +/* // simple mechanical allocation and deallocation // of SESE records SESErecord* mlpCreateSESErecord( int classID, - void* inSetObjs, - void* outSetObjsNotInInSet, - void* inSetPrims, - void* outSetPrimsNotInInSet + void* inSetOutSetObjs, + void* inSetOutSetPrims ); void mlpDestroySESErecord( SESErecord* sese ); +*/ // main library functions void mlpInit(); -void mlpIssue( SESErecord* sese ); -void mlpStall( SESErecord* sese ); +void mlpIssue( void* seseRecord ); +void mlpStall( void* seseRecord ); #endif /* __MLP_RUNTIME__ */ diff --git a/Robust/src/Tests/mlp/tinyTest/makefile b/Robust/src/Tests/mlp/tinyTest/makefile index 33e9d122..2633b45b 100644 --- a/Robust/src/Tests/mlp/tinyTest/makefile +++ b/Robust/src/Tests/mlp/tinyTest/makefile @@ -4,7 +4,7 @@ SOURCE_FILES=$(PROGRAM).java BUILDSCRIPT=~/research/Robust/src/buildscript -USEMLP= #-mlp 1 2 # -mlpdebug # use to turn mlp on and off and make sure rest of build not broken +USEMLP= -mlp 1 2 # -mlpdebug # use to turn mlp on and off and make sure rest of build not broken BSFLAGS= $(USEMLP) -nooptimize -debug -garbagestats -mainclass Test -ownership -ownallocdepth 1 -ownwritedots final -enable-assertions -flatirusermethods -ownaliasfile aliases.txt all: $(PROGRAM).bin diff --git a/Robust/src/Tests/mlp/tinyTest/test.java b/Robust/src/Tests/mlp/tinyTest/test.java index c64bc3bd..a6b6f2f1 100644 --- a/Robust/src/Tests/mlp/tinyTest/test.java +++ b/Robust/src/Tests/mlp/tinyTest/test.java @@ -1,3 +1,8 @@ +public class Foo { + public Foo() {} +} + + public class Test { public static void main( String args[] ) { @@ -5,10 +10,16 @@ public class Test { int x = 1; int y = 1; + //Foo f; + sese fi { //if( true ) { x = y + 2; y = 3; + + System.out.println( "fi: x="+x+", y="+y ); + + //f = new Foo(); //} } @@ -41,7 +52,7 @@ public class Test { // forwarded to this sibling //sese fo { // expecting x=5, y=4 - System.out.println( "x="+x+", y="+y ); + System.out.println( "root: x="+x+", y="+y ); //} /* -- 2.34.1