jvm, byte codes & jvm languages

12
JVM, Byte Codes & Languages

Upload: edgarespina

Post on 15-Jan-2015

1.174 views

Category:

Technology


4 download

DESCRIPTION

 

TRANSCRIPT

Page 1: JVM, byte codes & jvm languages

JVM, Byte Codes & Languages

Page 2: JVM, byte codes & jvm languages

Agenda

• The Java Virtual Machine

• Architecture neutral

• Interpreted and Dynamic

• Secure

• Multithreading

• Implementations

• Byte Code Manipulation

• New Language and DSL

Page 3: JVM, byte codes & jvm languages

JVM: Architecture Neutral

• Byte codes

• Portable

• Robust

Page 4: JVM, byte codes & jvm languages

JVM : Interpreted and Dynamic

• Dynamic Loading and Binding

• The Fragile Superclass Problem

• Solving the Fragile Superclass Problem

• Run-time Representations

Page 5: JVM, byte codes & jvm languages

JVM : Secure

• Memory Allocation and Layout

• Security Checks in the Class Loader

• The Byte Code Verification Process

Bootstrap +Extension

System

Java Application

Bootstrap +Extension

System

Tomcat Application

Common/Shared

Web App A Web App B

Page 6: JVM, byte codes & jvm languages

JVM : Multithreading

• Threads at the Java Language Level

• Integrated Thread Synchronization

Page 7: JVM, byte codes & jvm languages

JVM : Implementations

• Java Virtual Machine Reference Implementation (Oracle)

• Open SDK (Oracle)

• JRockit (Oracle)

• Apache Harmony (Apache)

• IBM JVM (IBM)

• Zing (Azul System)

• The Da Vinci Machine (Java 7/8, Oracle)

Page 8: JVM, byte codes & jvm languages

Byte Code Manipulation

• Low Level API

• ASM (ObjectWeb)

• Javassist (JBoss)

• BCEL (Apache)

• High Level API

• CGLib

• The Compiler API (Java 6)

• AOP: Aspect J, java.lang.reflect.Proxy

Page 9: JVM, byte codes & jvm languages

Byte Code Manipulation: Hooks

• ClassLoader

• java.lang.instrument: Java Agent, premain method, ClassFileTransformer.

Page 10: JVM, byte codes & jvm languages

New Language and DSL

• New Languages

• Clojure, Groovy, Scala, JRuby, Jython, Rhino, Ceylon, Kotlin

• Domain-Specific Language

• HQL, JPQL

• Drools

• Custom

Page 11: JVM, byte codes & jvm languages

New Language and DSL: Implementation

• Write a parser/compiler/interpreter with:

• ANTLR, JavaCC, xText, Parboiled

• Write a AST (Abstract Syntax Tree) for:

• Analysis and error reporting

• Transform the AST to one target platform (SQL, Java Source Code, Byte Code).

Page 12: JVM, byte codes & jvm languages

Questions?