-/*
+
public class Parameter {
flag w;
int a, b;
public void bar() { x = 1; }
}
-*/
public class Voo {
- flag f; int x; Baw b;
+ flag f; int x; Baw b; Baw bb;
public Voo() {}
}
public class Baw {
flag g; int y;
+ Foo f;
public Baw() {}
+
+ public void doTheBaw( Voo v ) { v = new Voo(); }
}
+public class Foo {
+ public Foo() {}
+
+ public Foo x;
+
+ public void ruinSomeFoos( Foo a, Foo b ) {
+ a.x = b.x;
+ }
+}
+
// this empty task should still create a non-empty
// ownership graph showing parameter allocation
// look for the parameter s as a label referencing
// a heap region that is multi-object, flagged, not summary
task Startup( StartupObject s{ initialstate } ) {
+
+ Foo a = new Foo();
+ Foo b = new Foo();
+ Foo c = new Foo();
+
+ c.ruinSomeFoos( a, b );
+
taskexit( s{ !initialstate } );
}
// be a heap region for the parameter, and several
// heap regions for the allocation site, but the label
// merely points to the newest region
+
task NewObject( Voo v{ f } ) {
Voo w = new Voo();
+ Baw b = new Baw();
+ b.doTheBaw( w );
taskexit( v{ !f } );
}
}
-task NewInLoop( Voo v{ f } ) {
+task NoAliasNewInLoop( Voo v{ f } ) {
Voo w = new Voo();
for( int i = 0; i < 10; ++i ) {
w.b = new Baw();
+ w.b.f = new Foo();
}
taskexit( v{ !f } );
}
+
+
+task ClobberInitParamReflex( Voo v{ f }, Voo w{ f } ) {
+ v.b = v.bb;
+
+ taskexit( v{ !f }, w{ !f } );
+}
\ No newline at end of file