// a code plan contains information based on analysis results
// for injecting code before and/or after a flat node
public class CodePlan {
-
- private Set<VariableSourceToken> writeToDynamicSrc;
private Hashtable< VariableSourceToken, Set<TempDescriptor> > stall2copySet;
+ private Set<TempDescriptor> dynamicStallSet;
public CodePlan() {
- writeToDynamicSrc = null;
-
stall2copySet = new Hashtable< VariableSourceToken, Set<TempDescriptor> >();
+ dynamicStallSet = new HashSet<TempDescriptor>();
}
-
- public void setWriteToDynamicSrc(
- Set<VariableSourceToken> writeToDynamicSrc
- ) {
- this.writeToDynamicSrc = writeToDynamicSrc;
- }
-
- public Set<VariableSourceToken> getWriteToDynamicSrc() {
- return writeToDynamicSrc;
- }
public void addStall2CopySet( VariableSourceToken stallToken,
Set<TempDescriptor> copySet ) {
}
+ public void addDynamicStall( TempDescriptor var ) {
+ dynamicStallSet.add( var );
+ }
+
+ public Set<TempDescriptor> getDynamicStallSet() {
+ return dynamicStallSet;
+ }
+
+
public boolean equals( Object o ) {
if( o == null ) {
return false;
CodePlan cp = (CodePlan) o;
- boolean dynamicSetEq;
- if( writeToDynamicSrc == null ) {
- dynamicSetEq = (cp.writeToDynamicSrc == null);
- } else {
- dynamicSetEq = (writeToDynamicSrc.equals( cp.writeToDynamicSrc ));
- }
-
boolean copySetsEq = (stall2copySet.equals( cp.stall2copySet ));
+
+ boolean dynStallSetEq = (dynamicStallSet.equals( cp.dynamicStallSet ));
- return dynamicSetEq && copySetsEq;
+ return copySetsEq && dynStallSetEq;
}
public int hashCode() {
- int dynamicSetHC = 1;
- if( writeToDynamicSrc != null ) {
- dynamicSetHC = writeToDynamicSrc.hashCode();
- }
int copySetsHC = stall2copySet.hashCode();
- return dynamicSetHC ^ 3*copySetsHC;
+ int dynStallSetHC = dynamicStallSet.hashCode();
+
+ int hash = 7;
+ hash = 31*hash + copySetsHC;
+ hash = 31*hash + dynStallSetHC;
+ return hash;
}
public String toString() {
String s = " PLAN: ";
- if( writeToDynamicSrc != null ) {
- s += "[WRITE DYN";
-
- Iterator<VariableSourceToken> vstItr = writeToDynamicSrc.iterator();
- while( vstItr.hasNext() ) {
- VariableSourceToken vst = vstItr.next();
- s += ", "+vst;
- }
-
- s += "]";
- }
-
if( !stall2copySet.entrySet().isEmpty() ) {
- s += "[STALLS:";
+ s += "[STATIC STALLS:";
}
Iterator cpsItr = stall2copySet.entrySet().iterator();
while( cpsItr.hasNext() ) {
s += "]";
}
+ if( !dynamicStallSet.isEmpty() ) {
+ s += "[DYN STALLS:"+dynamicStallSet+"]";
+ }
+
return s;
}
}
private Hashtable< FlatNode, Set<TempDescriptor> > notAvailableResults;
private Hashtable< FlatNode, CodePlan > codePlans;
+ private Hashtable<FlatEdge, FlatWriteDynamicVarNode> wdvNodesToSpliceIn;
+
public static int maxSESEage = -1;
notAvailableResults = new Hashtable< FlatNode, Set<TempDescriptor> >();
codePlans = new Hashtable< FlatNode, CodePlan >();
+ wdvNodesToSpliceIn = new Hashtable<FlatEdge, FlatWriteDynamicVarNode>();
+
+
FlatMethod fmMain = state.getMethodFlat( tu.getMain() );
rootSESE = (FlatSESEEnterNode) fmMain.getNext(0);
rootSESE.setmdEnclosing( fmMain.getMethod() );
rootSESE.setcdEnclosing( fmMain.getMethod().getClassDesc() );
+ if( state.MLPDEBUG ) {
+ System.out.println( "" );
+ }
// 1st pass
// run analysis on each method that is actually called
// and organize them into roots and children
buildForestForward( fm );
}
+ if( state.MLPDEBUG ) {
+ //System.out.println( "\nSESE Hierarchy\n--------------\n" ); printSESEHierarchy();
+ }
// 2nd pass, results are saved in FlatSESEEnterNode, so
// variable analysis for refinement and stalls
variableAnalysisForward( fm );
}
+ if( state.MLPDEBUG ) {
+ System.out.println( "\nVariable Results\n----------------\n"+fmMain.printMethod( variableResults ) );
+ }
// 4th pass, compute liveness contribution from
// virtual reads discovered in variable pass
livenessAnalysisBackward( rootSESE, true, null, fmMain.getFlatExit() );
+ if( state.MLPDEBUG ) {
+ //System.out.println( "\nSESE Liveness\n-------------\n" ); printSESELiveness();
+ //System.out.println( "\nLiveness Root View\n------------------\n"+fmMain.printMethod( livenessRootView ) );
+ }
// 5th pass
// point, in a forward fixed-point pass
notAvailableForward( fm );
}
+ if( state.MLPDEBUG ) {
+ System.out.println( "\nNot Available Results\n---------------------\n"+fmMain.printMethod( notAvailableResults ) );
+ }
// 5th pass
// compute a plan for code injections
computeStallsForward( fm );
}
+ if( state.MLPDEBUG ) {
+ System.out.println( "\nCode Plans\n----------\n"+fmMain.printMethod( codePlans ) );
+ }
- if( state.MLPDEBUG ) {
- System.out.println( "" );
- //System.out.println( "\nSESE Hierarchy\n--------------\n" ); printSESEHierarchy();
- //System.out.println( "\nSESE Liveness\n-------------\n" ); printSESELiveness();
- //System.out.println( "\nLiveness Root View\n------------------\n"+fmMain.printMethod( livenessRootView ) );
- //System.out.println( "\nVariable Results\n----------------\n"+fmMain.printMethod( variableResults ) );
- //System.out.println( "\nNot Available Results\n---------------------\n"+fmMain.printMethod( notAvailableResults ) );
- //System.out.println( "\nCode Plans\n----------\n"+fmMain.printMethod( codePlans ) );
+ // splice new IR nodes into graph after all
+ // analysis passes are complete
+ Iterator spliceItr = wdvNodesToSpliceIn.entrySet().iterator();
+ while( spliceItr.hasNext() ) {
+ Map.Entry me = (Map.Entry) spliceItr.next();
+ FlatWriteDynamicVarNode fwdvn = (FlatWriteDynamicVarNode) me.getValue();
+ fwdvn.spliceIntoIR();
}
Iterator<TempDescriptor> inVarItr = fsen.getInVarSet().iterator();
while( inVarItr.hasNext() ) {
TempDescriptor inVar = inVarItr.next();
- Integer srcType = vstTable.getRefVarSrcType( inVar, fsen.getParent() );
+ Integer srcType =
+ vstTable.getRefVarSrcType( inVar,
+ fsen,
+ fsen.getParent() );
if( srcType.equals( VarSrcTokTable.SrcType_DYNAMIC ) ) {
fsen.addDynamicInVar( inVar );
// fall through to this default case
default: {
- // decide if we must stall for variables dereferenced at this node
- Set<VariableSourceToken> potentialStallSet =
- vstTable.getChildrenVSTs( currentSESE );
-
// a node with no live set has nothing to stall for
Set<TempDescriptor> liveSet = livenessRootView.get( fn );
if( liveSet == null ) {
}
// check the source type of this variable
- Integer srcType = vstTable.getRefVarSrcType( readtmp,
- currentSESE.getParent() );
+ Integer srcType
+ = vstTable.getRefVarSrcType( readtmp,
+ currentSESE,
+ currentSESE.getParent() );
+
+
+ System.out.println( "considering stall on "+readtmp+" for "+currentSESE );
if( srcType.equals( VarSrcTokTable.SrcType_DYNAMIC ) ) {
- // identify that this is a stall, and allocate an integer
- // pointer in the generated code that keeps a pointer to
- // the source SESE and the address of where to get this thing
- // --then the stall is just wait for that, and copy the
- // one thing because we're not sure if we can copy other stuff
-
- // NEEDS WORK!
-
-
- } else if( srcType.equals( VarSrcTokTable.SrcType_STATIC ) ) {
+ // 1) It is not clear statically where this variable will
+ // come from statically, so dynamically we must keep track
+ // along various control paths, and therefore when we stall,
+ // just stall for the exact thing we need and move on
+ plan.addDynamicStall( readtmp );
+ currentSESE.addDynamicStallVar( readtmp );
+ System.out.println( "ADDING "+readtmp+" TO "+currentSESE+" DYNSTALLSET" );
+ } else if( srcType.equals( VarSrcTokTable.SrcType_STATIC ) ) {
// 2) Single token/age pair: Stall for token/age pair, and copy
// all live variables with same token/age pair at the same
// time. This is the same stuff that the notavaialable analysis
currentSESE.mustTrackAtLeastAge( vst.getAge() );
}
- // if any variable at this node has a static source (exactly one sese)
- // but goes to a dynamic source at a next node, write its dynamic addr
- Set<VariableSourceToken> static2dynamicSet = new HashSet<VariableSourceToken>();
+
+ codePlans.put( fn, plan );
+
+
+ // if any variables at this node have a static source (exactly one vst)
+ // but go to a dynamic source at a next node, create a new IR graph
+ // node on that edge to track the sources dynamically
for( int i = 0; i < fn.numNext(); i++ ) {
FlatNode nn = fn.getNext( i );
VarSrcTokTable nextVstTable = variableResults.get( nn );
+
// the table can be null if it is one of the few IR nodes
// completely outside of the root SESE scope
if( nextVstTable != null ) {
- static2dynamicSet.addAll( vstTable.getStatic2DynamicSet( nextVstTable ) );
- }
- }
- if( !static2dynamicSet.isEmpty() ) {
- plan.setWriteToDynamicSrc( static2dynamicSet );
+ Hashtable<TempDescriptor, VariableSourceToken> static2dynamicSet =
+ vstTable.getStatic2DynamicSet( nextVstTable );
+
+ if( !static2dynamicSet.isEmpty() ) {
+
+ // either add these results to partial fixed-point result
+ // or make a new one if we haven't made any here yet
+ FlatEdge fe = new FlatEdge( fn, nn );
+ FlatWriteDynamicVarNode fwdvn = wdvNodesToSpliceIn.get( fe );
+
+ if( fwdvn == null ) {
+ fwdvn = new FlatWriteDynamicVarNode( fn, nn, static2dynamicSet );
+ wdvNodesToSpliceIn.put( fe, fwdvn );
+ } else {
+ fwdvn.addMoreVar2Src( static2dynamicSet );
+ }
+ }
+ }
}
-
- codePlans.put( fn, plan );
}
}
// given a table from a subsequent program point, decide
// which variables are going from a static source to a
// dynamic source and return them
- public Set<VariableSourceToken> getStatic2DynamicSet( VarSrcTokTable next ) {
+ public Hashtable<TempDescriptor, VariableSourceToken> getStatic2DynamicSet( VarSrcTokTable next ) {
- Set<VariableSourceToken> out = new HashSet<VariableSourceToken>();
+ Hashtable<TempDescriptor, VariableSourceToken> out =
+ new Hashtable<TempDescriptor, VariableSourceToken>();
Iterator itr = var2vst.entrySet().iterator();
while( itr.hasNext() ) {
Map.Entry me = (Map.Entry) itr.next();
TempDescriptor var = (TempDescriptor) me.getKey();
HashSet<VariableSourceToken> s1 = (HashSet<VariableSourceToken>) me.getValue();
-
+
+ // this is a variable with a static source if it
+ // currently has one vst
if( s1.size() == 1 ) {
- // this is a variable with a static source
Set<VariableSourceToken> s2 = next.get( var );
-
+
+ // and if in the next table, it is dynamic, then
+ // this is a transition point, so
if( s2.size() > 1 ) {
- // and in the next table, it is dynamic
- out.addAll( s1 );
+
+ // remember the variable and the only source
+ // it had before crossing the transition
+ out.put( var, s1.iterator().next() );
}
}
}
// 3. Dynamic -- we don't know where the value will come
// from, so we'll track it dynamically
public Integer getRefVarSrcType( TempDescriptor refVar,
+ FlatSESEEnterNode current,
FlatSESEEnterNode parent ) {
assert refVar != null;
- if( parent == null ) {
+ // if you have no parent (root) and the variable in
+ // question is in your in-set, it's a command line
+ // argument and it is definitely available
+ if( parent == null &&
+ current.getInVarSet().contains( refVar ) ) {
return SrcType_READY;
}
Set<VariableSourceToken> srcs = get( refVar );
assert !srcs.isEmpty();
+ // if the variable may have more than one source, or that
+ // source is at the summary age, it must be tracked dynamically
if( srcs.size() > 1 ||
srcs.iterator().next().getAge() == MLPAnalysis.maxSESEage ) {
return SrcType_DYNAMIC;
}
+ // if it has one source that comes from the parent, it's ready
if( srcs.iterator().next().getSESE() == parent ) {
return SrcType_READY;
}
+ // otherwise it comes from one source not the parent (sibling)
+ // and we know exactly which static SESE/age it will come from
return SrcType_STATIC;
}
}
- // declare variables for naming SESE's
+ // declare variables for naming static SESE's
Iterator<SESEandAgePair> pItr = fsen.getNeededStaticNames().iterator();
while( pItr.hasNext() ) {
SESEandAgePair p = pItr.next();
output.println(" void* "+p+";");
}
+ // declare variables for tracking dynamic sources
+ Set<TempDescriptor> dynSrcVars = new HashSet<TempDescriptor>();
+ dynSrcVars.addAll( fsen.getDynamicStallVarSet() );
+ Iterator<FlatSESEEnterNode> childItr = fsen.getChildren().iterator();
+ while( childItr.hasNext() ) {
+ FlatSESEEnterNode child = childItr.next();
+ dynSrcVars.addAll( child.getDynamicInVarSet() );
+ }
+ Iterator<TempDescriptor> dynItr = dynSrcVars.iterator();
+ while( dynItr.hasNext() ) {
+ TempDescriptor dynVar = dynItr.next();
+ output.println(" void* "+dynVar+"_srcSESE;");
+ output.println(" INTPTR "+dynVar+"_srcAddr;");
+ }
+
+
// declare local temps for in-set primitives, and if it is
// a ready-source variable, get the value from the record
Iterator<TempDescriptor> itrInSet = fsen.getInVarSet().iterator();
to = "(void*) ";
size = "sizeof ";
} else {
- //to = "(void*) &("+temp.getSafeSymbol()+")";
to = temp.getSafeSymbol();
size = "sizeof( "+temp.getSafeSymbol()+" )";
}
SESEandAgePair srcPair = new SESEandAgePair( vst.getSESE(), vst.getAge() );
- //String from = "(void*) &("+paramsprefix+"->"+srcPair+"->"+vst.getAddrVar()+")";
String from = paramsprefix+"->"+srcPair+"->"+vst.getAddrVar();
- //output.println(" memcpy( "+to+", "+from+", "+size+" );");
output.println(" "+to+" = "+from+";");
}
output.println(" "+td.getSafeSymbol()+" = child->"+
vst.getAddrVar().getSafeSymbol()+";");
- //output.println("printf(\"copied %d into "+td.getSafeSymbol()+" from "+vst.getAddrVar().getSafeSymbol()+
- //"\\n\", "+td.getSafeSymbol()+" );");
}
output.println(" }");
}
+
+
+ // for each variable with a dynamic source, stall just
+ // for that variable
+ Iterator<TempDescriptor> dynItr = cp.getDynamicStallSet().iterator();
+ while( dynItr.hasNext() ) {
+ TempDescriptor dynVar = dynItr.next();
+
+ }
}
}
case FKind.FlatSESEExitNode:
generateFlatSESEExitNode(fm, lb, (FlatSESEExitNode)fn, output);
break;
+
+ case FKind.FlatWriteDynamicVarNode:
+ generateFlatWriteDynamicVarNode(fm, lb, (FlatWriteDynamicVarNode)fn, output);
+ break;
case FKind.FlatGlobalConvNode:
generateFlatGlobalConvNode(fm, lb, (FlatGlobalConvNode) fn, output);
CodePlan cp = mlpa.getCodePlan( fn );
if( cp != null ) {
-
- /*
- Set<VariableSourceToken> writeDynamic = cp.getWriteToDynamicSrc();
- if( writeDynamic != null ) {
- Iterator<VariableSourceToken> vstItr = writeDynamic.iterator();
- while( vstItr.hasNext() ) {
- VariableSourceToken vst = vstItr.next();
-
- }
- }
- */
}
}
}
output.println(" psem_give( &("+paramsprefix+"->common.stallSem) );");
}
}
+
+ public void generateFlatWriteDynamicVarNode( FlatMethod fm,
+ LocalityBinding lb,
+ FlatWriteDynamicVarNode fwdvn,
+ PrintWriter output
+ ) {
+ if( !state.MLP ) {
+ // should node should not be in an IR graph if the
+ // MLP flag is not set
+ throw new Error("Unexpected presence of FlatWriteDynamicVarNode");
+ }
+
+ Hashtable<TempDescriptor, VariableSourceToken> writeDynamic =
+ fwdvn.getVar2src();
+
+ assert writeDynamic != null;
+
+ Iterator wdItr = writeDynamic.entrySet().iterator();
+ while( wdItr.hasNext() ) {
+ Map.Entry me = (Map.Entry) wdItr.next();
+ TempDescriptor var = (TempDescriptor) me.getKey();
+ VariableSourceToken vst = (VariableSourceToken) me.getValue();
+
+ SESEandAgePair instance = new SESEandAgePair( vst.getSESE(), vst.getAge() );
+
+ output.println(" {");
+ output.println(" "+var+"_srcSESE = "+instance+";");
+
+ output.println(" "+vst.getSESE().getSESErecordName()+"* rec = ("+
+ vst.getSESE().getSESErecordName()+") "+
+ instance+";");
+
+ output.println(" "+var+"_srcAddr = (INTPTR) &(rec->"+vst.getAddrVar()+");");
+ output.println(" }");
+ }
+ }
+
private void generateFlatCheckNode(FlatMethod fm, LocalityBinding lb, FlatCheckNode fcn, PrintWriter output) {
if (state.CONSCHECK) {
FlatSESEEnterNode fsen=sn.getStart().getFlatEnter();
fsexn.setFlatEnter(fsen);
sn.getStart().getFlatEnter().setFlatExit( fsexn );
+
return new NodePair(fsexn, fsexn);
}
public static final int FlatOffsetNode=22;
public static final int FlatSESEEnterNode=23;
public static final int FlatSESEExitNode=24;
- public static final int FlatInstanceOfNode=25;
- public static final int FlatExit=26;
+ public static final int FlatWriteDynamicVarNode=25;
+ public static final int FlatInstanceOfNode=26;
+ public static final int FlatExit=27;
}
--- /dev/null
+package IR.Flat;
+
+public class FlatEdge {
+
+ protected FlatNode tail;
+ protected FlatNode head;
+
+ public FlatEdge( FlatNode t, FlatNode h ) {
+ assert t != null;
+ assert h != null;
+ tail = t;
+ head = h;
+ }
+
+ public boolean equals( Object o ) {
+ if( o == null ) {
+ return false;
+ }
+
+ if( !(o instanceof FlatEdge) ) {
+ return false;
+ }
+
+ FlatEdge fe = (FlatEdge) o;
+
+ return tail.equals( fe.tail ) && head.equals( fe.head );
+ }
+
+ public int hashCode() {
+ int tailHC = tail.hashCode();
+ int headHC = head.hashCode();
+
+ int hash = 7;
+ hash = 31*hash + tailHC;
+ hash = 31*hash + headHC;
+ return hash;
+ }
+
+ public String toString() {
+ return "FlatEdge("+tail+"->"+head+")";
+ }
+}
next.add(n);
n.addPrev(this);
}
+
+ public void removeNext(FlatNode n) {
+ next.remove(n);
+ }
public void removePrev(FlatNode n) {
prev.remove(n);
}
+
/** This function modifies the graph */
public void setNext(int i, FlatNode n) {
FlatNode old=getNext(i);
protected Integer oldestAgeToTrack;
protected Set<FlatSESEEnterNode> children;
- protected Set<TempDescriptor> inVars;
- protected Set<TempDescriptor> outVars;
- protected Set<SESEandAgePair> needStaticNameInCode;
+ protected Set<TempDescriptor> inVars;
+ protected Set<TempDescriptor> outVars;
- protected Set<SESEandAgePair> staticInVarSrcs;
+ protected Set<SESEandAgePair> needStaticNameInCode;
- protected Set<TempDescriptor> readyInVars;
- protected Set<TempDescriptor> staticInVars;
- protected Set<TempDescriptor> dynamicInVars;
+ protected Set<SESEandAgePair> staticInVarSrcs;
+
+ protected Set<TempDescriptor> readyInVars;
+ protected Set<TempDescriptor> staticInVars;
+ protected Set<TempDescriptor> dynamicInVars;
+
+ protected Set<TempDescriptor> dynamicStallVars;
protected Hashtable<TempDescriptor, VariableSourceToken> staticInVar2src;
readyInVars = new HashSet<TempDescriptor>();
staticInVars = new HashSet<TempDescriptor>();
dynamicInVars = new HashSet<TempDescriptor>();
+ dynamicStallVars = new HashSet<TempDescriptor>();
staticInVar2src = new Hashtable<TempDescriptor, VariableSourceToken>();
}
return dynamicInVars;
}
+ public void addDynamicStallVar( TempDescriptor td ) {
+ dynamicStallVars.add( td );
+ }
+
+ public Set<TempDescriptor> getDynamicStallVarSet() {
+ return dynamicStallVars;
+ }
+
public void mustTrackAtLeastAge( Integer age ) {
if( age > oldestAgeToTrack ) {
oldestAgeToTrack = new Integer( age );
--- /dev/null
+package IR.Flat;
+import Analysis.MLP.VariableSourceToken;
+import java.util.Hashtable;
+
+
+// This node is inserted by the MLP analysis
+// in between a (tail -> head) IR graph edge.
+// It is for tracking SESE variables with
+// dynamic sources
+public class FlatWriteDynamicVarNode extends FlatNode {
+
+
+ protected FlatNode tailNode;
+ protected FlatNode headNode;
+
+ protected Hashtable<TempDescriptor, VariableSourceToken> var2src;
+
+
+ public FlatWriteDynamicVarNode( FlatNode t,
+ FlatNode h,
+ Hashtable<TempDescriptor, VariableSourceToken> v2s
+ ) {
+ tailNode = t;
+ headNode = h;
+ var2src = v2s;
+ }
+
+ public void spliceIntoIR() {
+ tailNode.removeNext( headNode );
+ headNode.removePrev( tailNode );
+
+ tailNode.addNext( this );
+ this.addNext( headNode );
+ }
+
+ public void addMoreVar2Src( Hashtable<TempDescriptor, VariableSourceToken> more ) {
+ var2src.putAll( more );
+ }
+
+ public Hashtable<TempDescriptor, VariableSourceToken> getVar2src() {
+ return var2src;
+ }
+
+ public String toString() {
+ return "writeDynVars "+var2src.keySet();
+ }
+
+ public int kind() {
+ return FKind.FlatWriteDynamicVarNode;
+ }
+
+ public FlatNode clone(TempMap t) {
+ return new FlatWriteDynamicVarNode( tailNode, headNode, var2src );
+ }
+ public void rewriteUse(TempMap t) {
+ }
+}
}
}
- if (state.FLATIRGRAPH) {
- FlatIRGraph firg = new FlatIRGraph(state,
- state.FLATIRGRAPHTASKS,
- state.FLATIRGRAPHUSERMETHODS,
- state.FLATIRGRAPHLIBMETHODS);
- }
-
if (state.OWNERSHIP && !state.MLP) {
CallGraph callGraph = new CallGraph(state);
OwnershipAnalysis oa = new OwnershipAnalysis(state,
oa);
}
+ if (state.FLATIRGRAPH) {
+ FlatIRGraph firg = new FlatIRGraph(state,
+ state.FLATIRGRAPHTASKS,
+ state.FLATIRGRAPHUSERMETHODS,
+ state.FLATIRGRAPHLIBMETHODS);
+ }
+
if (state.TAGSTATE) {
CallGraph callgraph=new CallGraph(state);
TagAnalysis taganalysis=new TagAnalysis(state, callgraph);
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= -nooptimize -debug -garbagestats -mainclass Test -ownership -ownallocdepth 1 -ownwritedots final -enable-assertions -flatirusermethods -ownaliasfile aliases.txt
all: $(PROGRAM).bin
}
+// TODO
+// -dynamic variables
+// -objects
+
+
public class Test {
public static void main( String args[] ) {
int x = Integer.parseInt( args[0] );
int y = Integer.parseInt( args[1] );
-
System.out.println( "root: x="+x+", y="+y );
- //Foo f;
-
- sese fi {
- //if( true ) {
-
- System.out.println( "fi: x="+x+", y="+y );
-
- x = y + 2;
- y = 3;
-
- //f = new Foo();
- //}
- }
-
-
- // just for testing root's ability to
- // realize a single exit after all returns
- // DOESN'T WORK!
- /*
- if( false ) {
- return;
+ if( x > 3 ) {
+ sese fi {
+ y = y + 10;
+ }
}
- */
-
+
// see that values from sese fi are
// forwarded to this sibling
- sese fo {
- System.out.println( "fo: x="+x+", y="+y );
- }
+ //sese fo {
+ System.out.println( "fo: x="+x+", y="+y );
+ //}
/*
float xyz = 2.0f;
*/
- //Integer i;
- //afunc( i );
- }
-
- /*
- public static void afunc( Integer i ) {
- i = null;
+ // just for testing root's ability to
+ // realize a single exit after all returns
+ // DOESN'T WORK!
+ //if( false ) {
+ // return;
+ //}
}
- */
}