HiPE version 1.0 Kostis Sagonas Uppsala University.

Slides:



Advertisements
Similar presentations
8. Code Generation. Generate executable code for a target machine that is a faithful representation of the semantics of the source code Depends not only.
Advertisements

Mr. D. J. Patel, AITS, Rajkot 1 Operating Systems, by Dhananjay Dhamdhere1 Static and Dynamic Memory Allocation Memory allocation is an aspect of a more.
W EEK S IX O PERATING S YSTEM S TRUCTURE. T HE C ONCEPT OF L OADING AND L INKING Loader – Loader is a utility program which takes object code as input,
Programming Types of Testing.
Run-Time Dynamic Linking for Reprogramming Wireless Sensor Networks
Lab6 – Debug Assembly Language Lab
Slides prepared by Rose Williams, Binghamton University Chapter 1 Getting Started 1.1 Introduction to Java.
Java for High Performance Computing Jordi Garcia Almiñana 14 de Octubre de 1998 de la era post-internet.
Scripting Languages For Virtual Worlds. Outline Necessary Features Classes, Prototypes, and Mixins Static vs. Dynamic Typing Concurrency Versioning Distribution.
Run-Time Storage Organization
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/28/2004CSCI 315 Operating Systems Design1 Operating System Structures & Processes Notice: The slides for this lecture have been largely based on those.
Slide title In CAPITALS 50 pt Slide subtitle 32 pt OTP Development update.
Chapter 3.7 Memory and I/O Systems. 2 Memory Management Only applies to languages with explicit memory management (C or C++) Memory problems are one of.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 2: Operating-System Structures.
A. Frank - P. Weisberg Operating Systems Structure of Operating Systems.
Copyright Arshi Khan1 System Programming Instructor Arshi Khan.
3-1 3 Compilers and interpreters  Compilers and other translators  Interpreters  Tombstone diagrams  Real vs virtual machines  Interpretive compilers.
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.
Java Security. Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security Manager.
Language Systems Chapter FourModern Programming Languages 1.
ITEC 352 Lecture 11 ISA - CPU. ISA (2) Review Questions? HW 2 due on Friday ISA –Machine language –Buses –Memory.
High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.
JIT in webkit. What’s JIT See time_compilation for more info. time_compilation.
Overview of implementations openBGP (and openOSPF) –Active development Zebra –Commercialized Quagga –Active development XORP –Hot Gated –Dead/commercialized.
Lecture 10 : Introduction to Java Virtual Machine
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 2: Operating-System Structures Operating.
1 Comp 104: Operating Systems Concepts Java Development and Run-Time Store Organisation.
1 Introduction to JVM Based on material produced by Bill Venners.
Chapter 3.5 Memory and I/O Systems. 2 Memory Management Memory problems are one of the leading causes of bugs in programs (60-80%) MUCH worse in languages.
1 ENERGY 211 / CME 211 Lecture 26 November 19, 2008.
Copyright © 2007 Addison-Wesley. All rights reserved.1-1 Reasons for Studying Concepts of Programming Languages Increased ability to express ideas Improved.
The HipHop Compiler from Facebook By Megha Gupta & Nikhil Kapoor.
Slide title In CAPITALS 50 pt Slide subtitle 32 pt Erlang/OTP Development at Ericsson.
Chapter 1 Section 1.1 Introduction to Java Slides prepared by Rose Williams, Binghamton University Kenrick Mock, University of Alaska Anchorage.
Basic Semantics Associating meaning with language entities.
Message Analysis-Guided Allocation and Low-Pause Incremental Garbage Collection in a Concurrent Language Konstantinos Sagonas Jesper Wilhelmsson Uppsala.
Processes Introduction to Operating Systems: Module 3.
02/09/2010 Industrial Project Course (234313) Virtualization-aware database engine Final Presentation Industrial Project Course (234313) Virtualization-aware.
Linux Kernel Management. Module 9 – Kernel Administration ♦ Overview The innermost layer of Linux operating system is the kernel, which is a thin layer.
Virtual Machines, Interpretation Techniques, and Just-In-Time Compilers Kostis Sagonas
COMP3190: Principle of Programming Languages
EXTENSIBILITY, SAFETY AND PERFORMANCE IN THE SPIN OPERATING SYSTEM
Static Detection of Race Conditions in Erlang Maria Christakis National Technical University of Athens, Greece Joint work with Kostis Sagonas.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
1 Compiler Construction (CS-636) Muhammad Bilal Bashir UIIT, Rawalpindi.
Chapter 1 Introduction. Chapter 1 -- Introduction2  Def: Compiler --  a program that translates a program written in a language like Pascal, C, PL/I,
M. Accetta, R. Baron, W. Bolosky, D. Golub, R. Rashid, A. Tevanian, and M. Young MACH: A New Kernel Foundation for UNIX Development Presenter: Wei-Lwun.
Full and Para Virtualization
Introduction Why are virtual machines interesting?
Introduction to OOP CPS235: Introduction.
Apache Web Server Architecture Chaitanya Kulkarni MSCS rd April /23/20081Apache Web Server Architecture.
Common Language Runtime Introduction  The common language runtime is one of the most essential component of the.Net Framework.  It acts.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
LECTURE 3 Translation. PROCESS MEMORY There are four general areas of memory in a process. The text area contains the instructions for the application.
ECE 750 Topic 8 Meta-programming languages, systems, and applications Automatic Program Specialization for J ava – U. P. Schultz, J. L. Lawall, C. Consel.
RealTimeSystems Lab Jong-Koo, Lim
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Just-In-Time Compilation. Introduction Just-in-time compilation (JIT), also known as dynamic translation, is a method to improve the runtime performance.
Binding & Dynamic Linking Presented by: Raunak Sulekh(1013) Pooja Kapoor(1008)
Sun Tech Talk 3 Solaris 10 and OpenSolaris Pierre de Filippis Sun Campus Evangelist
Computer System Structures
Lecture 3 Translation.
Using Ada-C/C++ Changer as a Converter Automatically convert to C/C++ to reuse or redeploy your Ada code Eliminate the need for a costly and.
Names and Attributes Names are a key programming language feature
Programming Language Hierarchy, Phases of a Java Program
Chapter 2: System Structures
.Net Framework Details Imran Rashid CTO at ManiWeber Technologies.
(Computer fundamental Lab)
JIT Compiler Design Maxine Virtual Machine Dhwani Pandya
Presentation transcript:

