1 / 24

Just-In-Time Compilation Keith W. Krajewski 3/4/2011 paper:

Just-In-Time Compilation Keith W. Krajewski 3/4/2011 paper: A Brief History of Just-In-Time (2003) John Aycock. Overview. What is JIT? Why know about JIT? Who has used JIT (and to what end)? Simulation JIT in modern languages Classifying JIT techniques Tools for JIT compilation.

kalei
Download Presentation

Just-In-Time Compilation Keith W. Krajewski 3/4/2011 paper:

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Just-In-Time Compilation Keith W. Krajewski 3/4/2011 paper: A Brief History of Just-In-Time (2003) John Aycock

  2. Overview • What is JIT? • Why know about JIT? • Who has used JIT (and to what end)? • Simulation • JIT in modern languages • Classifying JIT techniques • Tools for JIT compilation

  3. What is JIT? • Dynamic compilation • “JIT” itself a new term to computing, ~1993 • Theoretically unnecessary

  4. Goals of JIT • Compiled programs are faster • Interpreted programs are smaller • Interpreted programs are more portable • Interpreter has access to runtime info

  5. Because JIT is like the cure for scurvy. Why know about JIT?

  6. Oberon Erlang O'caml Modern stuff Who has used JIT (and how)? • Early sightings • LC^2 • APL • mixed/throw-away code • Fortran • Smalltalk • Self

  7. Ancient Runes • McCarthy, Lisp (1960), punch cards! • Univ. of Michigan IBM 7060 (1966) • Thompson, regular expressions (1968)

  8. LC^2 • Language for conversational computing • Mitchell, Perlis, & van Zoeren (1968) • Mostly forgettable • Cached the actions it performed

  9. APL • Phillip S. Abrams, 1970 • Drag-along • Beating

  10. Mixed & Throw-Away Code • Mixed – Dakin & Poole (1973) & Dawson (1973) • Throw-away – Basic

  11. Fortran • Hansen's 1974 optimization • Frequency-of-execution counter • Threshold levels • Ordered set of machine-specific optimizations

  12. Smalltalk • Lazy compilation to native code • No pagination of compiled code

  13. Self • David Ungar, Randall Smith, 1987 • Pure OO, dynamically typed • 3 generations • Customization (Pitfall: over-customization) • Optimized type info for loops (Pitfall: compilation time) • Illusion of speed • Influenced Sun's later works (Java)

  14. Oberon • Niklaus Wirth, 1986 • Compiled to “slim binary” • Supported dynamic loading of modules • Continuous re-optimization in background

  15. Erlang • Ericsson, 1986 • HiPe – explicit invocation • Mixed code, switch upon method invocation or exception

  16. O'caml • Specialized the interpreter's instruction set to include “macro opcodes” • … without much benefit

  17. Simulation • 1st gen – straight 1 by 1 translation • 2nd gen – 1 by 1 translation with cache • 3rd gen – blocks of source • 4th gen • Profiled execution • Hot path detection • Code generation • Bailout

  18. HP Dynamo • Compiled HPA-8000 code into HPA-8000 code • ...amazingly, this worked. 30% performance increase • Important to be able to bail out

  19. Java • Static explicit compilation to JVM bytecode • Early JVM did straight interpretation • Motivation for JIT research • Now very portable and relatively quick

  20. C#/.Net • Static compilation to CIL (MSIL), then bytecode • Dynamic per-method compilation to native machine

  21. Classifying JIT • 3 properties • Invocation – explicit/implicit • Executability – monoexecutable/polyexecutable • Concurrency

  22. Toolkits for JIT compilation • Keppel (1991), Engler & Proebsting (1994), Ramsey & Fernandez (1995), Engler (1996), Fraser & Proebsting (1999) • Address three main problems • Binary code generation • Cache coherence • Execution

  23. Summary • Dynamic compilation • Combines best features of both compiled and interpreted programs • Lazy compilation, incremental optimization, mixed code, throw-away code, hotspot detection, machine-specific optimization, customization, simulation • Don't re-invent the wheel again

  24. Works cited • Aycock, John. A Brief History Of Just-In-Time. 2003. • Petzold, Charles. .NET Book Zero. 2006. http://www.charlespetzold.com/dotnet/DotNetBookZero11.pdf • Wikipedia: Just-In-Time Compilation. http://en.wikipedia.org/wiki/JIT_compilation

More Related