120 likes | 254 Views
JAVA Processors and JIT Scheduling. Overview & Literature. Formulation of the problem JAVA introduction Description of Caffeine Literature: “Java Bytecode to Native Code Translation: The Caffeine Prototype and Preliminary Results” written by Hsieh, Gyllenhaal and Hwu, 1996.
E N D
Overview & Literature • Formulation of the problem • JAVA introduction • Description of Caffeine • Literature: “Java Bytecode to Native Code Translation: The Caffeine Prototype and Preliminary Results” written by Hsieh, Gyllenhaal and Hwu, 1996
Formulation of the problem • JAVA is a very well language which runs on different platforms, but executing an application is much slower than that it is written in C. • The goal is to achieve a faster translation from JAVA-bytecode to native code.
Intro: JAVA import java.awg.Frame; class GraphWindow extends Frame { . . . CA FE BA BE 00 03 00 2D . . . . . JAVA Compiler JAVA Sourcecode JAVA Bytecodes
Intro: JAVA Medium (e.g. internet) CA FE BA BE 00 03 00 2D . . . . . * Classloader * Bytecode verificator * JIT Compiler * Classloader * Bytecode verificator * Interpreter (JVM) OS-dependent OS-dependent JAVA Bytecodes In a classfile Pentium / PowerPC Alpha / … native code Pentium / PowerPC Alpha / … native code Machine-dependent Machine-dependent
JAVA: Caffeine Machine-Indep. IR (Lcode) Optimized Machine-Indep. IR Optimizing native code translators JAVA IR IR = Instruction Representation Optimized Machine-Specific IR Medium Bytecode Optimized Native Code
Caffeine: Overview • Stack to Virtual Register Mapping • Stack Analysis • Run-time Memory Organisation
Stack to Virtual Register Mapping (1) • Stack Computation Model • operand stack • local variable array • eliminating some loads and stores • Register Mapping • assign stack locations to unique virtual register numbers • allocate virtual registers to physical regs. • Improvement: 2.8 times faster than JIT
Stack Analysis • If #pushes == #pops in a path of blocks ---> register mapping possible • Else: use the standard stack-model (thus no optimization possible) • Take live range (LR) of stack locations into account • Improvement: 55%
Run-time Memory Organisation • JAVA has two types of objects: • class objects • array objects • Interpreter: there is an 8-byte handler between object and data • Caffeine: no handler • Improvement: 7%
Conclusion / Comparison Percentage of C Performance Caffeine does improve the performance of JAVA-programs, and it is able to reach the goal to make translating JAVAbytecode to native code faster.