JIT Compiler Design Maxine Virtual Machine Dhwani Pandya

Slides:



Advertisements
Similar presentations
1 Copyright © 2005, Oracle. All rights reserved. Introducing the Java and Oracle Platforms.
Advertisements

Android architecture overview
The road to reliable, autonomous distributed systems
Aarhus University, 2005Esmertec AG1 Implementing Object-Oriented Virtual Machines Lars Bak & Kasper Lund Esmertec AG
Java for High Performance Computing Jordi Garcia Almiñana 14 de Octubre de 1998 de la era post-internet.
JETT 2003 Java.compareTo(C++). JAVA Java Platform consists of 4 parts: –Java Language –Java API –Java class format –Java Virtual Machine.
JVM-1 Introduction to Java Virtual Machine. JVM-2 Outline Java Language, Java Virtual Machine and Java Platform Organization of Java Virtual Machine Garbage.
1 © 1999 Citrix Systems Inc Java on Nemesis Tim Harris.
1 Software Testing and Quality Assurance Lecture 31 – SWE 205 Course Objective: Basics of Programming Languages & Software Construction Techniques.
Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department.
COP4020 Programming Languages
Session-02. Objective In this session you will learn : What is Class Loader ? What is Byte Code Verifier? JIT & JAVA API Features of Java Java Environment.
L EC. 01: J AVA FUNDAMENTALS Fall Java Programming.
JAVA v.s. C++ Programming Language Comparison By LI LU SAMMY CHU By LI LU SAMMY CHU.
CSCI 224 Introduction to Java Programming. Course Objectives  Learn the Java programming language: Syntax, Idioms Patterns, Styles  Become comfortable.
Introduction to .Net Framework
C++ Programming. Table of Contents History What is C++? Development of C++ Standardized C++ What are the features of C++? What is Object Orientation?
1 8/29/05CS360 Windows Programming Professor Shereen Khoja.
@2011 Mihail L. Sichitiu1 Android Introduction Platform Overview.
JIT in webkit. What’s JIT See time_compilation for more info. time_compilation.
Java Introduction Lecture 1. Java Powerful, object-oriented language Free SDK and many resources at
Lecture 10 : Introduction to Java Virtual Machine
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
The Jikes RVM | Ian Rogers, The University of Manchester | Dr. Ian Rogers Jikes RVM Core Team Member Research Fellow, Advanced.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
Proof Carrying Code Zhiwei Lin. Outline Proof-Carrying Code The Design and Implementation of a Certifying Compiler A Proof – Carrying Code Architecture.
Java Virtual Machine Case Study on the Design of JikesRVM.
1 COMP 3438 – Part II-Lecture 1: Overview of Compiler Design Dr. Zili Shao Department of Computing The Hong Kong Polytechnic Univ.
1 Fast and Efficient Partial Code Reordering Xianglong Huang (UT Austin, Adverplex) Stephen M. Blackburn (Intel) David Grove (IBM) Kathryn McKinley (UT.
Replay Compilation: Improving Debuggability of a Just-in Time Complier Presenter: Jun Tao.
Virtual Support for Dynamic Join Points C. Bockisch, M. Haupt, M. Mezini, K. Ostermann Presented by Itai Sharon
Instrumentation in Software Dynamic Translators for Self-Managed Systems Bruce R. Childers Naveen Kumar, Jonathan Misurda and Mary.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
Introduction Why are virtual machines interesting?
Introduction to OOP CPS235: Introduction.
Vertical Profiling : Understanding the Behavior of Object-Oriented Applications Sookmyung Women’s Univ. PsLab Sewon,Moon.
Java How to Program, 9/e Presented by: José M. Reyes Álamo © by Pearson Education, Inc. All Rights Reserved.
1 Asstt. Prof Navjot Kaur Computer Dept PRESENTED BY.
Language Based Operating Systems by Sean Olson What is a virtual machine? What is managed code? Kernels. Memory and security models. What is a language.
RealTimeSystems Lab Jong-Koo, Lim
The Ingredients of Android Applications. A simple application in a process In a classical programming environment, the OS would load the program code.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
A Single Intermediate Language That Supports Multiple Implemtntation of Exceptions Delvin Defoe Washington University in Saint Louis Department of Computer.
Introduction to Operating Systems Concepts
Computer System Structures
Introduction to Visual Basic. NET,. NET Framework and Visual Studio
Applications Active Web Documents Active Web Documents.
Object Oriented Programming in
Visit for more Learning Resources
Before You Begin Nahla Abuel-ola /WIT.
Chapter 1 Introduction.
Chapter 1 Introduction to Computers, Programs, and Java
SOFTWARE DESIGN AND ARCHITECTURE
Chapter 1 Introduction.
Runtime Analysis of Hotspot Java Virtual Machine
Introduction Enosis Learning.
Java Virtual Machine Complete subject details are available at:
CMPE419 Mobile Application Development
Introduction Enosis Learning.
Chapter 3: Operating-System Structures
Virtual Machines (Introduction to Virtual Machines)
An Introduction to Software Architecture
Outline Chapter 2 (cont) OS Design OS structure
(Computer fundamental Lab)
Android Platform, Android App Basic Components
CMPE419 Mobile Application Development
M S COLLEGE ART’S, COMM., SCI. & BMS
Charles Weems and Tim Richards University of Massachusetts Amherst
Outcome of the Lecture Upon completion of this lecture you will be able to understand Fundamentals and Characteristics of Java Language Basic Terminology.
Presentation transcript:

JIT Compiler Design Maxine Virtual Machine Dhwani Pandya

Outline Background Introduction Scheme layout - architecture Features Boot image generation Maxine inspector

Background

Problem statement Need for modular architecture to make VM hardware independent. Exploit all benefits of high level language such as type safety, memory safety, GC and JIT compilation. Reuse of language-independent modules.

Introduction – Maxine VM Virtual machine written in Java. Metacircular VM Open source code base and open research topic. Architecture is modular and it demonstrates “system programming in Java”. Code base is compatible with Java IDEs. -> Eclipse, Netbeans, Intellij Robust and fast enough to serve as a base for research. Support multiple architectures and operating systems. -> X86, ARM -> Linux, macOS

Jikes RVM Major components like JIT and GC, are written in java. Difference between Maxine and Jikes -> Maxine improves approachability and developer efficiency. -> Jikes requires a preprocessor to generate source code depending on various configuration properties while Maxine allows entire code base to be editable and navigable in an IDE. -> Debugging in Jikes requires low-level tools such as gdb which is unaware about the internal details.

System structure Modular, structured around set of components that collaborate via public interfaces. Provide abstractions over the lower-level implementation details. Allow interaction between subsystems and the rest of the system. VM is written in Java, except substrate which is written in C. -> Implements native launcher of the VM. -> Encapsulates native operating system services such as virtual memory operation, native thread support, and signal handling. Exploits standard java language features as much as possible.

Strucutre

Structure(contd.) Layout scheme : Reference scheme : Object representation in memory. First header word points to hub. Second header word stores locking and GC information. Memory representation in Maxine heap : Tuple, array and hybrid representations. Reference scheme : Default is direct reference scheme. Relieves developer from using explicit handles.

Structure(Contd.) Heap allocation and GC : Thread synchronization : Provides memory management, object allocation and garbage collection. Memory management for objects and malloc data. Default GC is stop-the-world collector. Implementation of generational garbage collector is also included. Thread synchronization : Lock information is stored in object header. OS mutex functions to handle contention. Additional Biased locking feature.

Structure(Contd.) Run scheme : Compilation Broker : Invoked after VM starts basic services. Starts up with JDK and then loads and runs user-specified Java class. Compilation Broker : Dynamic compilation-only strategy. Initial compilation with T1X, on the first method invocation. Frequently used methods are then recompiled with C1X the optimizing compiler.

T1X Baseline Compiler Maxine’s first line of execution. The goal is to produce machine code faster. Template-based design. -> Adding segments of binary code, which at runtime can be combined and completed with the values of registers, stack offset and constants. Templates are written with annotations which are used by optimizing compiler. Approachability -> It is easy to modify and experiment with the translation of bytecodes.

T1X (contd.)

Optimizing compiler C1X Compiles optimizing compiler itself, the templates used by T1X, and the methods needed to start up the VM. Safe points and reference maps support GC and deoptimization. Deoptimized code is key for recovering and debugging optimized code. Uses same architecture and intermediate representations as the client compiler of HotSpot VM. Difference is the introduction of XIR(assembler-like API) into C1X, which enables the separation of compiler from the VM.

Boot image generation Boot image is a executable image of the running VM Compilation of VM ahead of time. Runs on pre-existing Hotspot VM. @HOSTED_ONLY annotation to differentiate between boot image generation and normal VM execution mode. The static host VM fields are accessed using reflection. End result is executable and necessary runtime details required to have a stand alone bootstrapped VM.

Boot image generation(Contd.)

Debugging Main challenge is circularity. Inspector is the tool for debugging. Visualizing aspects of VM state that are elusive and widely distributed in other system. It is possible to debug the VM with a single tool, specialized for this purpose. Tracing safepoints to support Deoptimization. Advantage is code reusability.

Maxine Inspector

Maxine inspector(Contd.) Memory inspector :

Maxine Inspector(Contd.) Can visualize State of static boot image. Halted process during debugging session. Core dump Sets breakpoints and watchpoints. Predefined breakpoints. Complexity derives from circularity.

Summary Metacircular VM – for and in Java. Approachable design : - Modular structure. - Debugging tool. Heavy use of annotations.

References https://maxine-vm.readthedocs.io/en/latest/index.html Maxine: An approachable virtual machine for, and in, Java http://www.se-radio.net/2009/09/episode-144-the-maxine-research- virtual-machine-with-doug-simon/ Christian Wimmer, Stefan Brunthaler, Per Larsen, and Michael Franz. Finegrained modularity and reuse of virtual machine components. In Proceedings of the 11th annual international conference on Aspect- oriented Software Development, 2012

Questions?