HiPE version 1.0 Kostis Sagonas Uppsala University

Structure of this talk 1. Recent past 2. Present 3. Near future

Part 1: Recent Past

Historical introduction During the last few years, the following people: Erik “Happi” Johansson Mikael Pettersson Richard Carlsson Kostis Sagonas have been having fun developing and maintaining the HiPE system...

HiPE: High Performance Erlang A “just-in-time” native code compiler for Erlang –Allows flexible, user-controlled compilation of Erlang programs to native machine code –Fine-grained: Compilation unit is a single function HiPE 0.92 released as open-source in March 2000 (see also –Released version was JAM-based (Erlang R4) –Available only for SPARC machines

HiPE: Technical Details Both virtual machine code and native code can happily co-exist in the runtime system HiPE optimizes calls to functions which execute in the same mode Preserves tail-calls The generated native code is quite efficient –HiPE significantly outperforms all other Erlang implementations –has similar performance to e.g. Concurrent SML/NJ

Erlang Run-Time System HiPE Compiler JAM Emulator Code area JAM Dissassembler HiPE Loader JAM Bytecode Other Data Native Code Symbolic JAM Icode RTL SPARC The HiPE system Old HiPE Architecture

Speedup of HiPE (0.92) over other Erlang implementations

Success of HiPE: Let’s take a quick poll... Who has used HiPE ? My educated guess: A few… Who is using HiPE instead of using Erlang/OTP ? Most probable answer: None!

Part 2: Present

HiPE version 1.0: The current HiPE team At Uppsala University: Erik “Happi” Johansson Mikael Pettersson Richard Carlsson Kostis Sagonas + Jesper Wilhelmsson Recent addition from the Erlang/OTP team: Bjorn Gustavsson

HiPE version 1.0: Main Features of Interest HiPE is fully and tightly integrated within Open Source Erlang/OTP Release 8 Handles the full Erlang language Back-ends for: –SPARC –x86-based machines running Linux or Solaris Usually very reasonable compilation times Acceptable sizes of object code

Erlang Run-Time System HiPE Compiler BEAM Emulator Code area BEAM Dissassembler HiPE Loader BEAM Bytecode Other Data Native Code Symbolic BEAM Icode RTL SPARC X86 A HiPE-enabled Erlang/OTP system New HiPE Architecture

HiPE version 1.0: Installation Guide 1. Get Open Source Erlang/OTP R8 2. If on SPARC or x86, instead of typing:./configure./make type:./configure --enable-hipe./make

HiPE: Invoking the compiler (novice user) Instead of typing: 1> c(Module, Options). types: 1> c(Module, [native|Options]). Alternatively, instead of typing: erlc … File types: erlc +native … File

HiPE: Invoking the compiler (seasoned user) Instead of typing: 1> c(Module, Options). types: 1> c(Module, [native,{hipe,[’O3’,...]}|Options]). Learns about the full set of HiPE compiler options by typing: 1> hipe:help().

HiPE: Invoking the compiler (expert user) Selectively and dynamically compiles individual Erlang functions using: 1> c(M). … 42> hipe:c({M,F,A}, HiPE_Opts). Reports bugs to:

HiPE: Invoking the compiler (HiPE hacker) Sends bug fixes and compiler improvements to:

HiPE version 1.0: Currently known limitations Native code will not be unloaded once loaded into the system (slight memory leak) Tracing and debugging support is non-existent Hint: Use HiPE once your application is debugged! Floating point arithmetic slower than in BEAM Exception information often slightly differs between BEAM and HiPE in particular, no tracelist is provided Fixed size (i.e., non-resizable) constant pool

HiPE version 1.0: Performance Expectations

HiPE version 1.0: Useful Hints To get the most out of HiPE: Compile all time-critical parts of your Erlang application into native code –Separate hot from cold code (perhaps by placing them into different modules) Avoid easily avoidable mode-switches

Part 3: Near Future

HiPE: Current Work Optimization of inter-process communication and efficient memory management for concurrent processes Formal specification of the Core Erlang language and its full integration within HiPE and Erlang/OTP New inliner for the BEAM compiler Experimental extensions of the Erlang language

Alternative Memory Architectures for Erlang Erlang/OTP has a process-centric view of memory management: each process allocates each own memory area Process 1 heap stack Process 2 heap stack Process n heap stack... Global ETS Table Interprocess communication is quite expensive

Alternative Memory Architectures for Erlang We (mainly Jesper Wilhelmsson) have designed and implemented an Erlang/OTP system where: –the heap is shared between all processes –but each process allocates its own stack Process 1 stack Process 2 stack Process n stack... Global ETS Table Interprocess communication does not involve copying of messages Global Heap

Unified Heap Architecture: Installation Guide 1. Get Erlang/OTP R8 2. Install by typing:./configure --enable-unified-heap./make Warnings: –Highly experimental at this point! –Does not work with HiPE Request: Send us your favourite concurrent Erlang application

Core Erlang: Formal Specification and Use in OSE A small and relatively clean subset of Erlang –Syntactic sugar is removed –Resembles other “core” FP languages An appropriate medium to: –base the compiler’s front-end (already part of R8) –apply high-level transformations such as: inlining (currently under development) deforestation (prototype; results so far inconclusive) –base work of static analysis or verification A formal definition of Core Erlang is currently available as a tech report (Richard Carlsson et al)

Core Erlang Inliner: User’s Manual Instead of typing: 1> c(Module, Options). type: 1> c(Module, [inline|Options]).

Extensions of the Erlang language Parameterized Erlang modules –Design laid out; issue is efficient implementation –Current work by Richard Carlsson & Mikael Pettersson User-defined parametric datatypes (a la ML) Structured module system for Erlang