2 public class Parameter {
9 public Parameter() { a = 0; b = 0; f = null; g = null; }
11 public void bar() { foo(); }
12 public void foo() { bar(); }
15 public class Penguin {
19 public Penguin() { x = 0; y = 0; }
21 public void bar() { x = 1; }
25 flag f; int x; Baw b; Baw bb;
29 static Voo getAVoo( Voo bogus ) {
47 public void doTheBaw( Voo v ) { v = new Voo(); }
52 task ObjectChainByMethodCalls( Foo a{ f } ) {
55 Foo g = a.newFooChain( f );
72 public Foo getAFoo() {
76 public Foo newFooChain( Foo a ) {
84 public void ruinSomeFoos( Foo a, Foo b ) {
88 static public void aStaticMethod( Foo p0, Foo p1 ) {
99 static public void m1_( Foo p0 ) {
107 static public void m2_( Foo p0 ) {
114 static public void m3_( Foo p0 ) {
121 static public void m4_( Foo p0 ) {
125 static public void m5_( Foo p0 ) {
131 static public void m6_( Foo p0, Foo p1 ) {
146 static public void m7_( Foo p0, Foo p1 ) {
162 static public void m8_( Foo p0, Foo p1 ) {
181 // this empty task should still create a non-empty
182 // ownership graph showing parameter allocation
183 // look for the parameter s as a label referencing
184 // a heap region that is multi-object, flagged, not summary
185 task Startup( StartupObject s{ initialstate } ) {
186 taskexit( s{ !initialstate } );
190 task NewObjectA( Foo a{ f }, Foo b{ f } ) {
198 taskexit( a{ !f }, b{ !f } );
202 task NewObjectB( Foo a{ f }, Foo b{ f } ) {
210 taskexit( a{ !f }, b{ !f } );
214 task NewObjectC( Foo a{ f }, Foo b{ f } ) {
229 taskexit( a{ !f }, b{ !f } );
233 task forMethod( Foo p0{ f } ) {
250 taskexit( p0{ !f } );
254 // this task allocates a new object, so there should
255 // be a heap region for the parameter, and several
256 // heap regions for the allocation site, but the label
257 // merely points to the newest region
258 task NewObjectInMethod( Voo v{ f } ) {
267 task ClobberInitParamReflex( Voo v{ f }, Voo w{ f } ) {
270 taskexit( v{ !f }, w{ !f } );
274 task BackToItself( Parameter p0{ w } ) {
276 Penguin p = new Penguin();
281 Parameter p1 = new Parameter();
283 Penguin q = new Penguin();
288 taskexit( p0{ !w } );
292 task SummaryNodeTokens( Foo p0{ f } ) {
307 taskexit( p0{ !f } );
311 task strongUpdates( Foo p0{ f } ) {
324 // this should effect a strong update
336 // p0 points to a multiple-object heap region
337 // so this should not make a strong update
340 taskexit( p0{ !f } );
344 task methodTest( Foo p0{ f } ) {
357 //Foo temp = new Foo();
372 // Foo.test( a0, a1 );
374 taskexit( p0{ !f } );
378 task getNewFromMethod( Foo p0{ f } ) {
379 Voo g = Voo.getAVoo( null );
381 taskexit( p0{ !f } );
385 task methodTest01_( Foo p0{ f }, Foo p1{ f } ) {
387 Foo a0before = new Foo();
389 a0before.x = new Foo();
391 a0before.x = new Foo();
394 Foo a0after = new Foo();
396 a0after.x = new Foo();
398 a0after.x = new Foo();
404 taskexit( p0{ !f }, p1{ !f } );
408 task methodTest02_( Foo p0{ f }, Foo p1{ f } ) {
410 Foo a0before = new Foo();
412 a0before.x = new Foo();
414 a0before.x = new Foo();
417 Foo a0after = new Foo();
419 a0after.x = new Foo();
421 a0after.x = new Foo();
427 taskexit( p0{ !f }, p1{ !f } );
431 task methodTest03_( Foo p0{ f }, Foo p1{ f } ) {
433 Foo a0before = new Foo();
435 a0before.x = new Foo();
437 a0before.x = new Foo();
440 Foo a0after = new Foo();
442 a0after.x = new Foo();
444 a0after.x = new Foo();
450 taskexit( p0{ !f }, p1{ !f } );
454 task methodTest04_( Foo p0{ f }, Foo p1{ f } ) {
456 Foo a0before = new Foo();
458 a0before.x = new Foo();
460 a0before.x = new Foo();
463 Foo a0after = new Foo();
465 a0after.x = new Foo();
467 a0after.x = new Foo();
473 taskexit( p0{ !f }, p1{ !f } );
477 task methodTest05_( 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 methodTest06_( 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();
516 Foo a1before = new Foo();
518 a1before.x = new Foo();
520 a1before.x = new Foo();
523 Foo a1after = new Foo();
525 a1after.x = new Foo();
527 a1after.x = new Foo();
530 Foo.m6_( a0after, a1after );
533 taskexit( p0{ !f }, p1{ !f } );
537 task methodTest07_( Foo p0{ f }, Foo p1{ f } ) {
539 Foo a0before = new Foo();
541 a0before.x = new Foo();
543 a0before.x = new Foo();
546 Foo a0after = new Foo();
548 a0after.x = new Foo();
550 a0after.x = new Foo();
553 Foo a1before = new Foo();
555 a1before.x = new Foo();
557 a1before.x = new Foo();
560 Foo a1after = new Foo();
562 a1after.x = new Foo();
564 a1after.x = new Foo();
567 Foo.m7_( a0after, a1after );
570 taskexit( p0{ !f }, p1{ !f } );
574 task methodTest08_( Foo p0{ f }, Foo p1{ f } ) {
576 Foo a0before = new Foo();
578 a0before.x = new Foo();
580 a0before.x = new Foo();
583 Foo a0after = new Foo();
585 a0after.x = new Foo();
587 a0after.x = new Foo();
590 Foo a1before = new Foo();
592 a1before.x = new Foo();
594 a1before.x = new Foo();
597 Foo a1after = new Foo();
599 a1after.x = new Foo();
601 a1after.x = new Foo();
604 Foo.m8_( a0after, a1after );
607 taskexit( p0{ !f }, p1{ !f } );