Jaos - Java on Aos. Oberon Event 03 Patrik Reali
|
|
- Justina Hoover
- 6 years ago
- Views:
Transcription
1 Jaos - Java on Aos Oberon Event 03 Patrik Reali 1
2 Agenda! Oberon vs. Java! Java for Aos! Type Mapping! Compiling! Linking! Exceptions! Native Methods! Concurrency! Special Topics! Strings! Overloading! Interoperability! Results! Implementation! Future Oberon Event 03 Patrik Reali: Jaos: Java on Aos 2
3 Oberon vs. Java! Similarities! Strongly typed! Object-Oriented! Garbage Collected! Dynamic Loading! Differencies! Loading / Initialization time! Hierarchy Design Oberon Event 03 Patrik Reali: Jaos: Java on Aos 3
4 Oberon vs. Java Object Closure Transitive closure of java.lang.object contains 299 classes (GNU Classpath 0.03) class Object { public String tostring();... class String { } public String touppercase(locale loc);... } public final class Locale implements Serializable, Cloneable {... } Oberon Event 03 Patrik Reali: Jaos: Java on Aos 4
5 Oberon vs. Java OO-Design Limits GNU Classpath 0.03 class String { public String touppercase() { return touppercase(locale.getdefault()); } class Locale { public static final Locale ENGLISH = new Locale("en"); public Locale(String language, String country) { country = country.touppercase();... } Oberon Event 03 Patrik Reali: Jaos: Java on Aos 5
6 Oberon vs. Java Module vs. Class Initialization Oberon Modules:! all imported modules must be loaded and initialized Java Classes:! instance of T is created.! a static method declared by T is invoked.! A static field declared by T is assigned.! A static field declared by T is used and the reference to the field is not a compile-time constant.! References to compile-time constants must be resolved at compile time to a copy of the compile-time constant value, so uses of such a field never cause initialization. Oberon Event 03 Patrik Reali: Jaos: Java on Aos 6
7 Concepts! Use Aos conventions and API for! Memory Layout + Garbage Collection! Calling Convention! Thread Handling! Exception Handling! Compile Byte-Code to IA32! System Integration! Metadata-Loader Plugin! Class-Loader Plugin Oberon Event 03 Patrik Reali: Jaos: Java on Aos 7
8 Type Mapping Basic Types! int LONGINT! long HUGEINT! float REAL! double LONGREAL! char CHAR16 Charsets are incompatible! Identifiers are also different: java: 256 chars (allows _ ) oberon: 32 chars Compound Types! T[] Tarray = OBJECT (jjlobject) p: POINTER TO ARRAY OF T; END Tarray;! Class C MODULE C; TYPE C = OBJECT... END C; END C.! Interfaces! own implementation Arrays have class sematic Active Oberon now uses the same implementation for DEFINITIONS Oberon Event 03 Patrik Reali: Jaos: Java on Aos 8
9 Type Mapping class C: C { float j; static int i; } void M() {} static bool P() {} Warning: static and instance members are not mixed symbol lookup is different MODULE C; TYPE C = OBJECT (C ) VAR j: REAL; PROCEDURE M(); END C; VAR i: LONGINT; PROCEDURE P(): BOOLEAN; END C. Oberon Event 03 Patrik Reali: Jaos: Java on Aos 9
10 Type Mapping! Runtime structures for a Class:! 1 type descriptor! 1 module! Semantic loss:! Java Packages cannot be represented (although the java compiler enforce them) Oberon Event 03 Patrik Reali: Jaos: Java on Aos 10
11 Byte-Code Overview Memory Access! tload / tstore! ttload / ttstore! tconst! getfield / putfield! getstatic / putstatic Operations! tadd / tsub / tmul / tdiv! tshifts Conversions! f2i / i2f / i2l /... Stack! dup / dup2 / dup_x1 /... Control! ifeq / ifne / iflt /...! if_icmpeq / if_acmpeq! invokestatic! invokevirtual! invokeinterface! athrow! treturn Allocation! new / newarray Casting! checkcast / instanceof Oberon Event 03 Patrik Reali: Jaos: Java on Aos 11
12 Compilation Strategies! Interpreted! java is so sloooooow!! but it s everywhere! Compiled! Just-in-time compiler! Ahead-of-time compiler! Mixed Mode! Compiler kinds! client! fast compilation! few optimizations! server! many optimizations! long compilation! Compiler Optimizations! dynamic recompilation! pointer-escape analysis!... Oberon Event 03 Patrik Reali: Jaos: Java on Aos 12
13 Jaos Compilers! Pattern Expansion Compiler! for each byte-code one code pattern! Optimizing Compiler! Idea: Intel / ORP! work on virtual stack! flush virtual stack to code on need! problem: many stack operations! better use of registers Oberon Event 03 Patrik Reali: Jaos: Java on Aos 13
14 Pattern Expansion Compiler PUSH N CASE op OF 2..8: (* iconst-<n> *) JC0.GenPUSH(JC0.Imme, 0, nobase, noinx, noscale, nodisp, op-3); INC(pc) : (* iload-<n> *) index := (op-26) MOD 4; JC0.GenPUSH(JC0.Mem, 0, FP, noinx, noscale, FpOffset(index), noimm); INC(pc); 96: (* iadd *) Pop(EAX); PUSH off[fp] POP EAX ADD 0[SP], EAX JC0.GenTyp1(JC0.ADD, JC0.RegMem, EAX, SP, noinx, noscale, 0, noimm); INC(pc) Oberon Event 03 Patrik Reali: Jaos: Java on Aos 14
15 Pattern Expansion Compiler iload_4 iload_5 iadd istore_6 push off4[fp] push off5[fp] pop EAX add 0[SP], EAX pop off6[fp] Oberon Event 03 Patrik Reali: Jaos: Java on Aos 15
16 Optimizing Compiler Main Idea:! use internal virtual stack! stack values are consts / fields / locals / array fields / registers /...! flush stack as late as possible MOV EAX, off 5 [FP] ADD EAX, off 4 [FP] virtual stack off 4 [FP] off 5 [FP] off 4 [FP] EAX off 4 [FP] EAX MOV off 6 [FP], EAX iload4 iload5 iadd istore6 Oberon Event 03 Patrik Reali: Jaos: Java on Aos 16
17 Optimizing Compiler iload0.. iload3: virtual stack op PushLocal(JavaInt, (op - iload0) MOD 4) iadd: PopItem(JavaINT, v2); IF v2.mode = Stack THEN LoadItem(v2) END; mode := v2.mode; PopAndLoadItem(JavaINT, v1); code emission ReleaseItem(v2); JC0.GenTyp1(op, Mode[mode], v1.base, v2.base, v2.index, v2.scale, v2.disp, v2.val); PushItem(v1) Oberon Event 03 Patrik Reali: Jaos: Java on Aos 17
18 Compiler Comparison 5 instructions 9 memory accesses iload_4 iload_5 iadd istore_6 3 instructions 3 memory accesses Pattern Expansion push off4[fp] push off5[fp] pop EAX add 0[SP], EAX pop off6[fp] Optimized mov EAX, off4[fp] add EAX, off5[fp] mov off6[fp], EAX Oberon Event 03 Patrik Reali: Jaos: Java on Aos 18
19 Linking Linking:! resolution of references among compilation units Ideal case:! JIT inserts the right address when compiling A class A { }......B.x class B { int x; } But...! B is delayed (loaded at first use)! Linking at first use Oberon Event 03 Patrik Reali: Jaos: Java on Aos 19
20 Linking Use code instrumentation to detect first access of static fields and methods B.x class A { }......B.x class B { int x; } CheckClass(B); B.x IF ~B.initialized THEN Initialize(B) END; Oberon Event 03 Patrik Reali: Jaos: Java on Aos 20
21 Exceptions void catchone() { try { tryitout(); } catch (TestExc e) { handleexc(e); } } void catchone() 0 aload_0 1 invokevirtual tryitout(); 4 return 5 astore_1 6 aload_0 7 aload_1 8 invokevirtual handleexc 11 return ExceptionTable From To Target Type TestExc Oberon Event 03 Patrik Reali: Jaos: Java on Aos 21
22 ! 100 Java for Aos Exception Handling / Zero Overhead try {... } catch (Exp1 e) {... } catch (Exp2 e) {... } pc start pc end pc handler1 pc handler2 Global Exception Table start end exception handler pc start pc end Exp1 pc handler1 pc start pc end Exp2 pc handler2 void ExceptionHandler(state) { pc = state.pc, exc = state.exception; } while (!Match(table[i], pc, exc)) { i++; if (i == TableLength) { PopActivationFrame(state); pc = state.pc; i = 0; } } state.pc = pc; ResumeExecution(state) Oberon Event 03 Patrik Reali: Jaos: Java on Aos 22
23 ! 100 Java for Aos Exception Handling / Zero Overhead! exception table filled by the loader / linker! traverse whole table for each stack frame! system has default handler for uncatched exceptions! no exceptions => no overhead! exception case is expensive system optimized for normal case Oberon Event 03 Patrik Reali: Jaos: Java on Aos 23
24 ! 100 Java for Aos Exception Handling / Fast Handling push catch descriptors on the stack try {... } catch (Exp1 e) {... } catch (Exp2 e) {... } pc handler1 pc handler2 use an exception stack to keep track of the handlers add code instrumentation try { save (FP, SP, Exp1, pc handler1 ) save (FP, SP, Exp2, pc handler2 )... remove catch descr. jump end } catch (Exp1 e) {... remove catch descr. jump end } catch (Exp2 e) {... remove catch descr. jump end } end: Oberon Event 03 Patrik Reali: Jaos: Java on Aos 24
25 ! 100 Java for Aos Exception Handling / Fast Handling void ExceptionHandler(ThreadState state) { int FP, SP, handler; Exception e; } do{ retrieve(fp, SP, e, handler); } while (!Match(state.exp, e)); state.fp = FP; // set frame to the one state.sp = SP; // containing the handler state.pc = handler; // resume with the handler ResumeExecution(state) pop next exception descriptor from exception stack can resume in a different activation frame Oberon Event 03 Patrik Reali: Jaos: Java on Aos 25
26 ! 100 Java for Aos Exception Handling / Fast Handling! code instrumentation! insert exception descriptor at try! remove descriptor before catch! fast exception handling! overhead even when no exceptions system optimized for exception case Oberon Event 03 Patrik Reali: Jaos: Java on Aos 26
27 Native Methods java class java loader java linker oberon stub implemented oberon stub type desc Java Methods Oberon Methods Oberon Event 03 Patrik Reali: Jaos: Java on Aos 27
28 Native Methods! Using this strategy, the Oberon implementation can:! define hidden types! define additional methods! define additional fields Oberon Event 03 Patrik Reali: Jaos: Java on Aos 28
29 Concurrency, Locking monitor_enter IF ~lockedbyself() THEN takelock(self) ELSE INC(count) END monitor_exit DEC(count); IF count = 0 THEN releaselock(self) END jjlobject.lock jjlobject.unlock Oberon Event 03 Patrik Reali: Jaos: Java on Aos 29
30 Concurrency, Synchronization Object = OBJECT VAR current, nextticket, count: LONGINT; native impl. of java.lang.object PROCEDURE wait*(); VAR t, count: LONGINT; BEGIN count := SELF.count; t := nextticket; INC(nextTicket); AWAIT((current - t) >= 0); SELF.count := count; END wait; PROCEDURE notify*(); BEGIN INC(current) END notify; simplified version (no timeout) PROCEDURE notifyall*(); BEGIN current := nextticked END nofifyall; END Object Oberon Event 03 Patrik Reali: Jaos: Java on Aos 30
31 Concurrency, Synchronization Thread = OBJECT(Object) PROCEDURE start*(); BEGIN Lock(SELF); state := running; Unlock(SELF); END start; BEGIN {ACTIVE} Lock(SELF); AWAIT(state = running); Unlock(SELF); run; state := dead END Thread; Oberon Event 03 Patrik Reali: Jaos: Java on Aos 31
32 Special Topics Interoperability Oberon source Java source Compiler Compiler Object File Object File Object File Object & Symbol Class File Reflection API Loader Linker Class Loader JIT Compiler Loaded Module Loaded Module Loaded Module Loaded Module Class Class Class Class Class Oberon Event 03 Patrik Reali: Jaos: Java on Aos 32
33 Special Topics Interoperability Oberon source Oberon Browser Java Reflection API Class File Compiler Metadata Object & Symbol Oberon Metadata Loader Java Metadata Loader Loader JIT Compiler Oberon Loader Linker Loader Linker Linker Loaded Loaded Loaded Class Module Module Loaded Module Oberon Event 03 Patrik Reali: Jaos: Java on Aos 33
34 Special Topics Interoperability IMPORT System := java/lang/system, String := java/lang/string ; VAR s: String.String; BEGIN s := String.valueOf(123); System.out.println(s) END Oberon Event 03 Patrik Reali: Jaos: Java on Aos 34
35 Conclusions Java Code Implementation Overview Oberon Code reflect/* Symbol Table Exception Handling Java Libraries (GNU Classpath) Loader OptCompiler Compiler Linker System Runtime InputFileStream OutputFileStream String FileDescr. Throwable Thread Object ClassLoader File Active Objects Aos Kernel Memory Mngmnt Module Mngmnt Files Oberon Event 03 Patrik Reali: Jaos: Java on Aos 35
36 Conclusions Implementation Overview 1076 JVM.Mod 1943 JVMBase.Mod 1252 JVMCompiler.Mod 1010 JVMCompiler0.Mod 432 JVMConsole.Mod 102 JVMConverter.Mod 1087 JVMDebug.Mod 3 JVMEmpty.Mod 583 JVMExceptions.Mod 176 JVMInterfaces.Mod 324 JVMLinker.Mod 1178 JVMLoader.Mod 2509 JVMOptCompiler.Mod 83 JVMParser.Mod 307 JVMRefs.Mod 331 JVMStubs.Mod 561 JVMSystem.Mod 390 JVMThreads.Mod 708 JVMTypes.Mod 363 jjifile.mod 91 jjifiledescriptor.mod 152 jjifileinputstream.mod 114 jjifileoutputstream.mod 69 jjiinputstream.mod 47 jjioutputstream.mod 182 jjldouble.mod 162 jjlfloat.mod 217 jjlmath.mod 57 jjlnumber.mod 279 jjlobject.mod 231 jjlsecuritymanager.mod 540 jjlstring.mod 327 jjlsystem.mod 211 jjlthrowable.mod 96 jjlvmclassloader.mod 53 jjlvmobject.mod 97 jjlvmsecuritymanager.mod 46 jjlvmsystem.mod LOC total some files like jjlstring.mod consists only of definitions! Jaos size: 27 modules 200 KB code 70 KB static data Classpath library: 1025 classfiles 3529 KB Oberon Event 03 Patrik Reali: Jaos: Java on Aos 36
37 Conclusions Benchmarks VM CPU Jaos P-II 700 MHz HotSpot 1.3 P-III 866 MHz 201 compress 202 jess 209 db Oberon Event 03 Patrik Reali: Jaos: Java on Aos 37
38 Conclusions Future Development! Release! Missing Pieces! network! GUI! Optimization! Deployment! Java on a floppy is possible:! Aos Kernel + Jaos ~600KB! Java Libraries ~700 KB (stripped down) Oberon Event 03 Patrik Reali: Jaos: Java on Aos 38
CSE P 501 Compilers. Java Implementation JVMs, JITs &c Hal Perkins Winter /11/ Hal Perkins & UW CSE V-1
CSE P 501 Compilers Java Implementation JVMs, JITs &c Hal Perkins Winter 2008 3/11/2008 2002-08 Hal Perkins & UW CSE V-1 Agenda Java virtual machine architecture.class files Class loading Execution engines
More informationJVML Instruction Set. How to get more than 256 local variables! Method Calls. Example. Method Calls
CS6: Program and Data Representation University of Virginia Computer Science Spring 006 David Evans Lecture 8: Code Safety and Virtual Machines (Duke suicide picture by Gary McGraw) pushing constants JVML
More informationAgenda. CSE P 501 Compilers. Java Implementation Overview. JVM Architecture. JVM Runtime Data Areas (1) JVM Data Types. CSE P 501 Su04 T-1
Agenda CSE P 501 Compilers Java Implementation JVMs, JITs &c Hal Perkins Summer 2004 Java virtual machine architecture.class files Class loading Execution engines Interpreters & JITs various strategies
More informationJVM. What This Topic is About. Course Overview. Recap: Interpretive Compilers. Abstract Machines. Abstract Machines. Class Files and Class File Format
Course Overview What This Topic is About PART I: overview material 1 Introduction 2 Language processors (tombstone diagrams, bootstrapping) 3 Architecture of a compiler PART II: inside a compiler 4 Syntax
More informationCourse Overview. PART I: overview material. PART II: inside a compiler. PART III: conclusion
Course Overview PART I: overview material 1 Introduction (today) 2 Language Processors (basic terminology, tombstone diagrams, bootstrapping) 3 The architecture of a Compiler PART II: inside a compiler
More informationRun-time Program Management. Hwansoo Han
Run-time Program Management Hwansoo Han Run-time System Run-time system refers to Set of libraries needed for correct operation of language implementation Some parts obtain all the information from subroutine
More informationCS2110 Fall 2011 Lecture 25. Under the Hood: The Java Virtual Machine, Part II
CS2110 Fall 2011 Lecture 25 Under the Hood: The Java Virtual Machine, Part II 1 Java program last time Java compiler Java bytecode (.class files) Compile for platform with JIT Interpret with JVM run native
More informationThe Java Virtual Machine. CSc 553. Principles of Compilation. 3 : The Java VM. Department of Computer Science University of Arizona
The Java Virtual Machine CSc 553 Principles of Compilation 3 : The Java VM Department of Computer Science University of Arizona collberg@gmail.com Copyright c 2011 Christian Collberg The Java VM has gone
More informationCSC 4181 Handout : JVM
CSC 4181 Handout : JVM Note: This handout provides you with the basic information about JVM. Although we tried to be accurate about the description, there may be errors. Feel free to check your compiler
More informationJava Class Loading and Bytecode Verification
Java Class Loading and Bytecode Verification Every object is a member of some class. The Class class: its members are the (definitions of) various classes that the JVM knows about. The classes can be dynamically
More informationImproving Java Code Performance. Make your Java/Dalvik VM happier
Improving Java Code Performance Make your Java/Dalvik VM happier Agenda - Who am I - Java vs optimizing compilers - Java & Dalvik - Examples - Do & dont's - Tooling Who am I? (Mobile) Software Engineering
More informationLet s make some Marc R. Hoffmann Eclipse Summit Europe
Let s make some Marc R. Hoffmann Eclipse Summit Europe 2012 24.10.2012 public class WhatIsFaster { int i; void inc1() { i = i + 1; } void inc2() { i += 1; } void inc3() { i++; } } Why? Compilers Scrip;ng
More informationSOFTWARE ARCHITECTURE 7. JAVA VIRTUAL MACHINE
1 SOFTWARE ARCHITECTURE 7. JAVA VIRTUAL MACHINE Tatsuya Hagino hagino@sfc.keio.ac.jp slides URL https://vu5.sfc.keio.ac.jp/sa/ Java Programming Language Java Introduced in 1995 Object-oriented programming
More informationCompiling Techniques
Lecture 10: Introduction to 10 November 2015 Coursework: Block and Procedure Table of contents Introduction 1 Introduction Overview Java Virtual Machine Frames and Function Call 2 JVM Types and Mnemonics
More informationJava: framework overview and in-the-small features
Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer Java: framework overview and in-the-small features Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer
More informationCompilation 2012 Code Generation
Compilation 2012 Jan Midtgaard Michael I. Schwartzbach Aarhus University Phases Computing resources, such as: layout of data structures offsets register allocation Generating an internal representation
More informationThe Java Virtual Machine
Virtual Machines in Compilation Abstract Syntax Tree Compilation 2007 The compile Virtual Machine Code interpret compile Native Binary Code Michael I. Schwartzbach BRICS, University of Aarhus 2 Virtual
More informationDelft-Java Dynamic Translation
Delft-Java Dynamic Translation John Glossner 1,2 and Stamatis Vassiliadis 2 1 IBM Research DSP and Embedded Computing Yorktown Heights, NY glossner@us.ibm.com (formerly with Lucent Technologies) 2 Delft
More informationSystem Software Assignment 1 Runtime Support for Procedures
System Software Assignment 1 Runtime Support for Procedures Exercise 1: Nested procedures Some programming languages like Oberon and Pascal support nested procedures. 1. Find a run-time structure for such
More informationImproving Java Performance
Improving Java Performance #perfmatters Raimon Ràfols ...or the mumbo-jumbo behind the java compiler Agenda - Disclaimer - Who am I? - Our friend the java compiler - Language additions & things to consider
More informationCS263: Runtime Systems Lecture: High-level language virtual machines. Part 1 of 2. Chandra Krintz UCSB Computer Science Department
CS263: Runtime Systems Lecture: High-level language virtual machines Part 1 of 2 Chandra Krintz UCSB Computer Science Department Portable, Mobile, OO Execution Model Execution model embodied by recent
More informationCSc 453 Interpreters & Interpretation
CSc 453 Interpreters & Interpretation Saumya Debray The University of Arizona Tucson Interpreters An interpreter is a program that executes another program. An interpreter implements a virtual machine,
More informationThe Java Language Implementation
CS 242 2012 The Java Language Implementation Reading Chapter 13, sections 13.4 and 13.5 Optimizing Dynamically-Typed Object-Oriented Languages With Polymorphic Inline Caches, pages 1 5. Outline Java virtual
More informationProgramming Language Systems
Programming Language Systems Instructors: Taiichi Yuasa and Masahiro Yasugi Course Description (overview, purpose): The course provides an introduction to run-time mechanisms such as memory allocation,
More informationCompiler construction 2009
Compiler construction 2009 Lecture 3 JVM and optimization. A first look at optimization: Peephole optimization. A simple example A Java class public class A { public static int f (int x) { int r = 3; int
More informationProgram Dynamic Analysis. Overview
Program Dynamic Analysis Overview Dynamic Analysis JVM & Java Bytecode [2] A Java bytecode engineering library: ASM [1] 2 1 What is dynamic analysis? [3] The investigation of the properties of a running
More information3/15/18. Overview. Program Dynamic Analysis. What is dynamic analysis? [3] Why dynamic analysis? Why dynamic analysis? [3]
Overview Program Dynamic Analysis Dynamic Analysis JVM & Java Bytecode [2] A Java bytecode engineering library: ASM [1] 2 What is dynamic analysis? [3] The investigation of the properties of a running
More informationAdministration CS 412/413. Why build a compiler? Compilers. Architectural independence. Source-to-source translator
CS 412/413 Introduction to Compilers and Translators Andrew Myers Cornell University Administration Design reports due Friday Current demo schedule on web page send mail with preferred times if you haven
More informationTopics. Structured Computer Organization. Assembly language. IJVM instruction set. Mic-1 simulator programming
Topics Assembly language IJVM instruction set Mic-1 simulator programming http://www.ontko.com/mic1/ Available in 2 nd floor PC lab S/W found in directory C:\mic1 1 Structured Computer Organization 2 Block
More information02 B The Java Virtual Machine
02 B The Java Virtual Machine CS1102S: Data Structures and Algorithms Martin Henz January 22, 2010 Generated on Friday 22 nd January, 2010, 09:46 CS1102S: Data Structures and Algorithms 02 B The Java Virtual
More informationAn Introduction to Multicodes. Ben Stephenson Department of Computer Science University of Western Ontario
An Introduction to Multicodes Ben Stephenson Department of Computer Science University of Western Ontario ben@csd csd.uwo.ca Outline Java Virtual Machine Background The Current State of the Multicode Art
More informationStatic Analysis of Dynamic Languages. Jennifer Strater
Static Analysis of Dynamic Languages Jennifer Strater 2017-06-01 Table of Contents Introduction............................................................................... 1 The Three Compiler Options...............................................................
More informationCSE 431S Final Review. Washington University Spring 2013
CSE 431S Final Review Washington University Spring 2013 What You Should Know The six stages of a compiler and what each stage does. The input to and output of each compilation stage (especially the back-end).
More informationYETI. GraduallY Extensible Trace Interpreter VEE Mathew Zaleski, Angela Demke Brown (University of Toronto) Kevin Stoodley (IBM Toronto)
YETI GraduallY Extensible Trace Interpreter Mathew Zaleski, Angela Demke Brown (University of Toronto) Kevin Stoodley (IBM Toronto) VEE 2007 1 Goal Create a VM that is more easily extended with a just
More informationJava and C II. CSE 351 Spring Instructor: Ruth Anderson
Java and C II CSE 351 Spring 2017 Instructor: Ruth Anderson Teaching Assistants: Dylan Johnson Kevin Bi Linxing Preston Jiang Cody Ohlsen Yufang Sun Joshua Curtis Administrivia Lab 5 Due TONIGHT! Fri 6/2
More informationVerifying a Compiler for Java Threads
Verifying a Compiler for Java Threads Andreas Lochbihler IPD, PROGRAMMING PARADIGMS GROUP, COMPUTER SCIENCE DEPARTMENT KIT - University of the State of aden-wuerttemberg and National Research Center of
More informationExercise 7 Bytecode Verification self-study exercise sheet
Concepts of ObjectOriented Programming AS 2018 Exercise 7 Bytecode Verification selfstudy exercise sheet NOTE: There will not be a regular exercise session on 9th of November, because you will take the
More informationComputer Components. Software{ User Programs. Operating System. Hardware
Computer Components Software{ User Programs Operating System Hardware What are Programs? Programs provide instructions for computers Similar to giving directions to a person who is trying to get from point
More informationJava Security. Compiler. Compiler. Hardware. Interpreter. The virtual machine principle: Abstract Machine Code. Source Code
Java Security The virtual machine principle: Source Code Compiler Abstract Machine Code Abstract Machine Code Compiler Concrete Machine Code Input Hardware Input Interpreter Output 236 Java programs: definitions
More informationUnder the Hood: The Java Virtual Machine. Problem: Too Many Platforms! Compiling for Different Platforms. Compiling for Different Platforms
Compiling for Different Platforms Under the Hood: The Java Virtual Machine Program written in some high-level language (C, Fortran, ML, ) Compiled to intermediate form Optimized Code generated for various
More informationStatic Program Analysis
Static Program Analysis Thomas Noll Software Modeling and Verification Group RWTH Aachen University https://moves.rwth-aachen.de/teaching/ws-1617/spa/ Recap: Taking Conditional Branches into Account Extending
More informationjavac 29: pop 30: iconst_0 31: istore_3 32: jsr [label_51]
Analyzing Control Flow in Java Bytecode Jianjun Zhao Department of Computer Science and Engineering Fukuoka Institute of Technology 3-10-1 Wajiro-Higashi, Higashi-ku, Fukuoka 811-02, Japan zhao@cs.t.ac.jp
More informationJavaSplit. A Portable Distributed Runtime for Java. Michael Factor Assaf Schuster Konstantin Shagin
JavaSplit A Portable Distributed Runtime for Java Michael Factor Assaf Schuster Konstantin Shagin Motivation Interconnected commodity workstations can yield a cost-effective substitute to super-computers.
More information301AA - Advanced Programming [AP-2017]
301AA - Advanced Programming [AP-2017] Lecturer: Andrea Corradini andrea@di.unipi.it Tutor: Lillo GalleBa galleba@di.unipi.it Department of Computer Science, Pisa Academic Year 2017/18 AP-2017-06: The
More informationDelft-Java Link Translation Buffer
Delft-Java Link Translation Buffer John Glossner 1,2 and Stamatis Vassiliadis 2 1 Lucent / Bell Labs Advanced DSP Architecture and Compiler Research Allentown, Pa glossner@lucent.com 2 Delft University
More informationLaboratoriodiProgrammazione III
LaboratoriodiProgrammazione III Lezione 15: Portabilità e Sicurezza, Java Massimo Tivoli Origins of the language James Gosling and others at Sun, 1990 95 Oak language for set top box small networked device
More informationCompiler construction 2009
Compiler construction 2009 Lecture 2 Code generation 1: Generating Jasmin code JVM and Java bytecode Jasmin Naive code generation The Java Virtual Machine Data types Primitive types, including integer
More informationCOMP3131/9102: Programming Languages and Compilers
COMP3131/9102: Programming Languages and Compilers Jingling Xue School of Computer Science and Engineering The University of New South Wales Sydney, NSW 2052, Australia http://www.cse.unsw.edu.au/~cs3131
More informationSwift: A Register-based JIT Compiler for Embedded JVMs
Swift: A Register-based JIT Compiler for Embedded JVMs Yuan Zhang, Min Yang, Bo Zhou, Zhemin Yang, Weihua Zhang, Binyu Zang Fudan University Eighth Conference on Virtual Execution Environment (VEE 2012)
More informationUnder the Hood: The Java Virtual Machine. Lecture 23 CS2110 Fall 2008
Under the Hood: The Java Virtual Machine Lecture 23 CS2110 Fall 2008 Compiling for Different Platforms Program written in some high-level language (C, Fortran, ML,...) Compiled to intermediate form Optimized
More informationJAM 16: The Instruction Set & Sample Programs
JAM 16: The Instruction Set & Sample Programs Copyright Peter M. Kogge CSE Dept. Univ. of Notre Dame Jan. 8, 1999, modified 4/4/01 Revised to 16 bits: Dec. 5, 2007 JAM 16: 1 Java Terms Java: A simple,
More informationCOMP 520 Fall 2009 Virtual machines (1) Virtual machines
COMP 520 Fall 2009 Virtual machines (1) Virtual machines COMP 520 Fall 2009 Virtual machines (2) Compilation and execution modes of Virtual machines: Abstract syntax trees Interpreter AOT-compile Virtual
More informationBuilding a Compiler with. JoeQ. Outline of this lecture. Building a compiler: what pieces we need? AKA, how to solve Homework 2
Building a Compiler with JoeQ AKA, how to solve Homework 2 Outline of this lecture Building a compiler: what pieces we need? An effective IR for Java joeq Homework hints How to Build a Compiler 1. Choose
More informationIntroduction to Programming (Java) 2/12
Introduction to Programming (Java) 2/12 Michal Krátký Department of Computer Science Technical University of Ostrava Introduction to Programming (Java) 2008/2009 c 2006 2008 Michal Krátký Introduction
More informationCompiling Faster, Compiling Better with Falcon. Iván
Compiling Faster, Compiling Better with Falcon Iván Krȳlov @JohnWings Compiling Faster, Compiling Better with Falcon Overview of 3 technologies Falcon compiler ReadyNow & Compile Stashing Challenges (largely
More informationProblem: Too Many Platforms!
Compiling for Different Platforms 2 Program written in some high-level language (C, Fortran, ML,...) Compiled to intermediate form Optimized UNDE THE HOOD: THE JAVA VITUAL MACHINE Code generated for various
More informationImproving the efficiency of adaptive middleware based on dynamic AOP
Improving the efficiency of adaptive middleware based on dynamic AOP Angela Nicoară, Johann Gyger, Gustavo Alonso Department of Computer Science Swiss Federal Institut of Technology Zürich CH-8092 Zürich,
More informationRoadmap. Java: Assembly language: OS: Machine code: Computer system:
Roadmap C: car *c = malloc(sizeof(car)); c->miles = 100; c->gals = 17; float mpg = get_mpg(c); free(c); Assembly language: Machine code: Computer system: get_mpg: pushq movq... popq ret %rbp %rsp, %rbp
More informationHigh-Level Language VMs
High-Level Language VMs Outline Motivation What is the need for HLL VMs? How are these different from System or Process VMs? Approach to HLL VMs Evolutionary history Pascal P-code Object oriented HLL VMs
More informationJava byte code verification
Java byte code verification SOS Master Science Informatique U. Rennes 1 Thomas Jensen SOS Java byte code verification 1 / 26 Java security architecture Java: programming applications with code from different
More informationEXAMINATIONS 2014 TRIMESTER 1 SWEN 430. Compiler Engineering. This examination will be marked out of 180 marks.
T E W H A R E W Ā N A N G A O T E Ū P O K O O T E I K A A M Ā U I VUW V I C T O R I A UNIVERSITY OF WELLINGTON EXAMINATIONS 2014 TRIMESTER 1 SWEN 430 Compiler Engineering Time Allowed: THREE HOURS Instructions:
More informationWhy GC is eating all my CPU? Aprof - Java Memory Allocation Profiler Roman Elizarov, Devexperts Joker Conference, St.
Why GC is eating all my CPU? Aprof - Java Memory Allocation Profiler Roman Elizarov, Devexperts Joker Conference, St. Petersburg, 2014 Java Memory Allocation Profiler Why it is needed? When to use it?
More informationShared Mutable State SWEN-220
Shared Mutable State SWEN-220 The Ultimate Culprit - Shared, Mutable State Most of your development has been in imperative languages. The fundamental operation is assignment to change state. Assignable
More informationToday. Instance Method Dispatch. Instance Method Dispatch. Instance Method Dispatch 11/29/11. today. last time
CS2110 Fall 2011 Lecture 25 Java program last time Java compiler Java bytecode (.class files) Compile for platform with JIT Interpret with JVM Under the Hood: The Java Virtual Machine, Part II 1 run native
More informationOperating Systems CMPSCI 377 Spring Mark Corner University of Massachusetts Amherst
Operating Systems CMPSCI 377 Spring 2017 Mark Corner University of Massachusetts Amherst Last Class: Intro to OS An operating system is the interface between the user and the architecture. User-level Applications
More informationEXAMINATIONS 2008 MID-YEAR COMP431 COMPILERS. Instructions: Read each question carefully before attempting it.
T E W H A R E W Ā N A N G A O T E Ū P O K O O T E I K A A M Ā U I VUW V I C T O R I A UNIVERSITY OF WELLINGTON EXAMINATIONS 2008 MID-YEAR COMP431 COMPILERS Time Allowed: 3 Hours Instructions: Read each
More information1 Shyam sir JAVA Notes
1 Shyam sir JAVA Notes 1. What is the most important feature of Java? Java is a platform independent language. 2. What do you mean by platform independence? Platform independence means that we can write
More informationPortable Resource Control in Java The J-SEAL2 Approach
Portable Resource Control in Java The J-SEAL2 Approach Walter Binder w.binder@coco.co.at CoCo Software Engineering GmbH Austria Jarle Hulaas Jarle.Hulaas@cui.unige.ch Alex Villazón Alex.Villazon@cui.unige.ch
More informationJSR 292 backport. (Rémi Forax) University Paris East
JSR 292 backport (Rémi Forax) University Paris East Interactive talk Ask your question when you want Just remember : Use only verbs understandable by a 4 year old kid Use any technical words you want A
More informationSABLEJIT: A Retargetable Just-In-Time Compiler for a Portable Virtual Machine p. 1
SABLEJIT: A Retargetable Just-In-Time Compiler for a Portable Virtual Machine David Bélanger dbelan2@cs.mcgill.ca Sable Research Group McGill University Montreal, QC January 28, 2004 SABLEJIT: A Retargetable
More informationRecap: Printing Trees into Bytecodes
Recap: Printing Trees into Bytecodes To evaluate e 1 *e 2 interpreter evaluates e 1 evaluates e 2 combines the result using * Compiler for e 1 *e 2 emits: code for e 1 that leaves result on the stack,
More informationIntroduction to Programming Using Java (98-388)
Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;
More informationHazard Pointers. Number of threads unbounded time to check hazard pointers also unbounded! difficult dynamic bookkeeping! thread B - hp1 - hp2
Hazard Pointers Store pointers of memory references about to be accessed by a thread Memory allocation checks all hazard pointers to avoid the ABA problem thread A - hp1 - hp2 thread B - hp1 - hp2 thread
More informationAndroid Internals and the Dalvik VM!
Android Internals and the Dalvik VM! Adam Champion, Andy Pyles, Boxuan Gu! Derived in part from presentations by Patrick Brady, Dan Bornstein, and Dan Morrill from Google (http://source.android.com/documentation)!
More informationBytecode Manipulation Techniques for Dynamic Applications for the Java Virtual Machine
Bytecode Manipulation Techniques for Dynamic Applications for the Java Virtual Machine Eugene Kuleshov, Terracotta Tim Eck, Terracotta Tom Ware, Oracle Corporation Charles Nutter, Sun Microsystems, Inc.
More informationNotes of the course - Advanced Programming. Barbara Russo
Notes of the course - Advanced Programming Barbara Russo a.y. 2014-2015 Contents 1 Lecture 2 Lecture 2 - Compilation, Interpreting, and debugging........ 2 1.1 Compiling and interpreting...................
More informationAP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS
AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS PAUL L. BAILEY Abstract. This documents amalgamates various descriptions found on the internet, mostly from Oracle or Wikipedia. Very little of this
More informationinvokedynamic IN 45 MINUTES!!! Wednesday, February 6, 13
invokedynamic IN 45 MINUTES!!! Me Charles Oliver Nutter headius@headius.com, @headius blog.headius.com JRuby Guy at Sun, Engine Yard, Red Hat JVM enthusiast, educator, contributor Earliest adopter of invokedynamic
More informationMetaVM: A Transparent Distributed Object System Supported by Runtime Compiler
MetaVM: A Transparent Distributed Object System Supported by Runtime Compiler Kazuyuki Shudo Yoichi Muraoka School of Science and Engineering Waseda University Okubo 3-4-1, Shinjuku-ku, Tokyo 169-8555,
More informationDesign and Implementation of Pep, a Java Just-In-Time Translator
SML-E-96-49 Published in TAPOS, Theory and Practice of Object Systems 3(2), p. 127-155, 1997. Design and Implementation of Pep, a Java Just-In-Time Translator Ole Agesen Sun Microsystems Laboratories 2
More informationPortable Resource Control in Java: Application to Mobile Agent Security
Portable Resource Control in Java: Application to Mobile Agent Security Walter Binder CoCo Software Engineering GmbH Austria Jarle Hulaas, Alex Villazón, Rory Vidal University of Geneva Switzerland Requirements
More informationCSCE 314 Programming Languages
CSCE 314 Programming Languages! JVM Dr. Hyunyoung Lee 1 Java Virtual Machine and Java The Java Virtual Machine (JVM) is a stack-based abstract computing machine. JVM was designed to support Java -- Some
More informationCode Generation. Frédéric Haziza Spring Department of Computer Systems Uppsala University
Code Generation Frédéric Haziza Department of Computer Systems Uppsala University Spring 2008 Operating Systems Process Management Memory Management Storage Management Compilers Compiling
More informationTaming the Java Virtual Machine. Li Haoyi, Chicago Scala Meetup, 19 Apr 2017
Taming the Java Virtual Machine Li Haoyi, Chicago Scala Meetup, 19 Apr 2017 Who Am I? Previously: Dropbox Engineering Currently: Bright Technology Services - Data Science, Scala consultancy Fluent Code
More informationCode Generation Introduction
Code Generation Introduction i = 0 LF w h i l e i=0 while (i < 10) { a[i] = 7*i+3 i = i + 1 lexer i = 0 while ( i < 10 ) source code (e.g. Scala, Java,C) easy to write Compiler (scalac, gcc) parser type
More informationRunning class Timing on Java HotSpot VM, 1
Compiler construction 2009 Lecture 3. A first look at optimization: Peephole optimization. A simple example A Java class public class A { public static int f (int x) { int r = 3; int s = r + 5; return
More informationCopyright 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 16
1 Copyright 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 16 Towards JVM Dynamic Languages Toolchain Insert Picture Here Attila
More informationProject. there are a couple of 3 person teams. a new drop with new type checking is coming. regroup or see me or forever hold your peace
Project there are a couple of 3 person teams regroup or see me or forever hold your peace a new drop with new type checking is coming using it is optional 1 Compiler Architecture source code Now we jump
More informationLast 2 Classes: Introduction to Operating Systems & C++ tutorial. Today: OS and Computer Architecture
Last 2 Classes: Introduction to Operating Systems & C++ tutorial User apps OS Virtual machine interface hardware physical machine interface An operating system is the interface between the user and the
More informationMichael Rasmussen ZeroTurnaround
Michael Rasmussen ZeroTurnaround Terminology ASM basics Generating bytecode Simple examples Your examples? Lately I ve been, I ve been losing sleep, dreaming about the things that we could be Binary names
More informationObject Oriented Programming: In this course we began an introduction to programming from an object-oriented approach.
CMSC 131: Chapter 28 Final Review: What you learned this semester The Big Picture Object Oriented Programming: In this course we began an introduction to programming from an object-oriented approach. Java
More informationContents. iii Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1998, Revision B
Contents About the Course...xv Course Overview... xvi Course Map... xvii Module-by-Module Overview... xviii Course Objectives... xxii Skills Gained by Module... xxiii Guidelines for Module Pacing... xxiv
More informationCode Profiling. CSE260, Computer Science B: Honors Stony Brook University
Code Profiling CSE260, Computer Science B: Honors Stony Brook University http://www.cs.stonybrook.edu/~cse260 Performance Programs should: solve a problem correctly be readable be flexible (for future
More informationCompiling for Different Platforms. Problem: Too Many Platforms! Dream: Platform Independence. Java Platform 5/3/2011
CS/ENGD 2110 Object-Oriented Programming and Data Structures Spring 2011 Thorsten Joachims Lecture 24: Java Virtual Machine Compiling for Different Platforms Program written in some high-level language
More informationJava TM. Multi-Dispatch in the. Virtual Machine: Design and Implementation. Computing Science University of Saskatchewan
Multi-Dispatch in the Java TM Virtual Machine: Design and Implementation Computing Science University of Saskatchewan Chris Dutchyn (dutchyn@cs.ualberta.ca) September 22, 08 Multi-Dispatch in the Java
More informationTrace Compilation. Christian Wimmer September 2009
Trace Compilation Christian Wimmer cwimmer@uci.edu www.christianwimmer.at September 2009 Department of Computer Science University of California, Irvine Background Institute for System Software Johannes
More informationCMSC430 Spring 2014 Midterm 2 Solutions
CMSC430 Spring 2014 Midterm 2 Solutions 1. (12 pts) Syntax directed translation & type checking Consider the following grammar fragment for an expression for C--: exp CONST IDENT 1 IDENT 2 [ exp 1 ] Assume
More informationCS 480 Fall Runtime Environments. Mike Lam, Professor. (a.k.a. procedure calls and heap management)
CS 480 Fall 2015 Mike Lam, Professor Runtime Environments (a.k.a. procedure calls and heap management) Subprograms General characteristics Single entry point Caller is suspended while subprogram is executing
More informationModern Programming Languages. Lecture Java Programming Language. An Introduction
Modern Programming Languages Lecture 27-30 Java Programming Language An Introduction 107 Java was developed at Sun in the early 1990s and is based on C++. It looks very similar to C++ but it is significantly
More informationPlan for Today. Safe Programming Languages. What is a secure programming language?
cs2220: Engineering Software Class 19: Java Security Java Security Plan for Today Java Byte s () and Verification Fall 2010 UVa David Evans Reminder: Project Team Requests are due before midnight tomorrow
More information