2-obj (allocation-sites of 2"consecutive"receiver objects) class A{ class B class c{ void foo(){ void bar(){← void m(){ V=… A a1 new A();/A/1 Bb new B();/B/1 a1.foo(); b.bar(); A a2 new A();/A/2 a2.foo(); Context Variable Object [B/1,A/1] V [B/1,AW2] V 16
class B { void bar() { A a1 = new A(); // A/1 a1.foo(); A a2 = new A(); // A/2 a2.foo(); } } class A { void foo() { v = … } } 2-obj (allocation-sites of 2 “consecutive” receiver objects) class C { void m() { B b = new B(); // B/1 b.bar(); } } 16 Context Variable Object [B/1,A/1] v … [B/1,A/2] v …
2-obj (allocation-sites of 2"consecutive"receiver objects) class A{ class B class c void foo(){ void bar(){← void m(){ V=… A a1 new A();/A/1 Bb new B();/B/1 a1.foo(); b.bar(); A a2 new A();/A/2 a2.foo(); Context Variable Object B/1 [B/1,A/1] V 0。。 [B/1,AW2] V A/1 A/2 17
class B { void bar() { A a1 = new A(); // A/1 a1.foo(); A a2 = new A(); // A/2 a2.foo(); } } class A { void foo() { v = … } } class C { void m() { B b = new B(); // B/1 b.bar(); } } A/1 A/2 B/1 17 Context Variable Object [B/1,A/1] v … [B/1,A/2] v … 2-obj (allocation-sites of 2 “consecutive” receiver objects)
2-obj (allocation-sites of 2"consecutive"receiver objects) class A{ class B class c{ void foo(){ void bar(){← void m(){ V=… A a1 new A();/A/1 Bb new B();/B/1 a1.foo(); b.bar(); A a2 new A();/A/2 a2.foo(); Context Variable Object k=2 B/1 [B/1,A/1] V [B/1,AW2] V k三 A/1 A/2 18
class B { void bar() { A a1 = new A(); // A/1 a1.foo(); A a2 = new A(); // A/2 a2.foo(); } } class A { void foo() { v = … } } class C { void m() { B b = new B(); // B/1 b.bar(); } } A/1 A/2 B/1 k = 1 k = 2 18 Context Variable Object [B/1,A/1] v … [B/1,A/2] v … 2-obj (allocation-sites of 2 “consecutive” receiver objects)
2-obj (allocation-sites of 2"consecutive"receiver objects) class A{ class B class c{ void foo(){ void bar(){← void m(){ V=… A a1 new A();/A/1 Bb new B();/B/1 a1.foo(); b.bar(); A a2 new A();/A/2 a2.foo(); Context Variable Object k=2 B/1 [B/1,A/1] V [B/1,AW2] V k=I A/1 A/2 Object Allocation Graph (OAG) 19
class B { void bar() { A a1 = new A(); // A/1 a1.foo(); A a2 = new A(); // A/2 a2.foo(); } } class A { void foo() { v = … } } class C { void m() { B b = new B(); // B/1 b.bar(); } } A/1 A/2 B/1 k = 1 k = 2 19 Context Variable Object [B/1,A/1] v … [B/1,A/2] v … 2-obj (allocation-sites of 2 “consecutive” receiver objects) Object Allocation Graph (OAG)
An Observation Redundant Context Element 20
An Observation Redundant Context Element 20