Towards Dynamic Interprocedural Analysis in JVMs
Feng Qian and Laurie Hendren {fqian,hendren}@cs.mcgill.ca.
School of Computer Science, McGill University
http://www.sable.mcgill.ca
VM 2004 – p.1/23
Towards Dynamic Interprocedural Analysis in JVMs Feng Qian and - - PowerPoint PPT Presentation
Towards Dynamic Interprocedural Analysis in JVMs Feng Qian and Laurie Hendren { fqian,hendren } @cs.mcgill.ca. School of Computer Science, McGill University http://www.sable.mcgill.ca VM 2004 p.1/23 Motivation Goal: do interprocedural
Feng Qian and Laurie Hendren {fqian,hendren}@cs.mcgill.ca.
School of Computer Science, McGill University
http://www.sable.mcgill.ca
VM 2004 – p.1/23
VM 2004 – p.2/23
VM 2004 – p.2/23
VM 2004 – p.3/23
VM 2004 – p.4/23
method instruction address class A’s TIB virtual method table
TIB = * (ptr + TIB_OFFSET); INSTR = TIB[method_offset]; JMP INSTR *The method_offset is a runtime constant.
VM 2004 – p.5/23
method instruction address
indexed by method_offset indexed by caller_index class A’s TIB
TIB = * (ptr + TIB_OFFSET); CTB = TIB[method_offset]; // load CTB array from TIB INSTR = CTB[caller_index]; // load code address JMP INSTR *The caller_index is a runtime constant.
VM 2004 – p.6/23
VM 2004 – p.7/23
VM 2004 – p.8/23
2 4 8 compress 97.26% 99.99% 99.99% javac 21.62% 64.25% 83.53% jack 48.51% 77.82% 86.01%
VM 2004 – p.9/23
VM 2004 – p.10/23
VM 2004 – p.11/23
VM 2004 – p.12/23
VM 2004 – p.13/23
VM 2004 – p.14/23
VM 2004 – p.15/23
500 1000 1500 2000 2500 3000 50 100 150 200 250 300 the number of call edges from invokevirtuals (jbb) virtual time (the number of opt compiled methods) Dynamic CHA Dynamic RTA ITA Profile
VM 2004 – p.16/23
VM 2004 – p.17/23
foo(): Set s = new MySet(); it = s.iterator(); it.hasNext() it.next() MySet.iterator(): return new MyIterator(); foo MySet MySet.init MySet.iterator MyIterator.hasNext MyIterator.next MyIterator MyIterator.init MySet MySet MyIterator MyIterator MyIterator MyIterator
VM 2004 – p.18/23
compilers constructors call graph classloader analysis dependency databases XTA graphs 1 2 3 4 5 6
VM 2004 – p.19/23
VM 2004 – p.20/23
VM 2004 – p.21/23
VM 2004 – p.22/23