Browse Prior Art Database

A new mechod of compiling Java code to machine code with disk cache mechanism

IP.com Disclosure Number: IPCOM000237859D
Publication Date: 2014-Jul-17
Document File: 4 page(s) / 75K

Publishing Venue

The IP.com Prior Art Database

Abstract

The invention idea is a new method for JAVA compilation named JAVA+. JAVA is known as using interpretive executions and just-in-time compilation to compile the byte code to physical machine code. This invention idea JAVA+ is using a new caching behavior to store the compiled physical machine code. In JAVA applications, the JAVA byte code compilation would take a long time, because the application will be very slow at the very beginning as the JVM is busy complying the byte code. The method JAVA+ is at the first time the JAVA class is loaded, the complier starts to compile run-time byte code, and store the smallest executable units in memory, then write them into filesystem under right conditions, and use a file called class+ with the same name of the class file to store the compiled code. The compiled physical machine code now will be stored in the filesystem, when the next time the application is started, the JVM execution engine will just read the complied code from filesystem rather than execute directly. It will be faster as the code will not be compiled again. The compiler reads the bytecodes in many sections, pick the smallest executable units and compiles them dynamically into machine language so the program can run faster. The idea of using JAVA+ is to surpass the performance of interpretive executions and static compilation, while maintaining the advantages of bytecode interpretation: Much of the "heavy lifting" of parsing the original source code and performing basic optimization is often handled at compile time, prior to deployment: compilation from bytecode to machine code is much faster than compiling from source. The JAVA+ could achieve greatly reduced start-up cost at second time without compiling again, reduced memory and CPU usage, and easier dynamic linking with class file by the code map. So JAVA+ will get better performance than JIT and interpretive executions at JAVA class re-loading.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 52% of the total text.

Page 01 of 4

A new mechod of compiling Java code to machine code with disk cache mechanism

JAVA is the most popular high-level programming language. It runs on personal computers, servers, and mobile devices. One of the reasons why JAVA is so popular is that it is intended to let developers "write once, run anywhere". The JAVA application will be compiled into byte code which is not hardware-specific. The byte code then will be interpreted into native code (machine code) by JAVA virtual machine (JVM). JAVA also have many edition such as JAVA SE and JAVA EE. Here we are mainly focus on JAVA EE which stand for JAVA Enterprise Edition.

However, since byte code is interpreted, it executes more slowly than compiled native code. In order to improve this, just-in-time compilation (JIT) has been introduced to JVM. The basic function of JIT is to translate byte code into native code as necessary at runtime, and then to cache and reuse the later without recompiling. As a result, the execution speed of the application becomes faster.

JIT can boost the JAVA application, but it also brings some new issues. First, the performance of JIT is severely constrained in terms of compiler speed. If it is not fast, then the user will perceive a significant delay in the startup of a program or part of a program. Second, since JIT would not compile every parts of the program, it is more difficult to perform advanced optimizations. Thus, the compiled program would still not be as fast as traditional languages like C or C++.

Rather than compiling by different methods, just in time, a new and improved JVM called HotSpot. HotSpot uses the interpreter to run the program immediately, and during the runtime, the Profile Monitor is used to detect the "hot" methods of the program . Then it focuses the attention of a global native-code optimizer on the "hot" methods. HotSpot balances compiling and interpreting to achieve better overall performance. Certainly it still has some space to be optimized. The HotSpot caches the compiled native code in the memory for reusing and would release some compiled code when memory is full . Here we would like to discuss a way to improve the cache mechanism of JVM.

Main idea

JAVA code (.class file) is virtual ISA (Instruction Set Architecture). JAVA+ is a feature in JAVA that slowly compiles the byte code to target machine code (ISA). JAVA+ can improve JAVA performance in J2EE application.

Details:

Per-condition:


JAVA+ is based on JAVA. It is a function in JVM,
JAVA+ requires 3 arguments. 2 is required, 1 is optional.
Syntax:

1


Page 02 of 4

-JAVA+

-JAVA+.path=

{-JAVA+.check=<true(default)|false}

JAVA+:
This is JAVA+ enable/disable switch. JAVA+ is disabled by default. Wh...