Optimizing compilers cisc 673 spring 2009 dynamic compilation i
This presentation is the property of its rightful owner.
Sponsored Links
1 / 15

Optimizing Compilers CISC 673 Spring 2009 Dynamic Compilation I PowerPoint PPT Presentation


  • 50 Views
  • Uploaded on
  • Presentation posted in: General

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.

Download Presentation

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Optimizing compilers cisc 673 spring 2009 dynamic compilation i

Optimizing CompilersCISC 673Spring 2009Dynamic Compilation I

John Cavazos

University of Delaware


Quiz time

Quiz Time

What’s a managed language?


Quiz time1

Quiz Time

What’s a managed language? Java or C#

  • Runs under management of a VM

  • Object Oriented, Garbage collected

  • Dynamic compilation


Quiz time2

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?


What is a vm

What is a VM?


What is a vm1

What is a VM?

A software execution engine that provides a machine-independent language implementation


What s in a vm for a managed language

What’s in a VM for a Managed Language?


What s in a vm for a managed language1

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


Basic vm structure

Basic VM Structure

Program/Bytecode

Executing Program

Class Loader, Verifier, etc.

Heap

Thread Scheduler

Dynamic Compilation Subsystem

Garbage Collector


Adaptive optimization hall of fame

Adaptive Optimization Hall of Fame

  • 1958-1962: LISP

  • 1974: Adaptive Fortran

  • 1980-1984: ParcPlace Smalltalk

  • 1986-1994: Self

  • 1995-present: Java


Quick history of vms

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


Quick history of vms1

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


Quick history of vms2

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


Promise of dynamic optimization

Promise of Dynamic Optimization

  • Compilation tailored to current execution context performs better than ahead-of-time compiler


Promise of dynamic optimization1

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


  • Login