2 public class Parameter {
13 public void bar() { foo(); }
14 public void foo() { bar(); }
16 static public void proof( Fooz p0, Fooz p1 ) {
32 public class Penguin {
37 public Penguin() { x = 0; y = 0; }
39 public void bar() { x = 1; }
43 flag f; int x; Baw b; Baw bb;
47 static Voo getAVoo( Voo bogus ) {
66 public void doTheBaw( Voo v ) { v = new Voo(); }
80 public Foo getAFoo() {
84 public Foo newFooChain( Foo a ) {
90 public void ruinSomeFoos( Foo a, Foo b ) {
94 static public void aStaticMethod( Foo p0, Foo p1 ) {
105 static public void m1_( Foo p0 ) {
113 static public void m2_( Foo p0 ) {
120 static public void m3_( Foo p0 ) {
127 static public void m4_( Foo p0 ) {
131 static public void m5_( Foo p0 ) {
137 static public void m6_( Foo p0, Foo p1 ) {
152 static public void m7_( Foo p0, Foo p1 ) {
168 static public void m8_( Foo p0, Foo p1 ) {
184 static public void m9_( Foo p0, Foo p1 ) {
194 // this empty task should still create a non-empty
195 // ownership graph showing parameter allocation
196 // look for the parameter s as a label referencing
197 // a heap region that is multi-object, flagged, not summary
198 task Startup( StartupObject s{ initialstate } ) {
200 //Parameter p0 = new Parameter();
204 Parameter.proof( null, null );
206 taskexit( s{ !initialstate } );
211 task NewObjectA( Foo a{ f }, Foo b{ f } ) {
219 taskexit( a{ !f }, b{ !f } );
223 task NewObjectB( Foo a{ f }, Foo b{ f } ) {
231 taskexit( a{ !f }, b{ !f } );
235 task NewObjectC( Foo a{ f }, Foo b{ f } ) {
250 taskexit( a{ !f }, b{ !f } );
254 task forMethod( Foo p0{ f } ) {
271 taskexit( p0{ !f } );
275 // this task allocates a new object, so there should
276 // be a heap region for the parameter, and several
277 // heap regions for the allocation site, but the label
278 // merely points to the newest region
279 task NewObjectInMethod( Voo v{ f } ) {
288 task ClobberInitParamReflex( Voo v{ f }, Voo w{ f } ) {
291 taskexit( v{ !f }, w{ !f } );
295 task BackToItself( Parameter p0{ w } ) {
297 Penguin p = new Penguin();
302 Parameter p1 = new Parameter();
304 Penguin q = new Penguin();
309 taskexit( p0{ !w } );
313 task SummaryNodeTokens( Foo p0{ f } ) {
328 taskexit( p0{ !f } );
332 task strongUpdates( Foo p0{ f } ) {
346 // this should effect a strong update
358 // p0 points to a multiple-object heap region
359 // so this should not make a strong update
363 taskexit( p0{ !f } );
368 task ObjectChainByMethodCalls( Foo a{ f } ) {
371 Foo g = a.newFooChain( f );
378 task arrayAssignments( Foo a{ f } ) {
380 Foo f[] = new Foo[3];
397 public static void FooToBaw( Baw x, Foo y ) {
402 task showPrunedEdgesInMethodCall( Foo a{ f } ) {
413 Zool.FooToBaw( c, b );
418 task showStringIsImmutable( Foo a{ f } ) {
424 String s = new String();
436 task methodTest( Foo p0{ f } ) {
449 //Foo temp = new Foo();
464 // Foo.test( a0, a1 );
466 taskexit( p0{ !f } );
470 task getNewFromMethod( Foo p0{ f } ) {
471 Voo g = Voo.getAVoo( null );
473 taskexit( p0{ !f } );
477 task methodTest01_( Foo p0{ f }, Foo p1{ f } ) {
479 Foo a0before = new Foo();
481 a0before.x = new Foo();
483 a0before.x = new Foo();
486 Foo a0after = new Foo();
488 a0after.x = new Foo();
490 a0after.x = new Foo();
496 taskexit( p0{ !f }, p1{ !f } );
500 task methodTest02_( Foo p0{ f }, Foo p1{ f } ) {
502 Foo a0before = new Foo();
504 a0before.x = new Foo();
506 a0before.x = new Foo();
509 Foo a0after = new Foo();
511 a0after.x = new Foo();
513 a0after.x = new Foo();
519 taskexit( p0{ !f }, p1{ !f } );
523 task methodTest03_( Foo p0{ f }, Foo p1{ f } ) {
525 Foo a0before = new Foo();
527 a0before.x = new Foo();
529 a0before.x = new Foo();
532 Foo a0after = new Foo();
534 a0after.x = new Foo();
536 a0after.x = new Foo();
542 taskexit( p0{ !f }, p1{ !f } );
546 task methodTest04_( Foo p0{ f }, Foo p1{ f } ) {
548 Foo a0before = new Foo();
550 a0before.x = new Foo();
552 a0before.x = new Foo();
555 Foo a0after = new Foo();
557 a0after.x = new Foo();
559 a0after.x = new Foo();
565 taskexit( p0{ !f }, p1{ !f } );
569 task methodTest05_( Foo p0{ f }, Foo p1{ f } ) {
571 Foo a0before = new Foo();
573 a0before.x = new Foo();
575 a0before.x = new Foo();
578 Foo a0after = new Foo();
580 a0after.x = new Foo();
582 a0after.x = new Foo();
588 taskexit( p0{ !f }, p1{ !f } );
592 task methodTest06_( Foo p0{ f }, Foo p1{ f } ) {
594 Foo a0before = new Foo();
596 a0before.x = new Foo();
598 a0before.x = new Foo();
601 Foo a0after = new Foo();
603 a0after.x = new Foo();
605 a0after.x = new Foo();
608 Foo a1before = new Foo();
610 a1before.x = new Foo();
612 a1before.x = new Foo();
615 Foo a1after = new Foo();
617 a1after.x = new Foo();
619 a1after.x = new Foo();
622 //Foo.m6_( a0after, a1after );
625 taskexit( p0{ !f }, p1{ !f } );
629 task methodTest07_( Foo p0{ f }, Foo p1{ f } ) {
631 Foo a0before = new Foo();
633 a0before.x = new Foo();
635 a0before.x = new Foo();
638 Foo a0after = new Foo();
640 a0after.x = new Foo();
642 a0after.x = new Foo();
645 Foo a1before = new Foo();
647 a1before.x = new Foo();
649 a1before.x = new Foo();
652 Foo a1after = new Foo();
654 a1after.x = new Foo();
656 a1after.x = new Foo();
659 //Foo.m7_( a0after, a1after );
662 taskexit( p0{ !f }, p1{ !f } );
666 task methodTest08_( Foo p0{ f }, Foo p1{ f } ) {
668 Foo a0before = new Foo();
670 a0before.x = new Foo();
672 a0before.x = new Foo();
675 Foo a0after = new Foo();
677 a0after.x = new Foo();
679 a0after.x = new Foo();
682 Foo a1before = new Foo();
684 a1before.x = new Foo();
686 a1before.x = new Foo();
689 Foo a1after = new Foo();
691 a1after.x = new Foo();
693 a1after.x = new Foo();
696 //Foo.m8_( a0after, a1after );
699 taskexit( p0{ !f }, p1{ !f } );
704 task methodTest09_( Foo p0{ f }, Foo p1{ f } ) {
706 Foo a0before = new Foo();
708 a0before.x = new Foo();
710 a0before.x = new Foo();
713 Foo a0after = new Foo();
715 a0after.x = new Foo();
717 a0after.x = new Foo();
720 Foo a1before = new Foo();
722 a1before.x = new Foo();
724 a1before.x = new Foo();
727 Foo a1after = new Foo();
729 a1after.x = new Foo();
731 a1after.x = new Foo();
734 Foo.m9_( a0after, a1after );
737 taskexit( p0{ !f }, p1{ !f } );