--- /dev/null
+PROGRAM=Test
+
+SOURCE_FILES=test.java
+
+BUILDSCRIPT=../../../buildscript
+
+COREPROFOVERFLOW= #-coreprof-checkoverflow
+USECOREPROF= #-coreprof $(COREPROFOVERFLOW) \
+ -coreprof-eventwords 1024*1024*128 \
+ -coreprof-enable cpe_main \
+ -coreprof-enable cpe_runmalloc \
+ -coreprof-enable cpe_runfree \
+ -coreprof-enable cpe_count_poolalloc \
+ -coreprof-enable cpe_count_poolreuse \
+ -coreprof-enable cpe_workschedgrab \
+ -coreprof-enable cpe_taskdispatch \
+ -coreprof-enable cpe_taskexecute \
+ -coreprof-enable cpe_taskretire
+# -coreprof-enable cpe_taskstallvar \
+# -coreprof-enable cpe_taskstallmem
+
+
+DISJOINT= -disjoint -disjoint-k 1 -enable-assertions #-disjoint-desire-determinism
+
+USEOOO= -ooojava 8 2 -ooodebug -squeue
+USERCR= -ooojava 7 2 -rcr -pointer -ooodebug -squeue
+
+BSFLAGS= -64bit -mainclass $(PROGRAM) -heapsize-mb 1024 -garbagestats -noloop -joptimize -debug #-ooodebug-disable-task-mem-pool -justanalyze
+
+
+all: ooo
+
+
+single:
+ $(BUILDSCRIPT) $(BSFLAGS) -thread -o $(PROGRAM)s -builddir sing $(SOURCE_FILES)
+
+
+ooo: $(PROGRAM)p.bin
+
+$(PROGRAM)p.bin: $(SOURCE_FILES) makefile
+ $(BUILDSCRIPT) $(BSFLAGS) $(USECOREPROF) $(USEOOO) $(DISJOINT) -o $(PROGRAM)p -builddir par $(SOURCE_FILES)
+
+rcr: $(PROGRAM)r.bin
+
+$(PROGRAM)r.bin: $(SOURCE_FILES) makefile
+ $(BUILDSCRIPT) $(BSFLAGS) $(USECOREPROF) $(USERCR) $(DISJOINT) -o $(PROGRAM)r -builddir rcr $(SOURCE_FILES)
+
+
+clean:
+ rm -f $(PROGRAM)p.bin $(PROGRAM)r.bin $(PROGRAM)s.bin
+ rm -fr par rcr sing
+ rm -f *~
+ rm -f *.dot
+ rm -f *.png
+ rm -f *.txt
+ rm -f aliases.txt
+ rm -f mlpReport*txt
+ rm -f results*txt
+ rm -f coreprof.dat
--- /dev/null
+
+public class Foo {
+ public int z;
+ public Foo x;
+
+ public Foo() {
+ z = 0;
+ x = null;
+ }
+}
+
+public class Test {
+
+ static public void main( String args[] ) {
+ innerMain( Integer.parseInt( args[0] ) );
+ }
+
+ static public void innerMain( int n ) {
+
+ int total = 0;
+
+ // attach a big chain of things that we'll
+ // never use in the actual computation, but
+ // write code in such a way that traverser
+ // must conservatively walk the whole chain,
+ // because we want the traversers to get
+ // behind and do something EVIL!!
+ Foo bigChain = createAFoo();
+ Foo newLink = bigChain;
+ for( int i = 0; i < 900900; ++i ) {
+ newLink.x = createAFoo();
+ newLink = newLink.x;
+ }
+
+ for( int i = 0; i < n; ++i ) {
+
+ Foo tmp = createAFoo();
+ Foo val = createAFoo();
+ val.z = i*3;
+ val.x = bigChain;
+ tmp.x = val;
+
+ sese evil {
+ Foo foo = tmp;
+
+ // actual computation just gets to val,
+ // traverser will go down the big chain
+ for( int j = 0; j < 1; ++j ) {
+ foo = foo.x;
+ }
+
+ // now mutate heap so traverser, if it
+ // ran, would be broken
+ tmp.x = null;
+
+ // then do some tiny bit of work
+ total += compute( foo );
+ }
+ }
+
+ System.out.println( total );
+ }
+
+ static public int compute( Foo foo ) {
+
+ // create a write effect that
+ // does not actually mutate heap
+ Foo bar = foo;
+ for( int j = 0; j < 2; ++j ) {
+ bar = bar.x;
+ }
+ foo.x.x = bar;
+
+ return foo.z;
+ }
+
+ static Foo createAFoo() {
+ return new Foo();
+ }
+}