2 public class Parameter {
11 public Parameter() { a = 0; b = 0; f = null; g = null; }
13 public void bar() { foo(); }
14 public void foo() { bar(); }
17 public class Penguin {
22 public Penguin() { x = 0; y = 0; }
24 public void bar() { x = 1; }
28 flag f; int x; Baw b; Baw bb;
32 static Voo getAVoo( Voo bogus ) {
51 public void doTheBaw( Voo v ) { v = new Voo(); }
65 public Foo getAFoo() {
69 public Foo newFooChain( Foo a ) {
75 public void ruinSomeFoos( Foo a, Foo b ) {
79 static public void aStaticMethod( Foo p0, Foo p1 ) {
90 static public void m1_( Foo p0 ) {
98 static public void m2_( Foo p0 ) {
105 static public void m3_( Foo p0 ) {
112 static public void m4_( Foo p0 ) {
116 static public void m5_( Foo p0 ) {
122 static public void m6_( Foo p0, Foo p1 ) {
137 static public void m7_( Foo p0, Foo p1 ) {
153 static public void m8_( Foo p0, Foo p1 ) {
172 // this empty task should still create a non-empty
173 // ownership graph showing parameter allocation
174 // look for the parameter s as a label referencing
175 // a heap region that is multi-object, flagged, not summary
176 task Startup( StartupObject s{ initialstate } ) {
178 Parameter p0 = new Parameter();
191 taskexit( s{ !initialstate } );
195 task NewObjectA( Foo a{ f }, Foo b{ f } ) {
203 taskexit( a{ !f }, b{ !f } );
207 task NewObjectB( Foo a{ f }, Foo b{ f } ) {
215 taskexit( a{ !f }, b{ !f } );
219 task NewObjectC( Foo a{ f }, Foo b{ f } ) {
234 taskexit( a{ !f }, b{ !f } );
238 task forMethod( Foo p0{ f } ) {
255 taskexit( p0{ !f } );
259 // this task allocates a new object, so there should
260 // be a heap region for the parameter, and several
261 // heap regions for the allocation site, but the label
262 // merely points to the newest region
263 task NewObjectInMethod( Voo v{ f } ) {
272 task ClobberInitParamReflex( Voo v{ f }, Voo w{ f } ) {
275 taskexit( v{ !f }, w{ !f } );
279 task BackToItself( Parameter p0{ w } ) {
281 Penguin p = new Penguin();
286 Parameter p1 = new Parameter();
288 Penguin q = new Penguin();
293 taskexit( p0{ !w } );
297 task SummaryNodeTokens( Foo p0{ f } ) {
312 taskexit( p0{ !f } );
316 task strongUpdates( Foo p0{ f } ) {
329 // this should effect a strong update
341 // p0 points to a multiple-object heap region
342 // so this should not make a strong update
345 taskexit( p0{ !f } );
349 task ObjectChainByMethodCalls( Foo a{ f } ) {
352 Foo g = a.newFooChain( f );
359 task arrayAssignments( Foo a{ f } ) {
361 Foo f[] = new Foo[3];
378 public static void FooToBaw( Baw x, Foo y ) {
383 task showPrunedEdgesInMethodCall( Foo a{ f } ) {
394 Zool.FooToBaw( c, b );
399 task showStringIsImmutable( Foo a{ f } ) {
405 String s = new String();
417 task methodTest( Foo p0{ f } ) {
430 //Foo temp = new Foo();
445 // Foo.test( a0, a1 );
447 taskexit( p0{ !f } );
451 task getNewFromMethod( Foo p0{ f } ) {
452 Voo g = Voo.getAVoo( null );
454 taskexit( p0{ !f } );
458 task methodTest01_( Foo p0{ f }, Foo p1{ f } ) {
460 Foo a0before = new Foo();
462 a0before.x = new Foo();
464 a0before.x = new Foo();
467 Foo a0after = new Foo();
469 a0after.x = new Foo();
471 a0after.x = new Foo();
477 taskexit( p0{ !f }, p1{ !f } );
481 task methodTest02_( Foo p0{ f }, Foo p1{ f } ) {
483 Foo a0before = new Foo();
485 a0before.x = new Foo();
487 a0before.x = new Foo();
490 Foo a0after = new Foo();
492 a0after.x = new Foo();
494 a0after.x = new Foo();
500 taskexit( p0{ !f }, p1{ !f } );
504 task methodTest03_( Foo p0{ f }, Foo p1{ f } ) {
506 Foo a0before = new Foo();
508 a0before.x = new Foo();
510 a0before.x = new Foo();
513 Foo a0after = new Foo();
515 a0after.x = new Foo();
517 a0after.x = new Foo();
523 taskexit( p0{ !f }, p1{ !f } );
527 task methodTest04_( Foo p0{ f }, Foo p1{ f } ) {
529 Foo a0before = new Foo();
531 a0before.x = new Foo();
533 a0before.x = new Foo();
536 Foo a0after = new Foo();
538 a0after.x = new Foo();
540 a0after.x = new Foo();
546 taskexit( p0{ !f }, p1{ !f } );
550 task methodTest05_( Foo p0{ f }, Foo p1{ f } ) {
552 Foo a0before = new Foo();
554 a0before.x = new Foo();
556 a0before.x = new Foo();
559 Foo a0after = new Foo();
561 a0after.x = new Foo();
563 a0after.x = new Foo();
569 taskexit( p0{ !f }, p1{ !f } );
573 task methodTest06_( Foo p0{ f }, Foo p1{ f } ) {
575 Foo a0before = new Foo();
577 a0before.x = new Foo();
579 a0before.x = new Foo();
582 Foo a0after = new Foo();
584 a0after.x = new Foo();
586 a0after.x = new Foo();
589 Foo a1before = new Foo();
591 a1before.x = new Foo();
593 a1before.x = new Foo();
596 Foo a1after = new Foo();
598 a1after.x = new Foo();
600 a1after.x = new Foo();
603 Foo.m6_( a0after, a1after );
606 taskexit( p0{ !f }, p1{ !f } );
610 task methodTest07_( Foo p0{ f }, Foo p1{ f } ) {
612 Foo a0before = new Foo();
614 a0before.x = new Foo();
616 a0before.x = new Foo();
619 Foo a0after = new Foo();
621 a0after.x = new Foo();
623 a0after.x = new Foo();
626 Foo a1before = new Foo();
628 a1before.x = new Foo();
630 a1before.x = new Foo();
633 Foo a1after = new Foo();
635 a1after.x = new Foo();
637 a1after.x = new Foo();
640 Foo.m7_( a0after, a1after );
643 taskexit( p0{ !f }, p1{ !f } );
647 task methodTest08_( Foo p0{ f }, Foo p1{ f } ) {
649 Foo a0before = new Foo();
651 a0before.x = new Foo();
653 a0before.x = new Foo();
656 Foo a0after = new Foo();
658 a0after.x = new Foo();
660 a0after.x = new Foo();
663 Foo a1before = new Foo();
665 a1before.x = new Foo();
667 a1before.x = new Foo();
670 Foo a1after = new Foo();
672 a1after.x = new Foo();
674 a1after.x = new Foo();
677 Foo.m8_( a0after, a1after );
680 taskexit( p0{ !f }, p1{ !f } );