Lecture13 - Inlining and Devirtualization Lecture 13 CS 501...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
Inlining and Devirtualization Lecture 13 CS 501 May 13, 2009 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Preliminaries Critiques Adaptive Online Context-Sensitive Inlining Hazelwood and Grove A Study of Devirtualization Techniques for a Java JIT Compiler Ishizaki, et al 2
Background image of page 2
Inlining long res; void foo(long x) { res = 2*x; } void bar() { foo(5); } long res; void foo(long x) { res = 2*x; } void bar() { res = 2*5; } long res; void foo(long x) { res = 2*x; } void bar() { res = 10 ; } 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Inlining 2: enter 0 3: mul 2 x#16 4: add res_base#32760 GP 5: store (3) (4) 6: ret 8 7: enter 0 8: param 5 9: call [2] 10: ret 0 2: enter 0 3: mul 2 x#16 4: add res_base#32760 GP 5: store (3) (4) 6: ret 8 7: enter 0 8: mul 2 5 9: add res_base#32760 GP 10: store (8) (9) 11: ret 0 2: enter 0 3: mul 2 x#16 4: add res_base#32760 GP 5: store (3) (4) 6: ret 8 7: enter 0 8: add res_base#32760 GP 9: store 10 (8) 10: ret 0 4
Background image of page 4
Benefts Reduction on Function invocation overhead No marshalling / unmarshalling parameters and return values Better instruction cache locality Expanded optimization opportunities CSE, constant propagation, unreachable code elimination, . .. Poor man’s interprocedural optimization 5
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Costs Code size Typically expands overall program size Can hurt icache Compilation time Larger methods can lead to more expensive compilation, more complex control fow 6
Background image of page 6
Language / runtime aspects What is the cost of a function call? C: cheap,
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/09/2012 for the course CSE 403 taught by Professor Staff during the Spring '08 term at University of Washington.

Page1 / 26

Lecture13 - Inlining and Devirtualization Lecture 13 CS 501...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online