JVM, Byte Codes & Languages
Agenda
• The Java Virtual Machine
• Architecture neutral
• Interpreted and Dynamic
• Secure
• Multithreading
• Implementations
• Byte Code Manipulation
• New Language and DSL
JVM: Architecture Neutral
• Byte codes
• Portable
• Robust
JVM : Interpreted and Dynamic
• Dynamic Loading and Binding
• The Fragile Superclass Problem
• Solving the Fragile Superclass Problem
• Run-time Representations
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
JVM : Multithreading
• Threads at the Java Language Level
• Integrated Thread Synchronization
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)
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
Byte Code Manipulation: Hooks
• ClassLoader
• java.lang.instrument: Java Agent, premain method, ClassFileTransformer.
New Language and DSL
• New Languages
• Clojure, Groovy, Scala, JRuby, Jython, Rhino, Ceylon, Kotlin
• Domain-Specific Language
• HQL, JPQL
• Drools
• Custom
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).
Questions?
Top Related