Title: Design, Implementation, and Evaluation of Optimizations in a Just-In-Time Compiler
1Design, Implementation, and Evaluation of
Optimizations in a Just-In-Time Compiler
- Kazuaki Ishizaki, Motohiro Kawahito, et al.
- IBM Tokyo Research Laboratory
- Presentation By
- Allen Chu
2Outline
- Introduction
- Motivation
- JIT Optimizations
- Exception Elimination,
- Common Subexpression Elimination
- Type Inclusion Test
- Result
- Conclusion
3Introduction
- Advantage and Disadvantage of Java
- Safety (Array-Bound Check)
- Reusability and Portability
- But It Is Slow
- Compiler for Java
- Compiler (byte code to native code)
- Just-In-Time Compiler
4Motivation
- Regular Compiler Looses the Portability and
Reusability of Code. - Goal for JIT Compiler
- Preserve Safety and Reusability
- Translation Time of JIT Compiler Execution Time
of Native Code lt Running Time on JVM
5JIT Compiler
class file
- Translation occurs when new method is called.
Build Flow Graph
Method Inlining
Exception Check Elimination
CSE
Register Mapping
Code Generation
native code
6Exception Check Elimination
- Null-Pointer Check Eliminated By Data Flow
Analysis - Array-Bound Check Eliminated By Propagating the
Information of Checked Exception in Data Flow
Analysis - Keep Track of Indices and Range of Checked
Indices.
7Array-Bound Elimination (Cont.)
8CSE
- Scalar Replacement Of Array Element
- Consecutive Array Access Using Interior Pointer
- Instance Variable Elimination
- Replace this.variable
9CSE (Cont.)
Original Code for (x0 x lt 8 x) if
(this.ax lt this.ax1) int t
this.ax this.ax this.ax1
this.ax1 t
CSE Code int la this.a for (x0 x lt 8
x) if (lax lt lax1) int t lax
lax lax1 lax1 t
CSE for Instance Variable
10CSE (Cont.)
Instance Code int la this.a for (x0 x lt
8 x) if (lax lt lax1) int t
lax lax lax1 lax1 t
Array Code int la this.a for (x0 x lt 8
x) int la0lax iv0ia0
iv1(iao1) if (iv0 lt iv1) int t iv0
la0 iv1 (la01) t
CSE for Array
11Type Inclusion Test
Java Code Type to (Type) from Pseudo
Code if (from NULL) then to from else if
(from.type Type) then to from else if
(from.type.lastsucc Type) then to from
else if (call expensive test) then (to from
from.type.lastsucc Type)
12Result - Compress
13Result - Overall
45.433 seconds
No CSE
No Exception
47.294 seconds
45.037 seconds
No Type Test
52.432 seconds
No Inlining
44.993 seconds
No CHA
All Opt. ON
45.168 seconds
54.648 seconds
All Opt. OFF
Execution Time
14Conclusion
- All Optimizations Do Not Improve Execution Speed
All the Time - Overall Combined Optimizations Do Improve
Execution.