1 / 15

Optimizing Compilers CISC 673 Spring 2009 Dynamic Compilation I

Optimizing Compilers CISC 673 Spring 2009 Dynamic Compilation I. John Cavazos University of Delaware. Quiz Time. What’s a managed language ?. Quiz Time. What’s a managed language ? Java or C# Runs under management of a VM Object Oriented, Garbage collected Dynamic compilation.

Télécharger la présentation

Optimizing Compilers CISC 673 Spring 2009 Dynamic Compilation I

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. Optimizing CompilersCISC 673Spring 2009Dynamic Compilation I John Cavazos University of Delaware

  2. Quiz Time What’s a managed language?

  3. Quiz Time What’s a managed language? Java or C# • Runs under management of a VM • Object Oriented, Garbage collected • Dynamic compilation

  4. Quiz Time True or False? • Because they execute at runtime, dynamiccompilers must be blazingly fast? • Dynamic class loading is a fundamental roadblock to cross-method optimization? • A static compiler will always produce better code than a dynamic compiler? • Sophisticated profiling is too expensive to perform online?

  5. What is a VM?

  6. What is a VM? A software execution engine that provides a machine-independent language implementation

  7. What’s in a VM for a Managed Language?

  8. What’s in a VM for a Managed Language? • Program loader • Program “checkers”, e.g., bytecode verifiers, security services • Dynamic compilation system • Memory management • Thread scheduler • Profiling & monitoring • Libraries

  9. Basic VM Structure Program/Bytecode Executing Program Class Loader, Verifier, etc. Heap Thread Scheduler Dynamic Compilation Subsystem Garbage Collector

  10. Adaptive Optimization Hall of Fame • 1958-1962: LISP • 1974: Adaptive Fortran • 1980-1984: ParcPlace Smalltalk • 1986-1994: Self • 1995-present: Java

  11. Quick History of VMs • Adaptive Fortran [Hansen’74] • First in-depth exploration of adaptive optimization • Selective optimization, models, multiple optimization levels, online profiling and control systems • LISP Interpreters [McCarthy’78] • First widely used VM • Pioneered VM services • memory management, • Eval -> dynamic loading

  12. Quick History of VMs • ParcPlace Smalltalk[Deutsch&Schiffman’84] • First modern VM • Introduced full-fledge JIT compiler • Demonstrated software-only VMs were viable • Self [Chambers&Ungar’91, Hölzle&Ungar’94] • Developed many advanced VM techniques • Introduced polymorphic inline caches, on-stack replacement, dynamic de-optimization, advanced selective optimization, type prediction and splitting, profile-directed inlining integrated with adaptive recompilation

  13. Quick History of VMs • Java/JVM [Gosling, Joy, Steele ‘96] • First VM with mainstream market penetration • Java vendors embraced and improved Smalltalk and Self technology • Encouraged VM adoption by others → CLR

  14. Promise of Dynamic Optimization • Compilation tailored to current execution context performs better than ahead-of-time compiler

  15. Promise of Dynamic Optimization • Common wisdom: C will always be better • Proof? • Not much • One interesting comparison: VM performace • HotSpot, J9, Apache DRLVM written in C • Jikes RVM, Java-in-Java • 1999: they performed with in 10% • 2007: Jikes RVM ~20% slower than HotSpot & J9, Jikes RVM ~60-0% faster Apache DRLVM • Aside: GCC code 20-10% slower than product compilers

More Related